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

Desktop entries with pkexec do not work #536

Open
andrewdbate opened this issue Mar 20, 2022 · 0 comments
Open

Desktop entries with pkexec do not work #536

andrewdbate opened this issue Mar 20, 2022 · 0 comments
Labels
Status: Confirmed Verified by someone other than the reporter

Comments

@andrewdbate
Copy link

andrewdbate commented Mar 20, 2022

What Happened?

The Applications menu picks up on desktop entries located in /usr/share/applications (plus other locations).

If the Exec line of a desktop entry is of the form Exec=pkexec <executable-name-here> then attempting to launch the application from the Applications menu does not work.

Some applications such as Timeshift install a desktop entry which calls pkexec. For example, the Timeshifts desktop entry has the line:

Exec=pkexec timeshift-gtk

Now I agree that desktop entries probably shouldn't use pkexec like this, however, it should still be supported by the Applications menu because it is not uncommon.

Note that double-clicking the Timeshift desktop entry from the Nemo file manager launches Timeshift correctly. (The elementary OS Files file manager does not support launching applications by double-clicking the desktop entry it seems.)

Steps to Reproduce

Create a file Example.desktop with the following contents:

[Desktop Entry]
Name=Example
Exec=pkexec io.elementary.photos
Type=Application
Terminal=false
Categories=Utility;

Again, I agree that this is not the best way to use pkexec but it should work regardless. I am using io.elementary.photos only for the example (I do know that Photos shouldn't be ordinarily used with pkexec).

Copy this file to /usr/share/applications. You will now see an application named "Example" in the Accessories category of the Applications menu.

If you click it, then an icon will appear in the dock and then disappear a few seconds later. You will not get the pkexec prompt to ask you for your password.

Now if you change the line:

Exec=pkexec io.elementary.photos

to

Exec=io.elementary.photos

and then go back to the Applications menu, this time Photos will launch as usual. So it was the pkexec entry that caused the issue.

Expected Behavior

The Applications menu should support desktop entries with Exec lines such as

Exec=pkexec timeshift-gtk

This should launch the user/password prompt as usual:
Screenshot from 2022-03-20 18 15 27

OS Version

6.x (Odin)

Software Version

Latest release (I have run all updates)

Log Output

No response

Hardware Info

No response

@ryonakano ryonakano added the Status: Confirmed Verified by someone other than the reporter label Oct 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Confirmed Verified by someone other than the reporter
Projects
None yet
Development

No branches or pull requests

2 participants