acpid: generate user env variables

This commit is contained in:
Andrea Brancaleoni 2015-09-09 09:09:55 +02:00
parent eb91a12089
commit b0349e5297
2 changed files with 13 additions and 2 deletions

View file

@ -10,6 +10,17 @@ setspeed="/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed"
set $*
PID=$(pgrep dbus-launch)
USER=$(ps -o user --no-headers $PID)
USERHOME=$(getent passwd $USER | cut -d: -f6)
export XAUTHORITY="$USERHOME/.Xauthority"
for x in /tmp/.X11-unix/*; do
displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
if [ x"$XAUTHORITY" != x"" ]; then
export DISPLAY=":$displaynum"
fi
done
case "$1" in
button/power)
#echo "PowerButton pressed!">/dev/tty5

View file

@ -1,7 +1,7 @@
# Template file for 'acpid'
pkgname=acpid
version=2.0.25
revision=1
revision=2
build_pie=yes
build_style=gnu-configure
configure_args="--sbindir=/usr/bin"