From 59763cec358c6d45a9c9aee0c3ff6daa02d693a0 Mon Sep 17 00:00:00 2001 From: Roy Dumblauskas Date: Sat, 20 Dec 2025 21:23:02 -0600 Subject: [PATCH] initial monitor rotation scripts --- roy-config/hypr/hyprland.conf | 6 +++--- roy-config/hypr/scripts/get-current-monitor-config.sh | 8 ++++++++ roy-config/hypr/scripts/get-current-monitor.sh | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) create mode 100755 roy-config/hypr/scripts/get-current-monitor-config.sh mode change 100644 => 100755 roy-config/hypr/scripts/get-current-monitor.sh diff --git a/roy-config/hypr/hyprland.conf b/roy-config/hypr/hyprland.conf index 2c789fc..6592747 100755 --- a/roy-config/hypr/hyprland.conf +++ b/roy-config/hypr/hyprland.conf @@ -14,7 +14,7 @@ monitor=,preferred,auto,1 monitorv2 { output = DP-1 mode = 3840x2160@60 - position = auto-right + position = auto scale = 1.5 transform = 0 } @@ -22,7 +22,7 @@ monitorv2 { monitorv2 { output = HDMI-A-1 mode = 3840x2160@30 - position = auto-right + position = auto scale = 1.5 transform = 0 } @@ -208,7 +208,7 @@ bind = $mainMod SHIFT, 0, movetoworkspace, 10 # Move workspace to next monitor (right) bind = $mainMod SHIFT, TAB, movecurrentworkspacetomonitor, r -# Rotate screen with arrows //TODO: apply to 'current', don't change resolution, frame rate, or scale. Just Rotate +# 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 new file mode 100755 index 0000000..24ec03a --- /dev/null +++ b/roy-config/hypr/scripts/get-current-monitor-config.sh @@ -0,0 +1,8 @@ +#!/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 old mode 100644 new mode 100755 index 4ef7521..0e1825f --- a/roy-config/hypr/scripts/get-current-monitor.sh +++ b/roy-config/hypr/scripts/get-current-monitor.sh @@ -1,3 +1,3 @@ -# bin/bash +#!/bin/sh dir=$1 echo "current monitor $1"