You are not logged in.

#1 2013-01-17 22:40:05

pyropirat
Member
From: Germany
Registered: 2012-10-22
Posts: 7

Using xrandr in acpi event script

I have a Thinkpad x220t and for automatic Rotation when going into tablet mode i am using the folowing script.

#!/bin/sh

export DISPLAY=$(w -h -s | grep ":[0-9]\W" | head -1 | awk '{print $2}')
X_USER=$(w -h -s | grep ":[0-9]\W" | head -1 | awk '{print $1}')
export XAUTHORITY=/home/$X_USER/.Xauthority


SU="su $X_USER -c"

$SU "xrandr --output LVDS1 --rotate inverted"
$SU "xsetwacom set 'Wacom ISDv4 E6 Pen stylus' rotate half"
$SU "xsetwacom set 'Wacom ISDv4 E6 Finger touch' rotate half"
$SU "xsetwacom set 'Wacom ISDv4 E6 Pen eraser' rotate half"
$SU "xinput disable 'TPPS/2 IBM TrackPoint'"
logger "TabletMode activated"

Until a few days everything worked fine. Now i switched from i3 to gnome and the script stopped working. When i run the script as root everything works fine, bit when it is running by acpi the script runs but nothing happens. I cant find any error. journalctl produces the folowing output when converting into tabletmode:

Jan 17 23:17:02 pyropirat-think logger[24529]: /home/pyropirat/.Xauthority
Jan 17 23:17:02 pyropirat-think su[24530]: (to pyropirat) root on none
Jan 17 23:17:02 pyropirat-think su[24530]: pam_unix(su:session): session opened for user pyropirat by (uid=0)
Jan 17 23:17:02 pyropirat-think su[24530]: pam_unix(su:session): session closed for user pyropirat
Jan 17 23:17:02 pyropirat-think su[24532]: (to pyropirat) root on none
Jan 17 23:17:02 pyropirat-think su[24532]: pam_unix(su:session): session opened for user pyropirat by (uid=0)
Jan 17 23:17:02 pyropirat-think su[24532]: pam_unix(su:session): session closed for user pyropirat
Jan 17 23:17:02 pyropirat-think su[24534]: (to pyropirat) root on none
Jan 17 23:17:02 pyropirat-think su[24534]: pam_unix(su:session): session opened for user pyropirat by (uid=0)
Jan 17 23:17:02 pyropirat-think su[24534]: pam_unix(su:session): session closed for user pyropirat
Jan 17 23:17:02 pyropirat-think su[24536]: (to pyropirat) root on none
Jan 17 23:17:02 pyropirat-think su[24536]: pam_unix(su:session): session opened for user pyropirat by (uid=0)
Jan 17 23:17:02 pyropirat-think su[24536]: pam_unix(su:session): session closed for user pyropirat
Jan 17 23:17:02 pyropirat-think su[24538]: (to pyropirat) root on none
Jan 17 23:17:02 pyropirat-think su[24538]: pam_unix(su:session): session opened for user pyropirat by (uid=0)
Jan 17 23:17:02 pyropirat-think su[24538]: pam_unix(su:session): session closed for user pyropirat
Jan 17 23:17:02 pyropirat-think logger[24540]: TabletMode activated

Can somebody find an error in my script?

pyropirat

Last edited by pyropirat (2013-01-18 12:14:29)

Offline

Board footer

Powered by FluxBB