- Prep work for proper KDE Plasma 5 hotkey support in KDE Neon

This commit is contained in:
Ben Reaves
2020-03-30 23:13:35 -05:00
parent 812d2a4bcd
commit b1851316de
2 changed files with 35 additions and 18 deletions

View File

@@ -39,7 +39,7 @@ def install_ibus():
def setShortcuts(): def setShortcuts():
distro = cmdline("awk -F= '$1==\"NAME\" { print $2 ;}' /etc/os-release").replace('"','').strip().split(" ")[0] 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() 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("\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") 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('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 &') cmdline('kquitapp5 kglobalaccel && sleep 2s && kglobalaccel5 &')
else: else:
print('distro: ' + distro + ' de: ' + dename)
print("A supported OS and DE was not found, you may not have full system level shortcuts installed.") 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() # check_x11 = cmdline("env | grep -i x11").strip()

View File

@@ -12,7 +12,7 @@ function detect_gnome()
return 1 return 1
} }
function detect_kde() function detect_kde4()
{ {
ps -e | grep -E '^.* kded4$' > /dev/null ps -e | grep -E '^.* kded4$' > /dev/null
if [ $? -ne 0 ]; if [ $? -ne 0 ];
@@ -25,6 +25,19 @@ function detect_kde()
fi 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() function detect_unity()
{ {
ps -e | grep -E 'unity-panel' > /dev/null ps -e | grep -E 'unity-panel' > /dev/null
@@ -118,22 +131,25 @@ if detect_unity;
then then
if detect_kde; if detect_kde;
then then
if detect_gnome; if detect_kde4;
then then
if detect_xfce; if detect_gnome;
then then
if detect_cinnamon; if detect_xfce;
then then
if detect_mate; if detect_cinnamon;
then then
if detect_lxde; if detect_mate;
then then
detect_sugar if detect_lxde;
fi then
fi detect_sugar
fi fi
fi fi
fi fi
fi
fi
fi
fi fi
fi fi