I have noticed this a few times while trying to add new application launchers/icons to the launcher's menu list in Kubuntu or when editing the existing ones.
In some cases the inverted commas appear only in the KDE Menu Editor after I have manually edited the corresponding .desktop
file and made sure that the Exec=
command is ok. In this case there is no problem with the execution of the command and the launcher works.
For example, I have the file ~/.local/share/applications/software-properties-qt.desktop
with the line Exec=pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY KDE_SESSION_VERSION=5 KDE_FULL_SESSION=true software-properties-qt
, which works just fine. But the KDE Menu Editor or the Application Launcher right-click menu option "Edit Application" show this:
env 'DISPLAY=$DISPLAY' 'XAUTHORITY=$XAUTHORITY' KDE_SESSION_VERSION=5 KDE_FULL_SESSION=true software-properties-qt
But in some cases when I am trying to use the KDE Menu Editor to create new launchers, without using any inverted commas, these are nonetheless created in the .desktop
file with bad results, and I have to modify the .desktop
file manually and remove the inverted commas.
For example, opening the KDE Menu Editor and creating a new entry/launcher for playing inserted DVD in VLC with the simple command vlc dvd://
,
it doesn't work because in the file ~/.local/share/applications/VLC DVD.desktop
this line was created, which doesn't look right: Exec='vlc dvd://'
. That doesn't work.
Here's another example:
Apper software manager cannot be used properly if launched simply as apper
(the default command in its installed launcher /usr/share/applications/org.kde.apper.desktop
), because it cannot get the needed rights and gives an error at the end:
I have found that what works is to use this command:
pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY KDE_SESSION_VERSION=5 KDE_FULL_SESSION=true apper
which requires the password at the start and then works as expected.
For that command, I have created a new file ~/.local/share/applications/org.kde.apper.desktop
.
When I open the file in Kate text editor, the Exec=
line is followed by the command as seen above. But when I use the KDE Menu editor or the "Edit application" context menu option in the application launcher widget, — I see this command: pkexec env 'DISPLAY=$DISPLAY' 'XAUTHORITY=$XAUTHORITY' KDE_SESSION_VERSION=5 KDE_FULL_SESSION=true apper
.
"Why are those inverted commas there" would count as a question by itself, to be asked from pure curiosity (given that the application works fine, as things are) were it not for the fact that if I try to create a new entry in the KDE Menu Editor, in this case in order to launch Apper in update mode (apper --updates
), by simply copying the command for Apper proper and just adding --updates
argument, the result is not working, although the only difference between the two entries in the KDE Menu Editor is that argument.
Well, testing that line (as seen in the menu editor) in a terminal, it doesn't work:
pkexec env 'DISPLAY=$DISPLAY' 'XAUTHORITY=$XAUTHORITY' KDE_SESSION_VERSION=5 KDE_FULL_SESSION=true apper
qt.qpa.xcb: could not connect to display $DISPLAY
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.
Aborted (core dumped)
Why does the application Apper work then, while the new entry "Update with Apper" doesn't when launched from the application launcher (kickoff, krunner) ? Because their real Exec=
lines in the corresponding .desktop
files in ~/.local/share/applications
are different: only the one newly created through the KDE Menu Editor (for updates in Apper) —unlike the old one (for just launching Apper)— contains the inverted commas, although in the menu editor both have them!
I have to manually edit the file ~/.local/share/applications/Update with Apper.desktop
and remove the inverted commas for it to work, that is change this:
Exec=pkexec env 'DISPLAY=$DISPLAY' 'XAUTHORITY=$XAUTHORITY' KDE_SESSION_VERSION=5 KDE_FULL_SESSION=true apper --updates
into this:
Exec=pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY KDE_SESSION_VERSION=5 KDE_FULL_SESSION=true apper --updates
The commas are fine as long as they appear in the menu editor but not in the .desktop
file itself.
But why do they appear there? How does this all work?