From 6d7fda0857ed6905c6b7ff21ec4cbe4d6acd7b70 Mon Sep 17 00:00:00 2001 From: The_miro Date: Thu, 5 Jun 2025 12:26:36 +0200 Subject: [PATCH] added screen rotation prototype --- .../scripts/screenrotationacw.sh.proto | 22 +++++++++++++++++++ .../scripts/screenrotationwcw.sh.proto | 21 ++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100755 desktopenvs/hyprland/scripts/screenrotationacw.sh.proto create mode 100755 desktopenvs/hyprland/scripts/screenrotationwcw.sh.proto diff --git a/desktopenvs/hyprland/scripts/screenrotationacw.sh.proto b/desktopenvs/hyprland/scripts/screenrotationacw.sh.proto new file mode 100755 index 0000000..ea1cf10 --- /dev/null +++ b/desktopenvs/hyprland/scripts/screenrotationacw.sh.proto @@ -0,0 +1,22 @@ +#!/bin/bash +curmon=$(hyprctl monitors | grep -B11 "focused: yes" | head -n1 | awk '{print $2}') +currot=$(hyprctl monitors | grep -B1 "focused: yes" | head -n1 | awk '{print $2}') +touchdev=$(hyprctl devices | grep -A1 "Touch Device" | tail -n1 | xargs) + +newrot="" +if [ $currot == "3" ]; then + newrot="0" +else + newrot=$(($currot + 1)) +fi +echo $newrot + +hyprctl keyword monitor $curmon,preferred,auto,1,transform,$newrot + +eww reload + +if [ "$touchdev" != '' ]; then + hyprctl keyword device:$touchdev:transform $newrot +fi + + diff --git a/desktopenvs/hyprland/scripts/screenrotationwcw.sh.proto b/desktopenvs/hyprland/scripts/screenrotationwcw.sh.proto new file mode 100755 index 0000000..ac3f6a6 --- /dev/null +++ b/desktopenvs/hyprland/scripts/screenrotationwcw.sh.proto @@ -0,0 +1,21 @@ +#!/bin/bash +curmon=$(hyprctl monitors | grep -B11 "focused: yes" | head -n1 | awk '{print $2}') +currot=$(hyprctl monitors | grep -B1 "focused: yes" | head -n1 | awk '{print $2}') +touchdev=$(hyprctl devices | grep -A1 "Touch Device" | tail -n1 | xargs) + +newrot="" +if [ $currot == "3" ]; then + newrot="0" +else + newrot=$(($currot - 1)) +fi +echo $newrot + + +hyprctl keyword monitor $curmon,preferred,auto,1,transform,$newrot + +eww reload + +if [ "$touchdev" != '' ]; then + hyprctl keyword device:$touchdev:transform $newrot +fi