- 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():
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()

View File

@@ -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