Answer the question
In order to leave comments, you need to log in
power management in ubuntu
Good day to all)
Please tell me some alternative to the standard power management programs from gnome-control-center in Ubuntu 12.10 (unity), or just another solution to the problem described below.
It is necessary that when the laptop is disconnected from the power, a warning is instantly displayed (preferably with a sound). In the power and brightness options there is a checkbox "Reduce brightness to save power", and this would be enough in principle, but it only works in case of low battery. It is necessary that it signal immediately =(
Unity itself, of course, notifies about a power outage with an icon on the panel, but with a delay and inconspicuous)
Thank you in advance!
Answer the question
In order to leave comments, you need to log in
Place the 10-mains-alert.sh script in /etc/pm/power.d:
#! /bin/bash
if ! /usr/bin/on_ac_power
then
# код предупреждения здесь, например
xmessage '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
fi
Thanks for the advice, and sorry for the ignorance) but for some reason this method does not work.
I placed the script, gave it rights 777, just in case) And the script works if run manually (when the power is off, it displays a message), but on the machine it doesn’t = (what could be the trouble?
or just another solution
You can also set up alerts via power.sh and notify
sudo gedit /etc/acpi/power.sh
if on_ac_power; then
notify-send "Система электропитания" "Питание подключено" -i gtk-info
else
notify-send "Система электропитания" "Питание отключено" -i gtk-info
fi
sudo chmod +x /etc/acpi/power.sh
uh… I didn’t understand how to edit the written message here…
in short, here is the code for power.sh with sound:
if on_ac_power; then
notify-send "Система электропитания" "Питание подключено" -i gtk-info
/usr/bin/canberra-gtk-play --id="service-login" --volume=7
else
notify-send "Система электропитания" "Питание отключено" -i gtk-info
/usr/bin/canberra-gtk-play --id="service-logout" --volume=7
fi
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question