Skip to content

Instantly share code, notes, and snippets.

@milovtim
Last active September 29, 2020 11:12
Show Gist options
  • Save milovtim/723909952d252f1a3b6a5fd3deba47cd to your computer and use it in GitHub Desktop.
Save milovtim/723909952d252f1a3b6a5fd3deba47cd to your computer and use it in GitHub Desktop.
Remove key bindings that conflicts with (shadows) intelliJ keymaps
#!/usr/bin/env bash
XCONF_PROP="xfconf-query -c xfce4-keyboard-shortcuts -p"
RST="-r"
while IFS= read -r line; do
eval "$XCONF_PROP" "\"$line\"" "$RST";
done <<'EOF'
/xfwm4/custom/<Alt>Insert
/xfwm4/custom/<Alt>Delete
/xfwm4/custom/<Alt>F7
/xfwm4/custom/<Alt>F8
/xfwm4/custom/<Alt>F9
/xfwm4/custom/<Alt>F11
/xfwm4/custom/<Alt>F12
/xfwm4/custom/<Primary><Alt>KP_1
/xfwm4/custom/<Primary><Alt>KP_2
/xfwm4/custom/<Primary><Alt>KP_3
/xfwm4/custom/<Primary><Alt>KP_4
/xfwm4/custom/<Primary><Alt>KP_5
/xfwm4/custom/<Primary><Alt>KP_6
/xfwm4/custom/<Primary><Alt>KP_7
/xfwm4/custom/<Primary><Alt>KP_8
/xfwm4/custom/<Primary><Alt>KP_9
/xfwm4/custom/<Primary><Alt>Left
/xfwm4/custom/<Primary><Alt>Right
/xfwm4/custom/<Primary>F1
/xfwm4/custom/<Primary>F2
/xfwm4/custom/<Primary>F3
/xfwm4/custom/<Primary>F4
/xfwm4/custom/<Primary>F5
/xfwm4/custom/<Primary>F6
/xfwm4/custom/<Primary>F7
/xfwm4/custom/<Primary>F8
/xfwm4/custom/<Primary>F9
/xfwm4/custom/<Primary>F10
/xfwm4/custom/<Primary>F11
/xfwm4/custom/<Primary>F12
/xfwm4/custom/<Primary><Shift><Alt>Left
/xfwm4/custom/<Primary><Shift><Alt>Right
/xfwm4/custom/<Primary><Shift><Alt>Up
/xfwm4/custom/<Primary><Alt>d
EOF
# more smart resetting
while read -r prop
do
xfconf-query --channel xfce4-keyboard-shortcuts --property "$prop" --reset
printf "A property '%s' was reset\n" "$prop"
done < <(xfconf-query -c xfce4-keyboard-shortcuts --list|grep --perl-regexp "/xfwm4/custom/<Control>F\d{1,2}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment