finally fixed the unified-rotate script
parent
bd6fba866f
commit
006b8b1aea
|
|
@ -10,10 +10,12 @@ if [[ "$direction" != "cw" && "$direction" != "ccw" ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Get current monitor name
|
# Get current monitor name
|
||||||
curmon=$(hyprctl monitors | awk '/focused: yes/{getline; print $2}')
|
# curmon=$(hyprctl monitors | awk '/focused: yes/{getline; print $2}')
|
||||||
|
curmon=$(hyprctl monitors | grep -B12 "focused: yes" | head -n1 | awk '{print $2}')
|
||||||
|
|
||||||
# Get current transform value
|
# Get current transform value
|
||||||
currot=$(hyprctl monitors | awk '/focused: yes/{for(i=0;i<15;i++){getline;if($1=="transform:"){print $2;break}}}')
|
# currot=$(hyprctl monitors | awk '/focused: yes/{for(i=0;i<15;i++){getline;if($1=="transform:"){print $2;break}}}')
|
||||||
|
currot=$(hyprctl monitors | grep -B1 "focused: yes" | head -n1 | awk '{print $2}')
|
||||||
|
|
||||||
# Calculate new rotation
|
# Calculate new rotation
|
||||||
if [[ "$direction" == "cw" ]]; then
|
if [[ "$direction" == "cw" ]]; then
|
||||||
|
|
@ -33,7 +35,7 @@ fi
|
||||||
echo "Rotating monitor '$curmon' from $currot to $newrot ($direction)"
|
echo "Rotating monitor '$curmon' from $currot to $newrot ($direction)"
|
||||||
|
|
||||||
# Apply new rotation to monitor
|
# Apply new rotation to monitor
|
||||||
hyprctl keyword monitor "$curmon,preferred,auto,0x0,$newrot"
|
hyprctl keyword monitor "$curmon,preferred,auto,1,transform,$newrot"
|
||||||
|
|
||||||
# Detect touchscreen device name
|
# Detect touchscreen device name
|
||||||
touchdev=$(hyprctl devices | awk '/Touchscreen/{getline; print $2}')
|
touchdev=$(hyprctl devices | awk '/Touchscreen/{getline; print $2}')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue