Application menu customization option?

I’d like to add a menu entry for a script I have that will reboot my machine with a grub option pre-selected. Can something like that be added to this “Power / Session” menu?

Probably, but there’s an even simpler way.

let’s call this ‘gruboot’ and write it into a script…

So if you put that in ~/.local/bin and make it executable, you can call up krunner and type ‘gruboot’.

Later on you could create a launcher for the menu for some extra polish (or ‘clutter’ even).

To directly enter this in your menu, you should look in ~/.local/share/applications where you can copy an existing entry and edit…

So you would rename it ‘gruboot’ and find a suitable icon, and fill in the fields so that it would launch your script.

I actually have a working script which boots the desired grub entry after rebooting the system. I just can’t figure out how to add a reference to it in this “Power / Session” menu. This menu seems to not be looking in ~/.local/share/applications for its .desktop files. It can’t be edited by the KDE Menu Editor utility either.

If you read my post, you’d see that I already mentioned launchers in the applications folder, and how you could simply duplicate one and edit the contents to suit.

You can use kate to edit those, they’re just text files.

you can make a new entry and add it to the applications menu anywhere else BUT that section… but as far as i can tell that particular sub-menu is generated by the system based on your hardware and other settings, so modifying it would not be as trivial as adding it directly above it below the Wine sub-menu.

i just use an alias for a boot to firmware (which is essentially choosing the grub “boot to firmware” option from the menu)

boot to firmware script
#!/usr/bin/env sh

# same as going to session settings and checking the box to boot to the firmware

sudo qdbus --system org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.SetRebootToFirmwareSetup true && \
qdbus org.kde.Shutdown /Shutdown org.kde.Shutdown.logoutAndReboot