1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2025-07-31 21:59:25 -04:00

[DRun] Only go to file completer if desktop file support url.

This commit is contained in:
Dave Davenport 2021-06-08 19:35:51 +02:00
parent 6b9de4644e
commit 6178970499
2 changed files with 16 additions and 7 deletions

View file

@ -863,6 +863,10 @@ in a terminal if specified in the Desktop File.
Pressing the `delete-entry` binding (`shift-delete`) will remove this entry from the run history. Pressing the `delete-entry` binding (`shift-delete`) will remove this entry from the run history.
Pressing the `accept-custom` binding (`control-enter` or `shift-enter`) will run the command in a terminal. Pressing the `accept-custom` binding (`control-enter` or `shift-enter`) will run the command in a terminal.
When pressing the `mode-complete` binding (`Control-l`), you can use the File Browser mode to launch the application
passing a file as argument if specified in the desktop file.
The DRUN mode tries to follows the [XDG Desktop Entry The DRUN mode tries to follows the [XDG Desktop Entry
Specification](https://freedesktop.org/wiki/Specifications/desktop-entry-spec/) and should be compatible with Specification](https://freedesktop.org/wiki/Specifications/desktop-entry-spec/) and should be compatible with
applications using this standard. Some application create invalid desktop files, **rofi** will discard these entries. applications using this standard. Some application create invalid desktop files, **rofi** will discard these entries.

View file

@ -1136,6 +1136,9 @@ static ModeMode drun_mode_result ( Mode *sw, int mretv, char **input, unsigned i
case DRUN_DESKTOP_ENTRY_TYPE_SERVICE: case DRUN_DESKTOP_ENTRY_TYPE_SERVICE:
case DRUN_DESKTOP_ENTRY_TYPE_APPLICATION: case DRUN_DESKTOP_ENTRY_TYPE_APPLICATION:
{ {
GRegex *regex = g_regex_new ("%[fFuU]", 0, 0, NULL);
if (g_regex_match (regex, rmpd->entry_list[selected_line].exec, 0, NULL) ) {
rmpd->selected_line = selected_line; rmpd->selected_line = selected_line;
// TODO add check if it supports passing file. // TODO add check if it supports passing file.
@ -1147,6 +1150,8 @@ static ModeMode drun_mode_result ( Mode *sw, int mretv, char **input, unsigned i
rmpd->file_complete = TRUE; rmpd->file_complete = TRUE;
} }
g_regex_unref ( regex );
}
default: default:
break; break;
} }