mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-18 07:34:54 +00:00
runDialog: Launch command as app
The run dialog is often used to launch graphical apps, which ideally should be launched with an activation ID. Switch to the new `trySpawnApp()` function to do just that. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7704
This commit is contained in:
parent
880a599b3f
commit
16e129c6cd
1 changed files with 7 additions and 1 deletions
|
|
@ -201,7 +201,8 @@ class RunDialog extends ModalDialog.ModalDialog {
|
|||
let execArg = this._terminalSettings.get_string(EXEC_ARG_KEY);
|
||||
command = `${exec} ${execArg} ${input}`;
|
||||
}
|
||||
Util.trySpawnCommandLine(command);
|
||||
const [, argv] = GLib.shell_parse_argv(command);
|
||||
Util.trySpawnApp(argv);
|
||||
} catch (e) {
|
||||
// Mmmh, that failed - see if @input matches an existing file
|
||||
let path = null;
|
||||
|
|
@ -227,6 +228,11 @@ class RunDialog extends ModalDialog.ModalDialog {
|
|||
this._showError(message);
|
||||
}
|
||||
} else {
|
||||
// Replace "Error invoking GLib.shell_parse_argv: " with something nicer
|
||||
if (e.message.includes('shell_parse_argv')) {
|
||||
e.message = e.message.replace(/[^:]*: /,
|
||||
`${_('Could not parse command:')}\n`);
|
||||
}
|
||||
this._showError(e.message);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue