File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,8 +49,7 @@ ctrl + alt + {Delete,Insert}
4949# rotate display orientation
5050shift + super + {Up,Down,Left,Right}
5151 sfx-synth btn & \
52- xrandr --output "$(xrandr | grep '[^dis]connected' | tr -s ' ' '\t' | cut -f1)" \
53- --rotate "{inverted,normal,right,left}"
52+ echo '{bottom-up,normal,right-up,left-up}' >> ~/.rotate
5453
5554## function keys
5655# F1: power/reboot
Original file line number Diff line number Diff line change 11#! /usr/bin/env sh
22
3- # xwin-tabletd v0.2
3+ # xwin-tabletd v0.3
44# rotates display and digitizer input based on accelerometer
55
66# detect primary display
@@ -15,14 +15,19 @@ ptr_devices="$(xinput list --name-only | egrep -i '(touchpad|trackpoint)')"
1515
1616trap ' kill $!' 0 1 2 3 6 15
1717
18- # workaround: repeatedly poke at iio-sensor-proxy on a timer to avoid
19- # aggressive battery optimization
18+ # workarounds for iio-sensor-proxy
19+ # repeatedly poke accelerometer on a timer to avoid aggressive battery optimization
2020while : ; do
2121 cat /sys/bus/iio/devices/iio:device0/in_accel_x_raw > /dev/null
2222 sleep 2
2323done &
2424
25- monitor-sensor | while read -r line; do
25+ # sxhkd: allows manual override if and when accelerometer stops responding
26+ RFIFO=" $HOME /.rotate"
27+ [ ! -p " $RFIFO " ] && mkfifo " $RFIFO "
28+ monitor-sensor >> " $RFIFO " &
29+
30+ while read -r line; do
2631 state=" ${line##* } "
2732 unset rot mat
2833 case " $state " in
@@ -48,4 +53,4 @@ monitor-sensor | while read -r line; do
4853 [ " $rot " = " normal" ] && xinput enable " $f " || xinput disable " $f "
4954 done &
5055 fi
51- done
56+ done < " $RFIFO "
You can’t perform that action at this time.
0 commit comments