20
849
Fork
You've already forked fuzzel
83

[Feature Request] Add option -i|--ignore <file> #456

Open
opened 2025年01月01日 13:20:24 +01:00 by napcok · 7 comments

...to specify a file listing .desktop files to exclude from the output.

labwc-menu-generator have this implemented.

...to specify a file listing .desktop files to exclude from the output. labwc-menu-generator have this [implemented](https://github.com/labwc/labwc-menu-generator/commit/9af2b3dd174d89ca9b1ead95b3621779e506cc0d).

+1
This would be so useful for people using window managers.
Heres why. In most configs I see people doing something like this:
meta+e = Thunar
meta+E = ranger
meta+alt+e = PCManFM
meta+alt+E = Dolphin
This can quickly become bothersome, especially if your not using them all the time. As you forget exactly which bind opens your desired application.

Adding a feature like this that allows ignoring OR including a set of entries, means we can use fuzzel to generate bespoke application launchers.
One could argue this can be done in fuzzel's dmenu mode, however this means missing out on the large logo on the bottom of the window present when theres not many entries.

+1 This would be so useful for people using window managers. Heres why. In most configs I see people doing something like this: meta+e = Thunar meta+E = ranger meta+alt+e = PCManFM meta+alt+E = Dolphin This can quickly become bothersome, especially if your not using them all the time. As you forget exactly which bind opens your desired application. Adding a feature like this that allows **ignoring** OR **including** a set of entries, means we can use fuzzel to generate bespoke application launchers. One could argue this can be done in fuzzel's dmenu mode, however this means missing out on the large logo on the bottom of the window present when theres not many entries.

I don't understand. I get why you'd maybe wanna ignore something. Editing a *.desktop file manually IMO isn't a good solution in general. So somekinda blacklist would be good.

For @Sneethe ... i don't get what you mean. Just open fuzzel and search for what you wanna open? All desktop files are included by default... so i'm confused about what exactly you want to achieve.

I don't understand. I get why you'd maybe wanna ignore something. Editing a *.desktop file manually IMO isn't a good solution in general. So somekinda blacklist would be good. For @Sneethe ... i don't get what you mean. Just open fuzzel and search for what you wanna open? All desktop files are included by default... so i'm confused about what exactly you want to achieve.
Collaborator
Copy link

. Editing a *.desktop file manually IMO isn't a good solution in general. So somekinda blacklist would be good.

The XDG Desktop Entries standard for .desktop files is designed to cover this case, specifying that if you don't want to display a file, you can add a .desktop file to ~/.local/share/applicationswith NoDisplay=true. Then every launcher-- not just Fuzzel-- will respect hiding that app.

Fuzzel should already support "bespoke application launchers" because it supports the XDG_DATA_HOME and XDG_DATA_DIRS environment variables. These could be better documented by Fuzzel.

https://specifications.freedesktop.org/basedir-spec/latest/

In theory, you could launch Fuzzel with these set a different value for a bespoke menu. It would work by symlink any apps you want to appear in this menu into an "applications" sub directory of your custom XDG_DATA_HOME value.

In practice, I tried some and could not get this to work easily. Part of the issue is that XDG_DATA_HOME is also used as a search path for icons, so you have to make sure your private directory sets up the icons as well.

The other workaround already offered is to pre-fill the with the --search option as well to specify which fields are searched with the --fields option.

For example, to bring up a menu that contains only apps related to settings, you could use:

fuzzel --search settings --fields=categories,keywords

Though the problem with that approach is that after the menu is displayed, you can't actually fuzzy match on the name....

So I'm agreeing with the problem statement that Fuzzel could better support creating "bespoke" menus, although I'm not sure adding the --ignore flag is best way to do it.

We should also explore better ways to express what you do want in the menu instead of what you don't.

> . Editing a *.desktop file manually IMO isn't a good solution in general. So somekinda blacklist would be good. The XDG Desktop Entries standard for .desktop files is designed to cover this case, specifying that if you don't want to display a file, you can add a .desktop file to` ~/.local/share/applications`with `NoDisplay=true`. Then every launcher-- not just Fuzzel-- will respect hiding that app. Fuzzel should already support "bespoke application launchers" because it supports the XDG_DATA_HOME and XDG_DATA_DIRS environment variables. These could be better documented by Fuzzel. https://specifications.freedesktop.org/basedir-spec/latest/ In theory, you could launch Fuzzel with these set a different value for a bespoke menu. It would work by symlink any apps you want to appear in this menu into an "applications" sub directory of your custom XDG_DATA_HOME value. In practice, I tried some and could not get this to work easily. Part of the issue is that XDG_DATA_HOME is also used as a search path for icons, so you have to make sure your private directory sets up the icons as well. The other workaround already offered is to pre-fill the with the `--search` option as well to specify which fields are searched with the `--fields` option. For example, to bring up a menu that contains only apps related to settings, you could use: ``` fuzzel --search settings --fields=categories,keywords ``` Though the problem with that approach is that after the menu is displayed, you can't actually fuzzy match on the name.... So I'm agreeing with the problem statement that Fuzzel could better support creating "bespoke" menus, although I'm not sure adding the `--ignore` flag is best way to do it. We should also explore better ways to express what you *do* want in the menu instead of what you *don't*.

. Editing a *.desktop file manually IMO isn't a good solution in general. So somekinda blacklist would be good.

The XDG Desktop Entries standard for .desktop files is designed to cover this case, specifying that if you don't want to display a file, you can add a .desktop file to ~/.local/share/applicationswith NoDisplay=true. Then every launcher-- not just Fuzzel-- will respect hiding that app.

I know. It's still a bad solution to manually touch those files. Those files can easily be overwritten on updates and if you overwrite it yourself in your local apps folder, you will need to watch out for changes in the "original" desktop file as well.

What i do in Walker is a simple array of regexps. This allows to also just ignore single actions instead of the whole desktop file. IMO that's a good solution.

> > . Editing a *.desktop file manually IMO isn't a good solution in general. So somekinda blacklist would be good. > > The XDG Desktop Entries standard for .desktop files is designed to cover this case, specifying that if you don't want to display a file, you can add a .desktop file to` ~/.local/share/applications`with `NoDisplay=true`. Then every launcher-- not just Fuzzel-- will respect hiding that app. > I know. It's still a bad solution to manually touch those files. Those files can easily be overwritten on updates and if you overwrite it yourself in your local apps folder, you will need to watch out for changes in the "original" desktop file as well. What i do in Walker is a simple array of regexps. This allows to also just ignore single actions instead of the whole desktop file. IMO that's a good solution.
Collaborator
Copy link

It's still a bad solution to manually touch those files.

The purpose of files in ~/.local/share/applications is to be touched by use.

Those files can easily be overwritten on updates

No, package updates don't touch this folder. Packages get updated in /usr/share/applications or in Flatpaks.

If you want to ignore all Desktop actions, Fuzzel has an option to disable those.

> It's still a bad solution to manually touch those files. The purpose of files in ~/.local/share/applications is to be touched by use. > Those files can easily be overwritten on updates No, package updates don't touch this folder. Packages get updated in `/usr/share/applications` or in Flatpaks. If you want to ignore all Desktop actions, Fuzzel has an option to disable those.
Collaborator
Copy link

I tested this one-liner will disable the display of a .desktop file. You need to find the file name from /usr/local/share/applications first:

echo -e '[Desktop Entry]\nNoDisplay=true'>~/.local/share/applications/electron32.desktop

This covers the global case. I'm leaving this issue open to consider the use for "bespoke" cases like:

"Build me a menu which includes only files in the Settings category but ignores the printing app I have installed".

I'm still not convinced this couldn't be covered with other methods already supported to load .desktop from different directories, though.

I tested this one-liner will disable the display of a .desktop file. You need to find the file name from /usr/local/share/applications first: ``` echo -e '[Desktop Entry]\nNoDisplay=true'>~/.local/share/applications/electron32.desktop ``` This covers the global case. I'm leaving this issue open to consider the use for "bespoke" cases like: "Build me a menu which includes only files in the Settings category but ignores the printing app I have installed". I'm still not convinced this couldn't be covered with other methods already supported to load .desktop from different directories, though.

i know this is an old thread, but what about filtering by matches in filenames? using something like match-exclude=wine, waydroid, calf would prevent editing those files and keep the config less cluttered. Especially in cases like Waydroid, which generates a lot of unwanted entries.

i made a very quick implementation, it only adds regex.h as extra header), but wanna ask before doing a possible PR

