From b1851316de535100163a4a4f31b7f3beaf8cf41a Mon Sep 17 00:00:00 2001 From: Ben Reaves Date: Mon, 30 Mar 2020 23:13:35 -0500 Subject: [PATCH] - Prep work for proper KDE Plasma 5 hotkey support in KDE Neon --- setup.py | 3 ++- system-config/dename.sh | 50 +++++++++++++++++++++++++++-------------- 2 files changed, 35 insertions(+), 18 deletions(-) diff --git a/setup.py b/setup.py index 01b3770..b6a25ef 100755 --- a/setup.py +++ b/setup.py @@ -39,7 +39,7 @@ def install_ibus(): def setShortcuts(): distro = cmdline("awk -F= '$1==\"NAME\" { print $2 ;}' /etc/os-release").replace('"','').strip().split(" ")[0] distroVersion = cmdline("awk -F= '$1==\"VERSION_ID\" { print $2 ;}' /etc/os-release").replace('"','').strip() - dename = cmdline("./system-config/dename.sh").replace('"','').strip().split(" ")[0] + dename = cmdline("./system-config/dename.sh").replace('"','').strip().split(" ")[0].lower() print("\nIf Kinto is already running it will be stopped...") print("If you cancel the installer you can re-run Kinto via\n systemctl --user start keyswap") @@ -130,6 +130,7 @@ def setShortcuts(): cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Switch to Previous Desktop" "Meta+Left,Meta+Left,Switch to Previous Desktop"') cmdline('kquitapp5 kglobalaccel && sleep 2s && kglobalaccel5 &') else: + print('distro: ' + distro + ' de: ' + dename) print("A supported OS and DE was not found, you may not have full system level shortcuts installed.") # check_x11 = cmdline("env | grep -i x11").strip() diff --git a/system-config/dename.sh b/system-config/dename.sh index 7725e2c..ae2392c 100755 --- a/system-config/dename.sh +++ b/system-config/dename.sh @@ -12,7 +12,7 @@ function detect_gnome() return 1 } -function detect_kde() +function detect_kde4() { ps -e | grep -E '^.* kded4$' > /dev/null if [ $? -ne 0 ]; @@ -25,6 +25,19 @@ function detect_kde() fi } +function detect_kde() +{ + ps -e | grep -E '^.* kded5$' > /dev/null + if [ $? -ne 0 ]; + then + return 0 + else + VERSION=`kded5 --version | grep -m 1 'KDE' | awk -F ':' '{print $2}' | awk '{print $1}'` + DESKTOP="KDE" + return 1 + fi +} + function detect_unity() { ps -e | grep -E 'unity-panel' > /dev/null @@ -118,22 +131,25 @@ if detect_unity; then if detect_kde; then - if detect_gnome; - then - if detect_xfce; - then - if detect_cinnamon; - then - if detect_mate; - then - if detect_lxde; - then - detect_sugar - fi - fi - fi - fi - fi + if detect_kde4; + then + if detect_gnome; + then + if detect_xfce; + then + if detect_cinnamon; + then + if detect_mate; + then + if detect_lxde; + then + detect_sugar + fi + fi + fi + fi + fi + fi fi fi