From 233c1df03b9c20616fd3e775fd5842b00238685a Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 1 Aug 2024 17:47:34 -0700 Subject: [PATCH] Revert "Generalizes launching a new instance of dock applications with Shift + Alt + 1/2/.." --- install/desktop/set-dock.sh | 3 --- install/desktop/set-gnome-hotkeys.sh | 35 ++++++++++++++++------------ migrations/1722293148.sh | 15 ------------ 3 files changed, 20 insertions(+), 33 deletions(-) delete mode 100644 migrations/1722293148.sh diff --git a/install/desktop/set-dock.sh b/install/desktop/set-dock.sh index 27152b9..a0275ea 100644 --- a/install/desktop/set-dock.sh +++ b/install/desktop/set-dock.sh @@ -47,6 +47,3 @@ favorites_list="[${favorites_list%,}]" # Set the favorite apps gsettings set org.gnome.shell favorite-apps "$favorites_list" - -# Define the behavior of the app-hotkey binding -gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'focus-minimize-or-previews' diff --git a/install/desktop/set-gnome-hotkeys.sh b/install/desktop/set-gnome-hotkeys.sh index 32e2e6f..02e3569 100644 --- a/install/desktop/set-gnome-hotkeys.sh +++ b/install/desktop/set-gnome-hotkeys.sh @@ -17,21 +17,16 @@ gsettings set org.gnome.desktop.wm.keybindings toggle-fullscreen "['F11'] gsettings set org.gnome.mutter dynamic-workspaces false gsettings set org.gnome.desktop.wm.preferences num-workspaces 6 -set_per_digit() { - # shellcheck disable=SC2068 - # Replace every "#" with the value of $n - for n in {1..9}; do gsettings set ${@//\#/$n}; done -} - # Use alt for pinned apps -# -# Either show or launch the n-th dock application -set_per_digit org.gnome.shell.extensions.dash-to-dock app-hotkey-# "['#']" -# Launch a new n-th dock application -set_per_digit org.gnome.shell.extensions.dash-to-dock app-ctrl-hotkey-# "['#']" -set_per_digit org.gnome.shell.extensions.dash-to-dock app-shift-hotkey-# "['#']" -# Prevent the default # bindings of switch-to-application from colliding with switch-to-workspace -set_per_digit org.gnome.shell.keybindings switch-to-application-# "[]" +gsettings set org.gnome.shell.keybindings switch-to-application-1 "['1']" +gsettings set org.gnome.shell.keybindings switch-to-application-2 "['2']" +gsettings set org.gnome.shell.keybindings switch-to-application-3 "['3']" +gsettings set org.gnome.shell.keybindings switch-to-application-4 "['4']" +gsettings set org.gnome.shell.keybindings switch-to-application-5 "['5']" +gsettings set org.gnome.shell.keybindings switch-to-application-6 "['6']" +gsettings set org.gnome.shell.keybindings switch-to-application-7 "['7']" +gsettings set org.gnome.shell.keybindings switch-to-application-8 "['8']" +gsettings set org.gnome.shell.keybindings switch-to-application-9 "['9']" # Use super for workspaces gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-1 "['1']" @@ -42,7 +37,7 @@ gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-5 "['5 gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-6 "['6']" # Reserve slots for custom keybindings -gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/']" +gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3/']" # Set ulauncher to Super+Space gsettings set org.gnome.desktop.wm.keybindings switch-input-source "@as []" @@ -54,3 +49,13 @@ gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/or gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/ name 'Flameshot' gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/ command 'sh -c -- "flameshot gui"' gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/ binding 'Print' + +# Start a new alacritty window (rather than just switch to the already open one) +gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/ name 'alacritty' +gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/ command 'alacritty' +gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/ binding '2' + +# Start a new Chrome window (rather than just switch to the already open one) +gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3/ name 'new chrome' +gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3/ command 'google-chrome' +gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3/ binding '1' diff --git a/migrations/1722293148.sh b/migrations/1722293148.sh deleted file mode 100644 index 4a4cace..0000000 --- a/migrations/1722293148.sh +++ /dev/null @@ -1,15 +0,0 @@ -echo "Running upgrade migration..." - -# Reset specific key bindings for launching new Alacrity and Chrome instances. -# This functionality is now handled by the generic NUMBER combination, -# where the NUMBER is the position of the pinned application on the dock. -gsettings reset-recursively org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/ -gsettings reset-recursively org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3/ - -# Change dock icon click action and app-hotkey bindings behavior to launch -# or focus (if minimized) or minimize (if active) -# or show previews (if minimized and there are multiple running instances of the application). -gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'focus-minimize-or-previews' - -# Apply generic app-hotkey bindings. -source "$OMAKUB_PATH/install/desktop/set-gnome-hotkeys.sh"