You are not logged in.
I am trying to override KDE konsole's .desktop file. I copied org.kde.dolphin.desktop from /usr/share/applications to ~/.local/share/applications. I changed:
Exec=konsoleto
Exec=env QT_AUTO_SCREEN_SCALE_FACTOR=1 konsoleHowever the behaviour is unchanged. But if I issue the command QT_AUTO_SCREEN_SCALE_FACTOR=1 konsole, then konsole behaves accordingly.
Question is why am I not able to override this setting? What am I missing? I have a vague feeling it has to do with xdg but not sure what to set.
Last edited by d_fajardo (2020-07-22 21:52:46)
Offline
Maybe the way you start konsole, the system isn't going through the desktop file to start it? Your change will then not be seen.
You could try to do things differently and create a script file "/usr/local/bin/konsole", like this:
#!/bin/bash
export QT_AUTO_SCREEN_SCALE_FACTOR=1
exec /usr/bin/konsoleThe /usr/local/bin location is in front of /usr/bin in $PATH. As long as "konsole" is called without full path, the /usr/local/bin file should then override the one in /usr/bin.
Offline
Have you run kbuildsycoca5 after modifying the desktop file?
Offline
Exec=env QT_AUTO_SCREEN_SCALE_FACTOR=1 konsoleHowever the behaviour is unchanged. But if I issue the command QT_AUTO_SCREEN_SCALE_FACTOR=1 konsole, then konsole behaves accordingly.
These are two different commands.
Have you tried putting
Exec=QT_AUTO_SCREEN_SCALE_FACTOR=1 konsolein your .desktop file? Or possibly
Exec=sh -c 'QT_AUTO_SCREEN_SCALE_FACTOR=1 konsole'Offline
d_fajardo wrote:Exec=env QT_AUTO_SCREEN_SCALE_FACTOR=1 konsoleHowever the behaviour is unchanged. But if I issue the command QT_AUTO_SCREEN_SCALE_FACTOR=1 konsole, then konsole behaves accordingly.
These are two different commands.
Have you tried puttingExec=QT_AUTO_SCREEN_SCALE_FACTOR=1 konsolein your .desktop file? Or possibly
Exec=sh -c 'QT_AUTO_SCREEN_SCALE_FACTOR=1 konsole'
That "variable=value program" you suggested is something special about bash. It does not work inside a desktop file. That command line using "env" was correct. The "env" command does the same as what you suggested with the "sh -c '...'" command line.
Offline
@Ropid Thanks for the tip.
I created a bash script as you suggested called konsole_exec in my 'own' bin directory which is in my path. Then I just edited the .desktop file to point to it:
Exec=/path/to/my/own/bin/konsole_execOffline