From 7375dd78bf91e016a8bad2860698acfb769aba58 Mon Sep 17 00:00:00 2001 From: Ben Reaves Date: Wed, 5 May 2021 14:46:50 -0500 Subject: [PATCH] Updated hotkeys for xfce4 --- linux/kinto.py | 24 ++++++++---------------- xkeysnail_service.sh | 21 ++++++++++++++++++++- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/linux/kinto.py b/linux/kinto.py index 1eb64a1..3dee91f 100755 --- a/linux/kinto.py +++ b/linux/kinto.py @@ -435,11 +435,11 @@ define_keymap(lambda wm_class: wm_class.casefold() not in remotes,{ # K("Super-Left"):K("C-M-Left"), # Default SL - Change workspace (budgie) K("RC-Q"): K("M-F4"), # Default SL - not-popos K("RC-H"):K("Super-h"), # Default SL - Minimize app (gnome/budgie/popos/fedora) - K("M-Tab"): pass_through_key, # Default not-xfce4 - Cmd Tab - App Switching Default - K("RC-Tab"): K("M-Tab"), # Default not-xfce4 - Cmd Tab - App Switching Default - K("RC-Shift-Tab"): K("M-Shift-Tab"), # Default not-xfce4 - Cmd Tab - App Switching Default - K("RC-Grave"): K("M-Grave"), # Default not-xfce4 - Cmd ` - Same App Switching - K("RC-Shift-Grave"): K("M-Shift-Grave"), # Default not-xfce4 - Cmd ` - Same App Switching + K("M-Tab"): pass_through_key, # Default - Cmd Tab - App Switching Default + K("RC-Tab"): K("M-Tab"), # Default - Cmd Tab - App Switching Default + K("RC-Shift-Tab"): K("M-Shift-Tab"), # Default - Cmd Tab - App Switching Default + K("RC-Grave"): K("M-Grave"), # Default - Cmd ` - Same App Switching + K("RC-Shift-Grave"): K("M-Shift-Grave"), # Default - Cmd ` - Same App Switching # K("Super-Right"):K("Super-Page_Up"), # SL - Change workspace (ubuntu/fedora) # K("Super-Left"):K("Super-Page_Down"), # SL - Change workspace (ubuntu/fedora) # K("Super-Right"):K("Super-C-Up"), # SL - Change workspace (popos) @@ -455,10 +455,6 @@ define_keymap(lambda wm_class: wm_class.casefold() not in remotes,{ # Basic App hotkey functions # K("RC-H"):K("M-F9"), # SL - Minimize app xfce4 # K("RC-LC-f"):K("Super-PAGE_DOWN"), # SL - Minimize app manjaro - # Cmd Tab - App Switching Default - # 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/IBM - In-App Tab switching # K("M-Shift-Tab"): K("C-Shift-Tab"), # Chromebook/IBM - In-App Tab switching @@ -668,13 +664,9 @@ define_keymap(re.compile(termStr, re.IGNORECASE),{ K("LC-Tab") : K("LC-PAGE_DOWN"), K("LC-Shift-Tab") : K("LC-PAGE_UP"), K("LC-Grave") : K("LC-PAGE_UP"), - # K("M-Tab"): pass_through_key, # Default not-xfce4 - Cmd Tab - App Switching Default - # K("RC-Tab"): K("M-Tab"), # Default not-xfce4 - Cmd Tab - App Switching Default - # K("RC-Shift-Tab"): K("M-Shift-Tab"), # Default not-xfce4 - Cmd Tab - App Switching Default - # Cmd Tab - App Switching Default - # K("RC-Tab"): K("RC-backslash"), # xfce4 - # K("RC-Shift-Tab"): K("RC-Shift-backslash"), # xfce4 - # K("RC-Grave"): K("RC-Shift-backslash"), # xfce4 + # K("M-Tab"): pass_through_key, # Default - Cmd Tab - App Switching Default + # K("RC-Tab"): K("M-Tab"), # Default - Cmd Tab - App Switching Default + # K("RC-Shift-Tab"): K("M-Shift-Tab"), # Default - Cmd Tab - App Switching Default # Converts Cmd to use Ctrl-Shift K("RC-MINUS"): K("C-Shift-MINUS"), K("RC-EQUAL"): K("C-Shift-EQUAL"), diff --git a/xkeysnail_service.sh b/xkeysnail_service.sh index cb4589a..b350337 100755 --- a/xkeysnail_service.sh +++ b/xkeysnail_service.sh @@ -45,7 +45,11 @@ function uninstall { mv ~/.config/kglobalshortcutsrc ~/.config/kglobalshortcutsrc.kinto elif [ "$dename" == "xfce" ];then echo "Resetting DE hotkeys..." - cp /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml + if test -f "/etc/mx-version";then + cp /etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml + else + cp /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml + fi fi elif [ "$yn" == "r" ]; then echo "Restore original user shortcuts" @@ -84,6 +88,12 @@ function uninstall { echo -e "\nWill still be restoring the overlay key" echo -e "gsettings set org.gnome.mutter overlay-key 'super'\n" gsettings set org.gnome.mutter overlay-key 'super' + # Repetitive - xfce restore factory or backup does this + # Also needs to check if whiskermenu is even being used + # elif [[ $dename == "xfce" ]]; then + # echo -e "\nWill still be restoring the overlay key" + # echo -e "xfconf-query --channel xfce4-keyboard-shortcuts --property \"/commands/custom/Super_L\" --create --type string --set \"xfce4-popup-whiskermenu\"" + # xfconf-query --channel xfce4-keyboard-shortcuts --property "/commands/custom/Super_L" --create --type string --set "xfce4-popup-whiskermenu" fi } @@ -244,6 +254,15 @@ if [[ $dename == 'gnome' || $dename == 'budgie' ]];then echo "Overlay key, " $bound ", detected. Will be removing so Super-Space can remap to Cmd-Space for app launching.." gsettings set org.gnome.mutter overlay-key '' fi +elif [[ $dename == 'xfce' ]];then + # xfconf-query --channel xfce4-keyboard-shortcuts --property "/commands/custom/Super_L" --reset + launcher=$(cat ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml | grep 'name="Super_L"' | sed 's:.*="::') + nlauncher=${launcher::-3} + # Replace Alt-F1 help file w/ whisker menu alternative hotkey + xfconf-query --channel xfce4-keyboard-shortcuts --property "/commands/custom/F1" --reset + # Clear Alt-F3 App Finder for sublime text global replace + xfconf-query --channel xfce4-keyboard-shortcuts --property "/commands/custom/F3" --reset + xfconf-query --channel xfce4-keyboard-shortcuts --property "/commands/custom/F1" --create --type string --set "$nlauncher" && echo "$nlauncher has been set to Alt-F1 for Cmd-Space to work." fi # if ls /etc/apt/sources.list.d/system76* 1> /dev/null 2>&1; then