Created
March 10, 2016 18:54
-
-
Save tcely/c743b51c7919db9adad4 to your computer and use it in GitHub Desktop.
Clear shortcuts from Alt+Fn keys in GNOME
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Inspiration from: http://askubuntu.com/questions/126817/how-to-disable-alt-f1-alt-f2-shortcuts | |
unset -v _key _value _schema | |
_schema='org.gnome.desktop.wm.keybindings' | |
while IFS= read -r _key; do | |
_value="$(gsettings get "$_schema" "$_key")" | |
while [[ "$_value" =~ \''<Alt>F'[1-9]\' ]] || [[ "$_value" =~ \''<Alt>F1'[0-2]\' ]]; do | |
#_value="$(sed -e "s/\(, \)\?${BASH_REMATCH[0]}\(, \)\?//;s/''/', '/;" <<<"$_value")" | |
_value=${_value/"${BASH_REMATCH[0]}"} | |
_value=${_value/, ,/,} | |
_value=${_value/, ]/]} | |
_value=${_value/[, /[} | |
gsettings set "$_schema" "$_key" "$_value" | |
printf -- 'Set "%s:%s" to "%s"\n' "$_schema" "$_key" "$_value" ; | |
done | |
done < <(gsettings list-keys "$_schema") | |
unset -v _key _value _schema | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment