diff options
author | Mike Dalessio <mike.dalessio@gmail.com> | 2020-08-26 15:10:04 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-26 21:10:04 +0200 |
commit | 5bec191d2ef3f7083573a99b4f9dd4fcc4a68208 (patch) | |
tree | 3bd26df111d7c0ea16a3bd71cfe62d81c0d58ed1 /config | |
parent | 120ce36055e3144ebb12493daed239f42fa7f755 (diff) |
Follow Type=Link standard desktop entries with drun (#1168)
* [DRun] Introduce data structure changes for Link desktop entries
From the [freedesktop spec][1]:
> This specification defines 3 types of desktop entries:
> Application (type 1), Link (type 2) and Directory (type 3). To allow
> the addition of new types in the future, implementations should
> ignore desktop entries with an unknown type.
This commit adds an enum to capture these types, and adds `type` to
DRunModeEntry.
[1]: https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
part of #1166
* [DRun] Sanity check Link entries and capture the URL
Note that we're introducing some logic that will differ depending on
the Desktop entry type (Application or Link). The logic is:
- if entry is Application type,
- then Exec is required
- and the value is saved in .exec
- and drun_mode_result calls exec_cmd_entry
- if entry is Link type,
- then URL is required (but is not saved in the DRunModeEntry)
- and drun_mode_result calls new function launch_link_entry
part of #1166
* [DRun] Launch desktop links via xdg-open
Note that this introduces a new dependency on xdg-open, which may not
be installed. In that case, rofi will display an error dialog
with something like:
"Failed to execute child process xdg-open (No such file or directory)"
which hopefully is explanatory enough for folks.
part of #1166
* Make drun options comments consistent and add a bit of whitespace
* [DRun] new config option drun-url-launcher for opening links
In previous commit, this was a hard-coded string.
part of #1166
Diffstat (limited to 'config')
-rw-r--r-- | config/config.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/config/config.c b/config/config.c index fe8fcc42..6e256e53 100644 --- a/config/config.c +++ b/config/config.c @@ -116,14 +116,18 @@ Settings config = { .tokenize = TRUE, .matching = "normal", .matching_method = MM_NORMAL, - /** Desktop entry fields to match*/ + + /** Desktop entries to match in drun */ .drun_match_fields = "name,generic,exec,categories,keywords", + /** Only show entries in this category */ .drun_categories = NULL, - /** Desktop format display */ - .drun_display_format = "{name} [<span weight='light' size='small'><i>({generic})</i></span>]", /** Desktop entry show actions */ .drun_show_actions = FALSE, - /** Desktop entry show actions */ + /** Desktop format display */ + .drun_display_format = "{name} [<span weight='light' size='small'><i>({generic})</i></span>]", + /** Desktop Link launch command */ + .drun_url_launcher = "xdg-open", + /** Window fields to match in window mode*/ .window_match_fields = "all", /** Monitor */ @@ -160,8 +164,11 @@ Settings config = { .cache_dir = NULL, .window_thumbnail = FALSE, + + /** drun cache */ .drun_use_desktop_cache = FALSE, .drun_reload_desktop_cache = FALSE, + /** Benchmarks */ .benchmark_ui = FALSE }; |