http://mychael.gotdns.com/blog/2008/06/showing-battery-life-in-awesome-with-lua/
Recently, another recording on my Eee PC was cut off because the AC power was not switched on. I found the URL above and modified the bash script NOT to launch Audacity unless power is switched on.
- Steps:
- Press Ctrl-Alt-T to open the terminal console.
- I had previously set the Audacity icon in my Favorites to launch "audacity-checklist".
So in this case, I would type "sudo kwrite /usr/bin/audacity-checklist". - Delete the line that runs the command "audacity" and replace with the following (the awk command is on one line):
#check if power is switched on and prevent launching if not so.
powerStatus=$(awk '{ print $2 }' /proc/acpi/ac_adapter/AC0/state)
if [ $powerStatus != "on-line"]
then
kdialog --msgbox "POWER IS NOT SWITCHED ON! \n\n Audacity will not launch."
else
audacity
fi
exit 0 - Try running the bash script with the power switched on and with it turned off.
No comments:
Post a Comment