From aa2cdc134eeb0eddb6164dc7f8a5b16c13b2adc5 Mon Sep 17 00:00:00 2001 From: Roy Dumblauskas Date: Sat, 20 Dec 2025 22:56:25 -0600 Subject: [PATCH] monitor swapping scripts --- roy-config/hypr/hyprland.conf | 17 ++++++++++++----- .../hypr/scripts/get-current-monitor-config.sh | 8 -------- roy-config/hypr/scripts/get-current-monitor.sh | 3 --- .../move-workspace-to-unfocused-monitor.sh | 3 +++ .../hypr/scripts/switch-to-unfocused-monitor.sh | 4 ++++ 5 files changed, 19 insertions(+), 16 deletions(-) delete mode 100755 roy-config/hypr/scripts/get-current-monitor-config.sh delete mode 100755 roy-config/hypr/scripts/get-current-monitor.sh create mode 100755 roy-config/hypr/scripts/move-workspace-to-unfocused-monitor.sh create mode 100755 roy-config/hypr/scripts/switch-to-unfocused-monitor.sh diff --git a/roy-config/hypr/hyprland.conf b/roy-config/hypr/hyprland.conf index bce4fc1..1f5c819 100755 --- a/roy-config/hypr/hyprland.conf +++ b/roy-config/hypr/hyprland.conf @@ -58,6 +58,12 @@ exec-once = waybar env = HYPRCURSOR_THEME,rose-pine-hyprcursor env = HYPRCURSOR_SIZE,18 +#################### +### SCRIPT PATHS ### +#################### + +switchFocus = "~/.config/hypr/scripts/switch-to-unfocused-monitor.sh" +moveAndSwitch = "~/.config/hypr/scripts/move-workspace-to-unfocused-monitor" ##################### ### LOOK AND FEEL ### @@ -205,13 +211,14 @@ bind = $mainMod SHIFT, 8, movetoworkspace, 8 bind = $mainMod SHIFT, 9, movetoworkspace, 9 bind = $mainMod SHIFT, 0, movetoworkspace, 10 -# Move workspace to next monitor (right) -bind = $mainMod SHIFT, TAB, movecurrentworkspacetomonitor, r +# Move workspace to unfocused monitor (Does not currently support more than two monitors) +bind = $mainMod SHIFT, TAB, exec, $moveAndSwitch -# Move focus to next monitor (right) -bind = $mainMod, TAB, focusmonitor, r +# Switch to unfocused monitor (Does not currently support more than two monitors) +bind = $mainMod, TAB, exec, $switchFocus -# Rotate screen with arrows //TODO: only works on builtin display (see scripts) +# Rotate screen with arrows +# TODO: only works on builtin display (see scripts) bind = $mainMod SHIFT, up, exec, hyprctl keyword monitor "eDP-1,preferred,auto,1,transform,0" bind = $mainMod SHIFT, down, exec, hyprctl keyword monitor "eDP-1,preferred,auto,1,transform,2" bind = $mainMod SHIFT, left, exec, hyprctl keyword monitor "eDP-1,preferred,auto,1,transform,1" diff --git a/roy-config/hypr/scripts/get-current-monitor-config.sh b/roy-config/hypr/scripts/get-current-monitor-config.sh deleted file mode 100755 index 24ec03a..0000000 --- a/roy-config/hypr/scripts/get-current-monitor-config.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -dir=$1 -config=$(hyprctl monitors -j | jq -r '.[] | select(.focused) | "\(.name),transform,'$dir'"') - -echo $config - -hyprctl keyword monitor $config diff --git a/roy-config/hypr/scripts/get-current-monitor.sh b/roy-config/hypr/scripts/get-current-monitor.sh deleted file mode 100755 index 0e1825f..0000000 --- a/roy-config/hypr/scripts/get-current-monitor.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -dir=$1 -echo "current monitor $1" diff --git a/roy-config/hypr/scripts/move-workspace-to-unfocused-monitor.sh b/roy-config/hypr/scripts/move-workspace-to-unfocused-monitor.sh new file mode 100755 index 0000000..4a22173 --- /dev/null +++ b/roy-config/hypr/scripts/move-workspace-to-unfocused-monitor.sh @@ -0,0 +1,3 @@ +#!/bin/sh +monitor=$(hyprctl monitors -j | jq -r 'first(.[] | select(.focused == false) | .name)') +hyprctl dispatch movecurrentworkspacetomonitor $monitor diff --git a/roy-config/hypr/scripts/switch-to-unfocused-monitor.sh b/roy-config/hypr/scripts/switch-to-unfocused-monitor.sh new file mode 100755 index 0000000..85c7bdb --- /dev/null +++ b/roy-config/hypr/scripts/switch-to-unfocused-monitor.sh @@ -0,0 +1,4 @@ +#!/bin/sh +monitor=$(hyprctl monitors -j | jq -r 'first(.[] | select(.focused == false) | .name)') + +hyprctl dispatch focusmonitor $monitor