rotation script
parent
006b8b1aea
commit
af4465a89c
|
|
@ -4,14 +4,15 @@
|
|||
# Usage: rotate.sh [cw|ccw]
|
||||
direction="$1"
|
||||
|
||||
if [[ "$direction" != "cw" && "$direction" != "ccw" ]]; then
|
||||
echo "Usage: $0 [cw|ccw]"
|
||||
if [[ "$direction" != "cw" && "$direction" != "ccw" && "$direction" != "0" && "$direction" != "1" && "$direction" != "2" && "$direction" != "3" ]]; then
|
||||
echo "Usage: $0 [cw|ccw] OR $0 [0|1|2|3]"
|
||||
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get current monitor name
|
||||
# curmon=$(hyprctl monitors | awk '/focused: yes/{getline; print $2}')
|
||||
curmon=$(hyprctl monitors | grep -B12 "focused: yes" | head -n1 | awk '{print $2}')
|
||||
# curmon=$(hyprctl monitors | awk '/focused: yes/{getline; print $2}')
|
||||
|
||||
# Get current transform value
|
||||
# currot=$(hyprctl monitors | awk '/focused: yes/{for(i=0;i<15;i++){getline;if($1=="transform:"){print $2;break}}}')
|
||||
|
|
@ -32,6 +33,10 @@ else # ccw
|
|||
fi
|
||||
fi
|
||||
|
||||
if [[ "$direction" == "0" || "$direction" == "1" || "$direction" == "2" || "$direction" == "3" ]]; then
|
||||
newrot="$direction"
|
||||
fi
|
||||
|
||||
echo "Rotating monitor '$curmon' from $currot to $newrot ($direction)"
|
||||
|
||||
# Apply new rotation to monitor
|
||||
|
|
|
|||
Loading…
Reference in New Issue