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

Possible to customize the start menu>leave options? #876

Closed
gituser6 opened this issue Nov 4, 2015 · 31 comments
Closed

Possible to customize the start menu>leave options? #876

gituser6 opened this issue Nov 4, 2015 · 31 comments
Labels
Projects

Comments

@gituser6
Copy link

gituser6 commented Nov 4, 2015

I am wondering if the "Leave" options can be edited? I'd like to remove a few of them from showing up.

@Vladimir-csp
Copy link

Menu entries are .desktop files, so they can be overridden like any application.
Buttons in generic lxqt-leave dialog are another story, not editatble. And #580 was rejected.

@gituser6
Copy link
Author

gituser6 commented Nov 4, 2015

So I can remove "Leave" totally by deleting /usr/share/desktop-directories/lxqt-leave.directory but I cannot remove or edit some of the options you are saying? Is it possible for me to compile it from source without any option except logout? Or is there an alternative involving deleting /usr/share/desktop-directories/lxqt-leave.directory and adding a logout button somehow? Thank you :)

@Vladimir-csp
Copy link

/usr/share/desktop-directories/lxqt-leave.directory is just a menu directory description.
Application entries are:
/usr/share/applications/lxqt-{logout,reboot,shutdown,suspend,hibernate,lockscreen}.desktop.
They can be edited, or overridden on user-level, see desktop entry spec

@gituser6
Copy link
Author

gituser6 commented Nov 4, 2015

Thank you. I was able to add the Hidden=true to them and now it works the way I would like it to.

@pmattern
Copy link
Contributor

pmattern commented Nov 4, 2015

In case you don't want to read the whole specification stated above changes on a per-user basis can be made by copying the files to ~/.local/share/applications. (Of course you can edit files in that directory from scratch as well but this doesn't seem to be needed to solve your problem.)

Btw. eventually providing a GUI to edit those desktop entry files is discussed in #820.

If your question got answered by now please close this issue by hitting the respective button below the form to file comments.

@gituser6
Copy link
Author

gituser6 commented Nov 4, 2015

Thank you both!

@gituser6
Copy link
Author

gituser6 commented Nov 6, 2015

Sorry, I had to reopen this. I copied these to ~/.local/share/applications and added the Hidden=true line to each of them, but lxqt doesn't respect the files it seems after I logged out and back in because I still see them listed in the menu under "Leave."

% ls ~/.local/share/applications  
lxqt-hibernate.desktop  lxqt-leave.desktop  lxqt-reboot.desktop  lxqt-shutdown.desktop  lxqt-suspend.desktop

Example:

% grep Hidden ~/.local/share/applications/lxqt*.desktop
/home/mags/.local/share/applications/lxqt-hibernate.desktop:Hidden=true
/home/mags/.local/share/applications/lxqt-leave.desktop:Hidden=true
/home/mags/.local/share/applications/lxqt-reboot.desktop:Hidden=true
/home/mags/.local/share/applications/lxqt-shutdown.desktop:Hidden=true
/home/mags/.local/share/applications/lxqt-suspend.desktop:Hidden=true

Is there something else I need to do?

@gituser6 gituser6 reopened this Nov 6, 2015
@tsujan
Copy link
Member

tsujan commented Nov 6, 2015

Try "NoDisplay=true"!

@gituser6
Copy link
Author

gituser6 commented Nov 6, 2015

Yes, that worked, thank you.

@gituser6 gituser6 closed this as completed Nov 6, 2015
@pmattern
Copy link
Contributor

pmattern commented Nov 7, 2015

This got me curious so I compared the behaviour of KDE, LXQt, LXDE and Xfce.

