From ef4b7f8b01bcce4eaccd8b8a3d867455c41d024e Mon Sep 17 00:00:00 2001 From: Ben Reaves Date: Fri, 23 Oct 2020 17:02:22 -0500 Subject: [PATCH] - Added in better parsing of distro names --- xkeysnail_service.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/xkeysnail_service.sh b/xkeysnail_service.sh index eccfc71..9a48d3c 100755 --- a/xkeysnail_service.sh +++ b/xkeysnail_service.sh @@ -4,14 +4,14 @@ # to false for wordwise to work in Firefox typeset -l distro -distro=$(awk -F= '$1=="NAME" { print $2 ;}' /etc/os-release) +distro=$(awk -F= '$1=="NAME" { gsub("[\",!,_, ]","",$2);print $2 ;}' /etc/os-release) typeset -l dename dename=$(./system-config/dename.sh | cut -d " " -f1) # Add additional shortcuts if needed, does not modify existing ones - if [[ $distro == '"elementary os"' ]];then + if [[ $distro == 'elementaryos' ]];then if [[ $(gsettings get org.gnome.mutter overlay-key | grep "Super" | wc -l) != 1 ]];then echo "Overlay key, Super, detected. Will be removing so Super-Space can remap to Cmd-Space for app launching.." gsettings set org.gnome.mutter overlay-key " " @@ -36,13 +36,13 @@ if ls /etc/apt/sources.list.d/system76* 1> /dev/null 2>&1; then fi if [[ $dename == "kde" ]]; then - if [[ $distroy == "manjaro linux" ]]; then + if [[ $distroy == "manjarolinux" ]]; then sudo ./system-config/unipkg.sh vte3 else sudo ./system-config/unipkg.sh libvte-2.91-dev fi fi -if [[ $distro == '"kde neon"' ]]; then +if [[ $distro == 'kdeneon' ]]; then kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Show Desktop" "Meta+D,none,Show Desktop" kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Window Close" "Alt+F4,none,Close Window" kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Window Minimize" "Meta+PgDown,none,Minimize Window" @@ -261,12 +261,12 @@ if ! [ -x "$(command -v pip3)" ]; then sudo ./system-config/unipkg.sh python3-pip fi if ! [ -x "$(command -v python3-config)" ]; then - if [ "$distro" == "ubuntu" ] || [ "$distro" == "debian" ] || [ "$distro" == '"linux mint"' ]; then + if [ "$distro" == "ubuntu" ] || [ "$distro" == "debian" ] || [ "$distro" == 'linuxmint' ]; then pydev="python3-dev" elif [ "$distro" == "fedora" ]; then pydev="python3-devel" fi - if [ "$distro" == "gnome" ] || [ "$distro" == "fedora" ] || [ "$distro" == "debian" ] || [ "$distro" == '"linux mint"' ]; then + if [ "$distro" == "gnome" ] || [ "$distro" == "fedora" ] || [ "$distro" == "debian" ] || [ "$distro" == 'linuxmint' ]; then echo "Will need to install $pydev..." sudo ./system-config/unipkg.sh "$pydev" fi @@ -276,7 +276,7 @@ if ! [ -x "$(command -v xhost)" ] || ! [ -x "$(command -v gcc)" ]; then sudo ./system-config/unipkg.sh "xorg-xhost gcc" fi fi -if [ "$distro" == '"linux mint"' ]; then +if [ "$distro" == 'linuxmint' ]; then pip3 install setuptools fi