You are not logged in.

#1 2022-04-02 14:12:38

cloudy
Member
Registered: 2022-04-02
Posts: 1

Gnome does not detect .desktop file

So I've installed arch alongside windows and wanted to create a shortcut for rebooting straight into windows.
I know this should be possible with a .desktop file placed in /usr/share/applications but gnome somehow doesn't recognize it and doesn't create the menu entry.

[Desktop Entry]
Name=Reboot to Windows
Icon=windows-icon
Exec="/usr/bin/sudo /usr/bin/grub-reboot 2 && /usr/bin/reboot"
desktop-file-validate windows.desktop

returns nothing, so I guess the syntax is fine?
Permissions are -rw-r--r-- and owner is root so that should be fine as well?

Offline

#2 2022-04-02 14:40:19

mpan
Member
Registered: 2012-08-01
Posts: 1,630
Website

Re: Gnome does not detect .desktop file

You are missing the Type entry. The Exec entry should be a command, not a piece of shell code. GNOME may also require executable permission to be set for the file.

Last edited by mpan (2022-04-02 14:42:54)

Offline

#3 2022-04-02 15:16:53

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,251

Re: Gnome does not detect .desktop file

And "sudo" will require a tty to ask for permissions, what's not gonna happen either. Try "pkexec"

Offline

#4 2022-04-02 15:19:59

mpan
Member
Registered: 2012-08-01
Posts: 1,630
Website

Re: Gnome does not detect .desktop file

s/will/may/

It may be set to be passwordless in “/etc/sudoers”.

Offline

Board footer

Powered by FluxBB