Last active
August 7, 2024 11:42
-
-
Save mattiasb/fdcd60c83693dd9c94bf3c3e24e4bc61 to your computer and use it in GitHub Desktop.
Setting GNOME keybindings with gsettings
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 | |
set -e | |
set -o pipefail | |
################################################################################ | |
function gnome-keybinding { | |
echo gsettings set org.gnome.desktop.wm.keybindings "${@}" | |
} | |
function gnome-shell-keybinding { | |
echo gsettings set org.gnome.shell.keybindings "${@}" | |
} | |
function unset-switch-to-application { | |
gnome-shell-keybinding "switch-to-application-${1}" "@as []" | |
} | |
function set-switch-to-workspace { | |
gnome-keybinding "switch-to-workspace-${1}" "['<Super>${1}']" | |
} | |
function set-move-to-workspace { | |
gnome-keybinding "move-to-workspace-${1}" "['<Super>F${1}']" | |
} | |
################################################################################ | |
function main { | |
local n | |
for n in 1 2 3 4 5 6 7 8 9; do | |
unset-switch-to-application "${n}" | |
done | |
for n in 1 2 3 4 5 6 7 8 9; do | |
set-switch-to-workspace "${n}" | |
done | |
for n in 1 2 3 4 5 6 7 8 9; do | |
set-move-to-workspace "${n}" | |
done | |
} | |
main "${@}"; exit |
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 | |
gsettings set org.gnome.shell.keybindings switch-to-application-1 "@as []" | |
gsettings set org.gnome.shell.keybindings switch-to-application-2 "@as []" | |
gsettings set org.gnome.shell.keybindings switch-to-application-3 "@as []" | |
gsettings set org.gnome.shell.keybindings switch-to-application-4 "@as []" | |
gsettings set org.gnome.shell.keybindings switch-to-application-5 "@as []" | |
gsettings set org.gnome.shell.keybindings switch-to-application-6 "@as []" | |
gsettings set org.gnome.shell.keybindings switch-to-application-7 "@as []" | |
gsettings set org.gnome.shell.keybindings switch-to-application-8 "@as []" | |
gsettings set org.gnome.shell.keybindings switch-to-application-9 "@as []" | |
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-1 "['<Super>1']" | |
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-2 "['<Super>2']" | |
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-3 "['<Super>3']" | |
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-4 "['<Super>4']" | |
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-5 "['<Super>5']" | |
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-6 "['<Super>6']" | |
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-7 "['<Super>7']" | |
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-8 "['<Super>8']" | |
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-9 "['<Super>9']" | |
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-1 "['<Super>F1']" | |
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-2 "['<Super>F2']" | |
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-3 "['<Super>F3']" | |
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-4 "['<Super>F4']" | |
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-5 "['<Super>F5']" | |
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-6 "['<Super>F6']" | |
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-7 "['<Super>F7']" | |
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-8 "['<Super>F8']" | |
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-9 "['<Super>F9']" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment