diff options
author | Christophe Giboudeaux <christophe@krop.fr> | 2019-10-30 17:11:08 +0100 |
---|---|---|
committer | Jiri Slaby (SUSE) <jirislaby@kernel.org> | 2023-09-11 10:52:49 +0200 |
commit | fa5731c3187f9501f22e0a539b9fc92839a4a34a (patch) | |
tree | 0a5a12f7ee34cc6e8da5657c955aef282e92e727 | |
parent | adf064ae472b4cacf11f04f5265a0a86980e4ced (diff) |
xdg-terminal: don't run 'kreadconfig' if KDE_SESSION_VERSION is >= 5
'kreadconfig' is a KDE4 executable. The program is called 'kreadconfig5' in
KDE Frameworks 5.xx.
-rw-r--r-- | scripts/xdg-terminal.in | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/scripts/xdg-terminal.in b/scripts/xdg-terminal.in index 71d56a5..bd2529c 100644 --- a/scripts/xdg-terminal.in +++ b/scripts/xdg-terminal.in @@ -30,7 +30,20 @@ _USAGE terminal_kde() { - terminal=`kreadconfig --file kdeglobals --group General --key TerminalApplication --default konsole` + if [ -n "$KDE_SESSION_VERSION" ] && [ "$KDE_SESSION_VERSION" -ge 5 ]; then + local kreadconfig=kreadconfig$KDE_SESSION_VERSION + else + local kreadconfig=kreadconfig + fi + + if which $kreadconfig >/dev/null 2>&1; then + local terminal=$($kreadconfig --file kdeglobals \ + --group General \ + --key TerminalApplication \ + --default konsole) + else + exit_failure_operation_impossible "'$kreadconfig' was not found or is not executable" + fi terminal_exec=`command -v $terminal` |