Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- oldState=0
- a='Wacom ISDv4 E6 Pen stylus'
- b='Wacom ISDv4 E6 Finger touch'
- c='Wacom ISDv4 E6 Pen eraser'
- while true
- do
- state=$(cat /sys/devices/platform/thinkpad_acpi/hotkey_tablet_mode) #This file here is an indicator of whether it's in tablet mode or laptop mode
- if [[ $state == 0 && $oldState == 1 ]]
- then
- xrandr -o normal
- #xsetwacom --set "$a" Rotate none #Not needed on GNOME and some other DEs
- #xsetwacom --set "$b" Rotate none #Not needed on GNOME and some other DEs
- #xsetwacom --set "$c" Rotate none #Not needed on GNOME and some other DEs
- oldState=0
- elif [[ $state == 1 && $oldState == 0 ]]
- then
- xrandr -o inverted
- #xsetwacom --set "$a" Rotate half #Not needed on GNOME and some other DEs
- #xsetwacom --set "$b" Rotate half #Not needed on GNOME and some other DEs
- #xsetwacom --set "$c" Rotate half #Not needed on GNOME and some other DEs
- ~/.backlight 0 #Script to turn off keyboard backlight
- oldState=1
- fi
- sleep 3s
- done
Advertisement
Add Comment
Please, Sign In to add comment