updated on Fri Jan 20 04:00:45 UTC 2012
[aur-mirror.git] / acpi-eee1000 / user
blobdfa358c69ec4121576492419f1611ec8f59167b6
1 x_user_func () {
3     CONSOLE_NUMBER=`fgconsole`
5     if [ -S /tmp/.X11-unix/X0 ]; then
6          export DISPLAY=:0
7 #          user=$(who | grep "pts/$CONSOLE_NUMBER" | awk  '{ print $1 }')
8 #          if [ "$user" = "" ]; then
9 #                  logger "Could not verify user for X:"
10 #                  logger "$(who)"
11 #                  logger "Falling back to XUSER: $XUSER"
12                user="$XUSER"
13 #          else
14 #                logger "Found X session user: $user"
15 #          fi
16          XAUTHORITY=/home/$user/.Xauthority
17          [ -f $XAUTHORITY ] && export XAUTHORITY
18     else
19          logger "X not probably running, lets launch the command anyway"
20        user="$XUSER"
21     fi;