SOLVED! Edit menu default entries

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
ccc

SOLVED! Edit menu default entries

Post by ccc »

Hi

Where are default entries from panel menu stored?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
seppalta

Re: Edit menu default entries

Post by seppalta »

Not sure what you are asking. Main menu items are coordinated with .desktop files, the main menu categories are /etc/xdg/menus, and the taskbar (panels) controls can be brought up by right clicking the panel. See for http://douwil7.100webspace.net/linux/Tuning.html for more information and details.
ccc

Re: Edit menu default entries

Post by ccc »

I'd like to change & find out where the "Logout" button from the main menu is.
It is not /etc/xdg/menus and not in /usr/share/applications.
baptiste

Re: Edit menu default entries

Post by baptiste »

found it in ~/.config/lxpanel/LXDE

in the config file for the panel, you have this entry for the "start menu".
this looks easy and plain, I guess we can add an icon for the run box dialog :)

Code: Select all

Plugin {
    type = menu
    Config {
        image=/usr/share/lxde/images/lxde-icon.png
        system {
        }
        separator {
        }
        item {
            command=run
        }
        separator {
        }
        item {
            image=gnome-logout
            command=logout
        }
    }
}
lxpanel may overwrite it so it may be best to refrain from right-clicking, or making the file read-only and see how much it likes that.
baptiste

Re: Edit menu default entries

Post by baptiste »

and the other config file is that, which contains what is run if you hit the button, less useful but you could do something crazy like a command that logs you out right now with no warning.

Code: Select all

[Command]
FileManager=pcmanfm %s
Terminal=x-terminal-emulator
Logout=lxde-logout
everything else, that deals with .desktop files and maybe /etc/xdg/this_and_that, is what is called by "system {" in the file.
lxmed deals brilliantly with that (if you hadn't installed it yet)
ccc

Re: Edit menu default entries

Post by ccc »

What I really need, if I press on "Logout" button from the main menu, the machine should shutdown immediately, without a pop-up or asking anything.
Do you know howto configure?
ccc

Re: Edit menu default entries

Post by ccc »

Thx a lot for the excellent support it works well now!

Below howto change "Logout" instead of session logout to the system shutdown:

I've changed in /.config/lxpanel/LXDE/config:

Code: Select all

[Command]
FileManager=pcmanfm %s
Terminal=x-terminal-emulator
[b]Logout=/usr/bin/lxde-session-shutdown.sh[/b]
I've changed /usr/share/applications/lxde-logout.desktop:

Code: Select all

[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=Logout
Name[de]=Abmelden
Name[fi]=Kirjaudu ulos
Name[pt]=Terminar sessão
Name[zh_TW]=登出
Comment=shutdown
Comment[de]=Abmelden, herunterfahren oder neu starten
Comment[fi]=Kirjaudu ulos, sammuta tai käynnistä tietokone uudelleen
Comment[pt]=Terminar sessão, desligar ou reiniciar
Comment[zh_TW]=登出、關機、或重新開機
Icon=gnome-logout
Exec=/usr/bin/lxde-session-shutdown.sh
NoDisplay=true
and I've created this shutdown script /usr/bin/lxde-session-shutdown.sh:

Code: Select all

#! /bin/sh
sudo /sbin/shutdown -h now $*
Locked

Return to “Software & Applications”