#!/bin/bash # Deactivate when in docked mode if [ $(cat /sys/devices/platform/dock.0/docked) -eq 1 ] ; then exit 1 fi # Confirm or deny zenity --question --title='Bildschirm drehen' --text="Flip the screen?" if [ $? -gt 0 ] ; then exit 1 fi #Gets the current mode of the screen mode="$(xrandr -q --verbose | grep 'connected' | egrep -o '\) (normal|left|inverted|right) \(' | egrep -o '(normal|left|inverted|right)')" # Prestart because X is a bitch xsetwacom --list devices case "$mode" in normal) #toggle rotate to normal xsetwacom set "Atmel Atmel maXTouch Digitizer touch" Rotate none xsetwacom set "Wacom ISDv4 EC Pen stylus" Rotate none xsetwacom set "Wacom ISDv4 EC Pen eraser" Rotate none ;; esac # Actual Code case "$mode" in normal) #toggle rotate to the left xrandr -o right xsetwacom set "Atmel Atmel maXTouch Digitizer touch" Rotate cw xsetwacom set "Wacom ISDv4 EC Pen stylus" Rotate cw xsetwacom set "Wacom ISDv4 EC Pen eraser" Rotate cw ;; right) #toggle rotate to normal xrandr -o normal xsetwacom set "Atmel Atmel maXTouch Digitizer touch" Rotate none xsetwacom set "Wacom ISDv4 EC Pen stylus" Rotate none xsetwacom set "Wacom ISDv4 EC Pen eraser" Rotate none ;; esac