acpid: generate user env variables
This commit is contained in:
parent
eb91a12089
commit
b0349e5297
2 changed files with 13 additions and 2 deletions
|
@ -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
|
||||
|
@ -58,7 +69,7 @@ case "$1" in
|
|||
;;
|
||||
esac
|
||||
;;
|
||||
CPU0)
|
||||
CPU0)
|
||||
;;
|
||||
*) logger "ACPI action undefined: $2" ;;
|
||||
esac
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue