From ad53b7034da3eb5f1a1ad314afaa979fc0796df9 Mon Sep 17 00:00:00 2001 From: Ben Reaves Date: Fri, 15 May 2020 20:49:48 -0500 Subject: [PATCH] - Improved support for xfce4 with Ubuntu, xubuntu, voyager. Fixed In-app switching bug. --- setup.py | 2 +- xkeysnail-config/kinto.py | 18 +++++++++--------- xkeysnail_service.sh | 14 +++++++++++--- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/setup.py b/setup.py index c992089..8b4a997 100755 --- a/setup.py +++ b/setup.py @@ -156,7 +156,7 @@ def setShortcuts(): cmdline('perl -pi -e "s/(\w.*)(\/\/ Default cmdtab)/\/\/ \$1\$2/g" ~/.xkb/symbols/mac_gui') # elif distro == "budgie" and dename == "gnome": # print("Apply budgie shortcuts here") - elif distro == "galliumos" and dename == "xfce": + elif (distro == "galliumos" and dename == "xfce") or (distro == "ubuntu" and dename == "xfce"): print("Applying GalliumOS (xfce) shortcuts...") cmdline('cp ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml ./xfce4-keyboard-shortcuts_`date +"%Y.%m.%d-%s"`.xml') # Reset Show desktop diff --git a/xkeysnail-config/kinto.py b/xkeysnail-config/kinto.py index 38fedbb..3951e1c 100644 --- a/xkeysnail-config/kinto.py +++ b/xkeysnail-config/kinto.py @@ -68,19 +68,19 @@ define_keymap(re.compile("org.gnome.nautilus", re.IGNORECASE),{ define_keymap(None,{ # Cmd Tab - App Switching Default - K("RC-Tab"): K("RC-F13"), # Default - K("RC-Shift-Tab"): K("RC-Shift-F13"), # Default - K("RC-Grave"): K("M-F6"), # Default - K("RC-Shift-Grave"): K("M-Shift-F6"), # Default - # K("RC-Tab"): K("RC-backslash"), # Chromebook - # K("RC-Shift-Tab"): K("RC-Shift-backslash"), # Chromebook - # K("RC-Grave"): K("RC-Shift-backslash"), # Chromebook + K("RC-Tab"): K("RC-F13"), # Default not-xfce4 + K("RC-Shift-Tab"): K("RC-Shift-F13"), # Default not-xfce4 + K("RC-Grave"): K("M-F6"), # Default not-xfce4 + K("RC-Shift-Grave"): K("M-Shift-F6"), # Default not-xfce4 + # K("RC-Tab"): K("RC-backslash"), # xfce4 + # K("RC-Shift-Tab"): K("RC-Shift-backslash"), # xfce4 + # K("RC-Grave"): K("RC-Shift-backslash"), # xfce4 # In-App Tab switching # K("M-Tab"): K("C-Tab"), # Chromebook - In-App Tab switching # K("M-Shift-Tab"): K("C-Shift-Tab"), # Chromebook - In-App Tab switching # K("M-Grave") : K("C-Shift-Tab"), # Chromebook - In-App Tab switching - K("Super-Tab"): K("LC-Tab"), # Default - K("Super-Shift-Tab"): K("LC-Shift-Tab"), # Default + K("Super-Tab"): K("LC-Tab"), # Default not-chromebook + K("Super-Shift-Tab"): K("LC-Shift-Tab"), # Default not-chromebook # Wordwise K("RC-Left"): K("Home"), # Beginning of Line diff --git a/xkeysnail_service.sh b/xkeysnail_service.sh index d5e44da..c1d7340 100755 --- a/xkeysnail_service.sh +++ b/xkeysnail_service.sh @@ -5,10 +5,10 @@ typeset -l distro distro=$(awk -F= '$1=="NAME" { print $2 ;}' /etc/os-release) +typeset -l dename +dename=$(./system-config/dename.sh | cut -d " " -f1) function uninstall { - typeset -l dename - dename=$(./system-config/dename.sh | cut -d " " -f1) while true; do read -rep $'\nPress R to restore your original shortcuts.\nPress F to reset to factory shortcuts. (f/r)\n' yn @@ -229,10 +229,19 @@ fi if [[ $1 == "1" || $1 == "winmac" ]]; then echo '1' | sudo tee -a /sys/module/hid_apple/parameters/swap_opt_cmd;echo 'options hid_apple swap_opt_cmd=1' | sudo tee -a /etc/modprobe.d/hid_apple.conf;sudo update-initramfs -u -k all perl -pi -e "s/(# )(.*)(# WinMac)/\$2\$3/g" ./xkeysnail-config/kinto.py.new + if [[ $dename == "xfce" ]]; then + perl -pi -e "s/(# )(.*)(# xfce4)/\$2\$3/g" ./xkeysnail-config/kinto.py.new + perl -pi -e "s/(\w.*)(# Default not-xfce4)/# \$1\$2/g" ./xkeysnail-config/kinto.py.new + fi elif [[ $1 == "2" || $1 == "mac" ]]; then perl -pi -e "s/(# )(.*)(# Mac)/\$2\$3/g" ./xkeysnail-config/kinto.py.new + if [[ $dename == "xfce" ]]; then + perl -pi -e "s/(# )(.*)(# xfce4)/\$2\$3/g" ./xkeysnail-config/kinto.py.new + perl -pi -e "s/(\w.*)(# Default not-xfce4)/# \$1\$2/g" ./xkeysnail-config/kinto.py.new + fi elif [[ $1 == "3" || $1 == "chromebook" ]]; then perl -pi -e "s/(# )(.*)(# Chromebook)/\$2\$3/g" ./xkeysnail-config/kinto.py.new + perl -pi -e "s/(# )(.*)(# xfce4)/\$2\$3/g" ./xkeysnail-config/kinto.py.new perl -pi -e "s/(\w.*)(# Default)/# \$1\$2/g" ./xkeysnail-config/kinto.py.new fi @@ -263,7 +272,6 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1 cd xkeysnail git checkout 51c369084e0045a8410d227bab52411bf84fb65b fi - git pull origin master sudo pip3 install --upgrade . cd .. sudo systemctl daemon-reload