From 62f2118a9bbf13b6eb6b352e49dc6f75678ccdab Mon Sep 17 00:00:00 2001 From: Simon Rieger Date: Thu, 22 May 2025 13:22:47 +0200 Subject: [PATCH] add move_workspace_to_focused_monitor.sh script --- dot_config/hypr/keybindings.conf | 28 +++++++++++++------ ...table_move_workspace_to_focused_monitor.sh | 8 ++++++ 2 files changed, 28 insertions(+), 8 deletions(-) create mode 100644 dot_config/hypr/scripts/executable_move_workspace_to_focused_monitor.sh diff --git a/dot_config/hypr/keybindings.conf b/dot_config/hypr/keybindings.conf index 5bd8fac..4ca8dab 100644 --- a/dot_config/hypr/keybindings.conf +++ b/dot_config/hypr/keybindings.conf @@ -66,14 +66,6 @@ binde = SUPER, right, resizeactive, 20 0 binde = SUPER, up, resizeactive, 0 -20 binde = SUPER, down, resizeactive, 0 20 -# Verschiebt den aktuellen Workspace auf den linken bzw. rechten Monitor -# STRG + ALT + Pfeil links: Workspace nach links verschieben -# STRG + ALT + Pfeil rechts: Workspace nach rechts verschieben -bind = CTRL $mainMod, left, movecurrentworkspacetomonitor, l -bind = CTRL $mainMod, right, movecurrentworkspacetomonitor, r -bind = CTRL $mainMod, up, movecurrentworkspacetomonitor, u -bind = CTRL $mainMod, down, movecurrentworkspacetomonitor, d - # Switch workspaces with mainMod + [0-9] bind = $mainMod, 1, workspace, 1 bind = $mainMod, 2, workspace, 2 @@ -98,6 +90,26 @@ bind = $mainMod SHIFT, 8, movetoworkspace, 8 bind = $mainMod SHIFT, 9, movetoworkspace, 9 bind = $mainMod SHIFT, 0, movetoworkspace, 10 +# Verschiebt den aktuellen Workspace auf den linken bzw. rechten Monitor +# STRG + ALT + Pfeil links: Workspace nach links verschieben +# STRG + ALT + Pfeil rechts: Workspace nach rechts verschieben +bind = CTRL $mainMod, left, movecurrentworkspacetomonitor, l +bind = CTRL $mainMod, right, movecurrentworkspacetomonitor, r +bind = CTRL $mainMod, up, movecurrentworkspacetomonitor, u +bind = CTRL $mainMod, down, movecurrentworkspacetomonitor, d + +# Verschiebt den Workspace auf den aktuell fokussierten Monitor +bind = $mainMod CTRL, 1, exec, ~/.config/hypr/scripts/move_workspace_to_focused_monitor.sh 1 +bind = $mainMod CTRL, 2, exec, ~/.config/hypr/scripts/move_workspace_to_focused_monitor.sh 2 +bind = $mainMod CTRL, 3, exec, ~/.config/hypr/scripts/move_workspace_to_focused_monitor.sh 3 +bind = $mainMod CTRL, 4, exec, ~/.config/hypr/scripts/move_workspace_to_focused_monitor.sh 4 +bind = $mainMod CTRL, 5, exec, ~/.config/hypr/scripts/move_workspace_to_focused_monitor.sh 5 +bind = $mainMod CTRL, 6, exec, ~/.config/hypr/scripts/move_workspace_to_focused_monitor.sh 6 +bind = $mainMod CTRL, 7, exec, ~/.config/hypr/scripts/move_workspace_to_focused_monitor.sh 7 +bind = $mainMod CTRL, 8, exec, ~/.config/hypr/scripts/move_workspace_to_focused_monitor.sh 8 +bind = $mainMod CTRL, 9, exec, ~/.config/hypr/scripts/move_workspace_to_focused_monitor.sh 9 +bind = $mainMod CTRL, 0, exec, ~/.config/hypr/scripts/move_workspace_to_focused_monitor.sh 10 + # Example special workspace (scratchpad) bind = $mainMod, S, togglespecialworkspace, magic bind = $mainMod SHIFT, S, movetoworkspace, special:magic diff --git a/dot_config/hypr/scripts/executable_move_workspace_to_focused_monitor.sh b/dot_config/hypr/scripts/executable_move_workspace_to_focused_monitor.sh new file mode 100644 index 0000000..b6ec678 --- /dev/null +++ b/dot_config/hypr/scripts/executable_move_workspace_to_focused_monitor.sh @@ -0,0 +1,8 @@ +#!/bin/bash +WORKSPACE=$1 +# Fokussierten Monitor ermitteln +MONITOR=$(hyprctl monitors -j | jq -r '.[] | select(.focused) | .id') +# Workspace verschieben +hyprctl dispatch moveworkspacetomonitor "$WORKSPACE" "$MONITOR" +# Zum Workspace wechseln (aktivieren) +hyprctl dispatch workspace "$WORKSPACE"