Both NoDisplay=true and Hidden=true prevent the corresponding topic from appearing in the menu if stated in files /usr/share/applications/*.desktop in all those desktop environments. In files ~/.local/share/applications/*.desktop both keys behave the same as in /usr/share/applications in Xfce, in KDE and LXQt only NoDisplay=true works while Hidden=true doesn't have any effect and in LXDE ~/.local/share/applications doesn't seem to get considered at all.
The specification doesn't give hints regarding any different behaviour of Hidden=true at those two different paths.

All in all this seems a bit odd to me. Shouldn't both keys have the same effect at both locations suggesting that there's something wrong with the implementations e. g. in KDE and LXQt? Am I missing something?

@gituser6
If you should ever happen to see changes in the menu apparently no taking place again you may bear in mind #65. (Just FYI, doesn't affect the problem discussed here.)

@Vladimir-csp
Copy link

By spec, the difference between NoDisplay and Hidden is that NoDisplay should just hide entry from showing up in menus, but still leaving it in resulting application database, autostart, etc. Hidden should completely remove application from resulting application database (and from menus, obviously) as if no desktop entry for it exists. So there is clearly a misimplementation somewhere (libqtxdg?).

@knm100
Copy link

knm100 commented Jun 5, 2024

This way doesn't seem to work for Wayland session, it is possible to customize the leave menu for wayland session

@stefonarch
Copy link
Member

You mean the central leave menu with the 6 options or the one in the applications menu? The first one can't be customized, the latter should work.

@knm100
Copy link

knm100 commented Jun 5, 2024

I mean the central leave menu with the 6 options, but I tried, it didn't work.
swappy-20240605-165310

@stefonarch
Copy link
Member

As I said: this can't be configured by modifying .desktop files.

@knm100
Copy link

knm100 commented Jun 5, 2024

Sorry, I had to reopen this. I copied these to ~/.local/share/applications and added the Hidden=true line to each of them, but lxqt doesn't respect the files it seems after I logged out and back in because I still see them listed in the menu under "Leave."

I see @Vladimir-csp did it by this way ,and it worked, isn't this way only for X11 and not for wayland?

@stefonarch
Copy link
Member

There is no difference between wayland and x11 here.
NoDisplay=true works in the panel menu → Leave.

@knm100
Copy link

knm100 commented Jun 5, 2024

Sorry, I had to reopen this. I copied these to ~/.local/share/applications and added the Hidden=true line to each of them, but lxqt doesn't respect the files it seems after I logged out and back in because I still see them listed in the menu under "Leave."

% ls ~/.local/share/applications  
lxqt-hibernate.desktop  lxqt-leave.desktop  lxqt-reboot.desktop  lxqt-shutdown.desktop  lxqt-suspend.desktop

Example:

% grep Hidden ~/.local/share/applications/lxqt*.desktop
/home/mags/.local/share/applications/lxqt-hibernate.desktop:Hidden=true
/home/mags/.local/share/applications/lxqt-leave.desktop:Hidden=true
/home/mags/.local/share/applications/lxqt-reboot.desktop:Hidden=true
/home/mags/.local/share/applications/lxqt-shutdown.desktop:Hidden=true
/home/mags/.local/share/applications/lxqt-suspend.desktop:Hidden=true

But judging from what @gituser6 said, it was definitely not about "leave button in main menu", it was about the leave menu with the 6 options

@tsujan
Copy link
Member

tsujan commented Jun 5, 2024

@knm100
Any item you see in the main menu or Fancy menu corresponds to a desktop entry. NoDisplay=true and similar key-values work with all, regardless of X11 and Wayland.

@knm100
Copy link

knm100 commented Jun 5, 2024

@tsujan if I want to hide the button or change the icon of the button of lock screen under the leave menu. is it possible? It look like it's in neither the main menu nor the fancy menu

@tsujan
Copy link
Member

tsujan commented Jun 5, 2024

The icons are taken from your icon theme. They can also be changed in desktop entries (Icon=...). You may need to restart the panel to see the effect.

@tsujan
Copy link
Member

tsujan commented Jun 5, 2024

If by "button" you mean a button inside a dialog, and not a menu entry, the only way to change its icon is changing your icon theme.

@knm100
Copy link

knm100 commented Jun 5, 2024

@stefonarch @tsujan Thank you both for helping me figure this out

@knm100
Copy link

knm100 commented Jun 5, 2024

@tsujan, One more question: So the section 4.2 of lxqt wiki in archwiki is not true. (https://wiki.archlinux.org/title/LXQt )

@tsujan
Copy link
Member

tsujan commented Jun 5, 2024

So the section 4.2 of lxqt wiki in archwiki is not true

It is correct. It's about the items you see under the "Leave" sub-menu, not about the buttons inside lxqt-leave dialog. That dialog shows all options.

@knm100
Copy link

knm100 commented Jun 5, 2024

but it is not work for me . I can't remove(or hidde) the lock screen option
swappy-20240605-165310

@stefonarch
Copy link
Member

Some screenshots.
I have set NoDisplay=true for hibernation to avoid clicking it by mistake as it is buggy on my laptop.

It works here (panel applications menus):

immagine
It will never work here (leave dialog):

immagine

@knm100
Copy link

knm100 commented Jun 6, 2024

After looking at your screenshot, I realized that there is a leave menu in the fancy menu.
In my case, the leave menu in the fancy menu is also problematic, whether I set NoDisplay=true or not, it doesn't change here, there is no lock screen option, leave options instead.
swappy-20240606-085349

lockscrenn

@Vladimir-csp
Copy link

Long time ago I suggested a thing that would prevent this issue from happening, at least the logout dialog part: #580

@stefonarch
Copy link
Member

@knm100 in your screenshot NoDisplay=true is commented out...

In the application menus "Lock Screen" is not displayed inside the "Leave" menu as it isn't part of Categories=System;X-Leave;.

@knm100
Copy link

knm100 commented Jun 6, 2024

thank you it work in fancy menu, if i cp /usr/share/applications/lxqt-hibernate.desktop ~/.local/share/applications
and add the NoDisplay=true to ~/.local/share/applications/lxqt-hibernate.desktop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Issues
  
Translations and L10N
Development

No branches or pull requests

6 participants