Added autorotation
Signed-off-by: Marko Korhonen <marko.korhonen@reekynet.com>
This commit is contained in:
parent
97d6f5c483
commit
b243c13bd8
2 changed files with 24 additions and 0 deletions
|
@ -20,6 +20,8 @@ exec {
|
||||||
ydotoold
|
ydotoold
|
||||||
wl-paste -t text --watch clipman store
|
wl-paste -t text --watch clipman store
|
||||||
autotiling
|
autotiling
|
||||||
|
$HOME/Scripts/autorotate.sh
|
||||||
|
squeekboard
|
||||||
}
|
}
|
||||||
|
|
||||||
exec_always {
|
exec_always {
|
||||||
|
|
22
home/Scripts/autorotate.sh
Executable file
22
home/Scripts/autorotate.sh
Executable file
|
@ -0,0 +1,22 @@
|
||||||
|
#!/bin/bash
|
||||||
|
function rotate_ms {
|
||||||
|
case $1 in
|
||||||
|
"normal")
|
||||||
|
swaymsg output eDP-1 transform 0
|
||||||
|
;;
|
||||||
|
"right-up")
|
||||||
|
swaymsg output eDP-1 transform 90
|
||||||
|
;;
|
||||||
|
"bottom-up")
|
||||||
|
swaymsg output eDP-1 transform 180
|
||||||
|
;;
|
||||||
|
"left-up")
|
||||||
|
swaymsg output eDP-1 transform 270
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
while IFS='$\n' read -r line; do
|
||||||
|
rotation="$(echo $line | sed -En "s/^.*orientation changed: (.*)/\1/p")"
|
||||||
|
[[ ! -z $rotation ]] && rotate_ms $rotation
|
||||||
|
done < <(stdbuf -oL monitor-sensor)
|
Loading…
Reference in a new issue