Without filtering (using lastest fuzzel version):
image

Filtering all entries with "a" in their filename:
image

Filtering other specific entries:
image

Passing filtering as argument:
image

i know this is an old thread, but what about filtering by matches in filenames? using something like `match-exclude=wine, waydroid, calf` would prevent editing those files and keep the config less cluttered. Especially in cases like Waydroid, which generates a lot of unwanted entries. i made a [very quick implementation](https://codeberg.org/ItsZariep/fuzze), it only adds `regex.h` as extra header), but wanna ask before doing a possible PR Without filtering (using lastest fuzzel version): ![image](/attachments/26cbe385-85f6-4110-b02e-874dc39b0843) Filtering all entries with "a" in their filename: ![image](/attachments/f07e7221-3e7b-4bee-b17d-01bd110819a5) Filtering other specific entries: ![image](/attachments/b4cfa4b6-a2a8-462c-af05-4dc04dba9ca8) Passing filtering as argument: ![image](/attachments/ce86dcdc-707d-4df0-87b1-cf638d5b2b0c)
Sign in to join this conversation.
No Branch/Tag specified
master
gnome-support
releases/1.14
issue-319-window-switching
issue-561-nord-theme-only
resvg-filtering-take-2
resvg-filtering
releases/1.13
rehanzo-dont-ignore-execute-648
keybinds-overwrite
issue-561-refresh-theme
ci-automated-testing
reenable-legacy-icons
releases/1.12
test-coverage-for-fzf-caching
releases/1.11
releases/1.10
releases/1.9
releases/1.8
releases/1.7
releases/1.6
releases/1.5
releases/1.4
releases/1.3
releases/1.2
releases/1.1
releases/1.0
1.14.1
1.14.0
1.13.1
1.13.0
1.12.0
1.11.1
1.11.0
1.10.2
1.10.1
1.10.0
1.9.2
1.9.1
1.9.0
1.8.2
1.8.1
1.8.0
1.7.0
1.6.5
1.6.4
1.6.3
1.6.2
1.6.1
1.6.0
1.5.4
1.5.3
1.5.2
1.5.1
1.5.0
1.4.2
1.4.1
1.4.0
1.3.0
1.2.0
1.1.0
1.0.1
1.0.0
0.9.0
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dnkl/fuzzel#456
Reference in a new issue
dnkl/fuzzel
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?