Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

menubar/utils.lua: Can't override system desktop files with NoDisplay=true #2396

Closed
doronbehar opened this issue Sep 21, 2018 · 5 comments
Closed

Comments

@doronbehar
Copy link

doronbehar commented Sep 21, 2018

Output of awesome --version:

awesome v4.2 (Human after all)
 • Compiled against Lua 5.3.5 (running with Lua 5.3)
 • D-Bus support: ✔
 • execinfo support: ✔
 • xcb-randr version: 1.6
 • LGI version: 0.9.2

How to reproduce the issue:

Based on https://wiki.archlinux.org/index.php/Desktop_entries#Hide_desktop_entries:

  1. Copy a desktop file from /usr/share/applications/ (firefox.desktop for example) to ~/.local/share/applications.
  2. Add NoDisplay=true under [Desktop Entry] to your copy of the desktop file in ~/.local/share/applications.
  3. Run update-desktop-database ~/.local/share/applications in order to update the desktop entries of the system along with the user installed ones.
  4. Restart Awesome.

Actual result:

The firefox program is still visible when running menubar.show().

Expected result:

The firefox program is not visible when running menubar.show().

My suspicion:

I've read the source code of the menubar module and I think the problem is that although the NoDisplay entry is read and checked against "true", perhaps it is still being merged with the system's original desktop entry which doesn't have NoDisplay=true in it's [Desktop Entry].

@psychon
Copy link
Member

psychon commented Sep 24, 2018

This might be a duplicate of #1816 (since the instructions start with "Copy"; I have not actually checked if we handle NoDisplay correctly).

@doronbehar
Copy link
Author

It seems that you do:

-- Don't show program if NoDisplay attribute is true
if program.NoDisplay then
program.show = false
else

But as I said, I think that in case NoDisplay does appear there we need to check whether we are reading a desktop file from the user's ~/.local/share/applications and if so, remove the corresponding desktop file representation in the table generated somewhere around here:

function menu_gen.generate(callback)

As far as I see, fixing this will require many changes to the structure of these functions but it is certainly possible.

@psychon
Copy link
Member

psychon commented Sep 25, 2018

Okay, since you agree: Closing as a duplicate of #1816

@psychon psychon closed this as completed Sep 25, 2018
@psychon
Copy link
Member

psychon commented Sep 25, 2018

Oh and to make things possibly clearer:

You write:

perhaps it is still being merged with the system's original desktop entry which doesn't have NoDisplay=true in it's [Desktop Entry].

Nope. The problem is that each .desktop file is handled independently. Thus, if neither one had NoDisplay=true, than you would get the entry twice.

Actually, fixing #1816 should not be that hard, I would expect. We would just need to generate the desktop file IDs and track them, so that if the same ID appears again later, the later one can be ignored....

@doronbehar
Copy link
Author

Agree. We need to consider the location of the desktop files and if a desktop id appears twice, we need to use the one that is used in ~/.local/share/applications or /usr/local/share/applications and only then /usr/share/applications, in other words the order is important.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants