Hi.
Today a did an "apt-get dist-upgrade" in yaVDR 0.3.1 and I was requested for changing the file /etc/acpi/powerbtn.sh.
Should I remove the file with the new one or should I keep the old one?
Thanks and regards.
jbjbjb
Hi.
Today a did an "apt-get dist-upgrade" in yaVDR 0.3.1 and I was requested for changing the file /etc/acpi/powerbtn.sh.
Should I remove the file with the new one or should I keep the old one?
Thanks and regards.
jbjbjb
AFAIK you shold keep the old one. Have a look a the diff to see what will be changed - IIR this is an update from the Ubuntu Sources that will alter the action on pressing the power button to a standard Desktop behavior, but will break the defined actions for yaVDR.
Thanks, then I will restore the copy I made.
Nevertheless the old one is:
#!/bin/sh
#################################################################################
# #
# The following configuration file is generated automatically by the yaVDR #
# system. Don't change this file as every update of yaVDR will overwrite #
# the local changes. Instead put your required customizations #
# into /etc/yavdr/templates_custom/ based on the original templates #
# under /usr/share/yavdr/templates. #
# #
# http://www.vdr-wiki.de/wiki/index.php/YaVDR-FAQ#Templating.2FCustomizing #
# #
# #
#################################################################################
# /etc/acpi/powerbtn.sh
# Initiates a shutdown when the power putton has been
# pressed.
# Skip if we just in the middle of resuming.
test -f /var/lock/acpisleep && exit 0
# If gnome-power-manager or kded4 are running, let
# them handle policy This is effectively the same as 'acpi-support's
# '/usr/share/acpi-support/policy-funcs' file.
if pidof gnome-power-manager kded4 > /dev/null; then
exit
fi
if [ "0$(cat /tmp/powerbtn 2>/dev/null)" -lt "0$(($(date +%s)-1))" ]; then
date +%s > /tmp/powerbtn
svdrpsend hitk power
exit
fi
# If all else failed, just initiate a plain shutdown.
/sbin/shutdown -h now "Power button pressed"
Alles anzeigen
and the new one is:
#!/bin/sh
# /etc/acpi/powerbtn.sh
# Initiates a shutdown when the power putton has been
# pressed.
[ -r /usr/share/acpi-support/power-funcs ] && . /usr/share/acpi-support/power-funcs
# getXuser gets the X user belonging to the display in $displaynum.
# If you want the foreground X user, use getXconsole!
getXuser() {
user=`pinky -fw | awk '{ if ($2 == ":'$displaynum'" || $(NF) == ":'$displaynum'" ) { print $1; exit; } }'`
if [ x"$user" = x"" ]; then
startx=`pgrep -n startx`
if [ x"$startx" != x"" ]; then
user=`ps -o user --no-headers $startx`
fi
fi
if [ x"$user" != x"" ]; then
userhome=`getent passwd $user | cut -d: -f6`
export XAUTHORITY=$userhome/.Xauthority
else
export XAUTHORITY=""
fi
export XUSER=$user
}
# Skip if we just in the middle of resuming.
test -f /var/lock/acpisleep && exit 0
# If the current X console user is running a power management daemon that
# handles suspend/resume requests, let them handle policy This is effectively
# the same as 'acpi-support's '/usr/share/acpi-support/policy-funcs' file.
[ -r /usr/share/acpi-support/power-funcs ] && getXconsole
PMS="gnome-power-manager kpowersave xfce4-power-manager"
PMS="$PMS guidance-power-manager.py dalston-power-applet"
if pidof x $PMS > /dev/null; then
exit
elif test "$XUSER" != "" && pidof dcopserver > /dev/null && test -x /usr/bin/dcop && /usr/bin/dcop --user $XUSER kded kded loadedModules | grep -q klaptopdaemon; then
exit
elif test "$XUSER" != "" && test -x /usr/bin/qdbus; then
kded4pid=$(pgrep -n -u $XUSER kded4)
if test "$kded4pid" != ""; then
dbusaddr=$(su - $XUSER -c "grep -z DBUS_SESSION_BUS_ADDRESS /proc/$kded4pid/environ")
if test "$dbusaddr" != "" && su - $XUSER -c "export $dbusaddr; qdbus org.kde.kded" | grep -q powerdevil; then
exit
fi
fi
fi
# If all else failed, just initiate a plain shutdown.
/sbin/shutdown -h now "Power button pressed"
Alles anzeigen
just in case someone has removed the old file.
Regards.
jbjbjb
You don't need an own copy, yaVDR has one for you. This file is templated.
That's all ... and take a look at http://www.vdr-wiki.de/wiki/in…#Templating.2FCustomizing
You don't need an own copy, yaVDR has one for you. This file is templated.
That's all ... and take a look at http://www.vdr-wiki.de/wiki/in…#Templating.2FCustomizing
Thanks for the info. I did not know it.
jbjbjb
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!