feat(hypr): add keybind to move window and focus
All checks were successful
Check Formatting of Files / Check-Formatting (push) Successful in 57s

This commit is contained in:
Price Hiller 2024-03-24 11:57:46 -05:00
parent f9b3c2f260
commit 6bea524df0
Signed by: Price
GPG Key ID: C3FADDE7A8534BEB
2 changed files with 8 additions and 0 deletions

View File

@ -104,6 +104,9 @@ bind = SUPERSHIFT,right,exec,~/.config/hypr/scripts/focus-workspace-mon.bash $((
bind = SUPERCTRL,left,exec,~/.config/hypr/scripts/move-workspace-mon.bash $(( $(hyprctl monitors -j | jq -c '.[] | select(.focused) | .activeWorkspace.id') - 1 ))
bind = SUPERCTRL,right,exec,~/.config/hypr/scripts/move-workspace-mon.bash $(( $(hyprctl monitors -j | jq -c '.[] | select(.focused) | .activeWorkspace.id') + 1 ))
bind = SUPERSHIFTCTRL,left,exec,~/.config/hypr/scripts/move-workspace-mon.bash $(( $(hyprctl monitors -j | jq -c '.[] | select(.focused) | .activeWorkspace.id') - 1 )) 1
bind = SUPERSHIFTCTRL,right,exec,~/.config/hypr/scripts/move-workspace-mon.bash $(( $(hyprctl monitors -j | jq -c '.[] | select(.focused) | .activeWorkspace.id') + 1 )) 1
bind = SUPER,1,exec,~/.config/hypr/scripts/focus-workspace-mon.bash 1
bind = SUPER,2,exec,~/.config/hypr/scripts/focus-workspace-mon.bash 2
bind = SUPER,3,exec,~/.config/hypr/scripts/focus-workspace-mon.bash 3

View File

@ -2,12 +2,17 @@
main() {
local workspace_id="${1}"
local should_change_focus="${2:-0}"
local focused_monitor
focused_monitor="$(hyprctl monitors -j | jq -c '.[] | select(.focused)' | jq -r '.name')"
hyprctl dispatch movetoworkspacesilent "${workspace_id}"
hyprctl dispatch movecurrentworkspacetomonitor "${focused_monitor}"
if (( should_change_focus == 1 )); then
hyprctl dispatch workspace "${workspace_id}"
fi
}
main "${@}"