From: Eugen Z. <e.z...@gm...> - 2012-07-31 11:36:42
|
Hello! Recently I tried to find a script to display battery status in notion statusbar and was frustrated because scripts in notion-contrib are too outdated, unsupported and not working. I considered this as challenge and tried to write my own script, which should be (a) satisfactory for me (b) flexible enough to satisfy folks who are using (probably ad-hoc patched) old scripts. "Satisfactory for me" part mostly consists of indicator ability to be both unnoticeable (hidden when battery is full) and attention-drawing (blinking in addition to "critical" hint when battery level is too low). "Satisfactoty for others" part supposes high flexibility of settings. For example, the following config seems to make the script behave *exactly* like default configured linuxbatt: settings = { info_data = {'percentage'}, info_format = "%.f", content_format = "%s", update_interval = 15 * 1000, bat_no = 0, thresholds = { full = {0, 10, 30, 100}, charging = {0, 10, 30, 100}, discharging = {0, 10, 30, 100}, }, blink_on_discharge = false, } If not all aspects are covered by settings at the moment, I would be interested in gathering feature requests and upgrading the script. Finaly, here is it: https://github.com/ezag/notion-scripts/blob/master/statusd_battery.lua It's my first experience with Lua, so I am very interested in receiving reviews and getting feedback. Thanks for your attention! |