Code: Alles auswählen
$ cat /usr/local/bin/orientationr
#!/bin/bash
export ORIENTATION=`xrandr | grep eDP1 | cut -c 38`
if [ $ORIENTATION = '(' ]; then
xrandr --output eDP1 --rotation right
xfconf-query -c xfce4-panel -p /panels/panel-1/mode -s 0
xfconf-query -c xfce4-panel -p /panels/panel-2/mode -s 0
xinput set-prop "ELAN Touchscreen" 'Coordinate Transformation Matrix' 0 1 0 -1 0 1 0 0 1
xinput set-prop "SynPS/2 Synaptics TouchPad" 'Coordinate Transformation Matrix' 0 1 0 -1 0 1 0 0 1
elif [ $ORIENTATION = 'r' ]; then
xrandr --output eDP1 --rotation inverted
xfconf-query -c xfce4-panel -p /panels/panel-1/mode -s 1
xfconf-query -c xfce4-panel -p /panels/panel-2/mode -s 1
xinput set-prop "ELAN Touchscreen" 'Coordinate Transformation Matrix' -1 0 1 0 -1 1 0 0 1
xinput set-prop "SynPS/2 Synaptics TouchPad" 'Coordinate Transformation Matrix' -1 0 1 0 -1 1 0 0 1
elif [ $ORIENTATION = 'i' ]; then
xrandr --output eDP1 --rotation left
xfconf-query -c xfce4-panel -p /panels/panel-1/mode -s 0
xfconf-query -c xfce4-panel -p /panels/panel-2/mode -s 0
xinput set-prop "ELAN Touchscreen" 'Coordinate Transformation Matrix' 0 -1 1 1 0 0 0 0 1
xinput set-prop "SynPS/2 Synaptics TouchPad" 'Coordinate Transformation Matrix' 0 -1 1 1 0 0 0 0 1
elif [ $ORIENTATION = 'l' ]; then
xrandr --output eDP1 --rotation normal
xfconf-query -c xfce4-panel -p /panels/panel-1/mode -s 1
xfconf-query -c xfce4-panel -p /panels/panel-2/mode -s 1
xinput set-prop "ELAN Touchscreen" 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1
xinput set-prop "SynPS/2 Synaptics TouchPad" 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1
fi