From 6bea524df061ac3caf1869b159746d0236b9c40f Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Sun, 24 Mar 2024 11:57:46 -0500 Subject: [PATCH] feat(hypr): add keybind to move window and focus --- dots/.config/hypr/conf/core/bindings.conf | 3 +++ dots/.config/hypr/scripts/move-workspace-mon.bash | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/dots/.config/hypr/conf/core/bindings.conf b/dots/.config/hypr/conf/core/bindings.conf index 89c1a644..b488242f 100644 --- a/dots/.config/hypr/conf/core/bindings.conf +++ b/dots/.config/hypr/conf/core/bindings.conf @@ -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 diff --git a/dots/.config/hypr/scripts/move-workspace-mon.bash b/dots/.config/hypr/scripts/move-workspace-mon.bash index 777f2d90..7e0fd680 100755 --- a/dots/.config/hypr/scripts/move-workspace-mon.bash +++ b/dots/.config/hypr/scripts/move-workspace-mon.bash @@ -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 "${@}"