Autorotate + Suspend change
This commit is contained in:
parent
d0fc98ca4f
commit
0eb1620a5a
4 changed files with 46 additions and 7 deletions
24
niri/bin/autorotate.sh
Executable file
24
niri/bin/autorotate.sh
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/env bash
|
||||
transform="normal"
|
||||
|
||||
monitor-sensor | while read -r line; do
|
||||
case "$line" in
|
||||
*normal*)
|
||||
new_transform="180"
|
||||
;;
|
||||
*bottom-up*)
|
||||
new_transform="normal"
|
||||
;;
|
||||
*)
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$new_transform" != "$transform" ]]; then
|
||||
transform="$new_transform"
|
||||
echo "Transform: $transform"
|
||||
niri msg output eDP-1 transform "$transform"
|
||||
pkill lisgd
|
||||
niri msg action spawn -- lisgd
|
||||
fi
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue