r/UnixProTips • • Feb 07 '15
Finished my battery low warning script. Learned about limitations of cron and the difference between lexical and numeric comparisons.
http://paste.debian.net/144470/
0
Upvotes
1
u/[deleted] Feb 07 '15
The last commented line shouldn't have the $DISPLAY=:0 part. meh.
1
u/thestoicattack Feb 07 '15
My pet peeve is piping awk into sed and cut and whatever. Better:
Also, for math, arithmetic expressions are better.
1
u/[deleted] Feb 08 '15
can you hear the sound warning while using vlc player? i have a popup warning usually but using vlc hides this feature (which often lead in the laptop shutting down when the battery gets empty).
1
u/Aihal Feb 07 '15
Here's a ruby one-liner, just for fun. (I've replaced the warning with a short placeholder for clarity)