[kde-freebsd] critical level of battery but no shutdown
Matthias Apitz
guru at unixarea.de
Thu Mar 5 09:27:09 UTC 2015
El día Wednesday, March 04, 2015 a las 01:47:17PM -0500, Anthony Jenkins escribió:
> KDE4 does allows normal (unprivileged) users to shut the system down,
> but that is probably via KDM, which is started as root. If KDE4 is
> using KDM to power off the system, and you're not using KDM, that might
> explain the problem. Not sure what KDE4 does when it wasn't started via
> KDM... can you post your ${HOME}/.xsession-errors file somewhere, after
> allowing the battery to drain below the "critical" watermark?
There is no further indication in ${HOME}/.xsession-errors file;
I configured now the notifications in System Settings -- Notifications
for the events Battery Low / Battery Critical and launch the attached
script with argument 'low' or 'critical'.
This does its job now. Thanks
#!/bin/sh
#
# will be run when battery reaches critical level
# note: the user must be in group 'operator'
#
# co guru at unixarea.de
test .$1 = .low && {
printf "battery reached level 'low' (10%%), shutdown at level 5%%\n" | wall
}
test .$1 = .critical && {
printf "battery reached level 'critical' (5%%), shutdown in 30 secs !!!\n" | wall
/sbin/shutdown -p +30s
}
--
Matthias Apitz, guru at unixarea.de, http://www.unixarea.de/ +49-170-4527211
La referencia de la Duma a la anexión de la RDA, en este caso al contrario con la Crimlía sin
referéndum, no solamente tiene gracia sino da en el blanco.-
Marinos Yannikos @MarinosYannikos en un blog de RTdeutsch.
More information about the kde-freebsd
mailing list