Working on neomutt setup and some other small fixes

This commit is contained in:
Marko Korhonen 2020-11-25 10:06:19 +02:00
parent 91836193e7
commit bf10ef8645
36 changed files with 152 additions and 155 deletions

22
scripts/autorotate.sh Executable file
View 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)