![]() |
Blink Notification led on Battery Low
Since i disabled system sounds, I often miss when the battery goes low. Unfortunately Nokia missed the opportunity to signal this with the notification LED. So here is a small hack, I may turn this into a proper daemon written in C someday, but thinking about it there is no much need for it. Note that it gets extremely rare waken up (only when battery gets low or you plug in the charger) so, by itself it needs very minimal resources, blinking the LED does not consume much power either just in case you thik about that.
I posting this here, maybe someone has use for it or may even package it (or implement it in C). There is currently one small problem that it leaves a stale process around when one stops it (busybox problem?) But since it should be started at startup and never be stopped this doesn't hurt much. Anyways If anyone fixes this, please notify me. You need to hack some upstart and/or init.d scripts to start it on boot, I don't post these here and leave that as exercise to the reader. I've also defined my own 'PatternBatteryLow' in /etc/mce/mce.ini, if you are too lazy to define your own, you may just use the error pattern which blinks red at very high priority. Code:
#!/bin/sh |
Re: Blink Notification led on Battery Low
|
Re: Blink Notification led on Battery Low
thank you cehteh for your script. I'll use it, really useful. but more important for me is to understand. please, can you explain your script? what means each code line?
eg: 1.what means com.nokia.mce, is it a web address? 2.why you didn't use a simpler one-line command like PatternbatteryLow=(code) in /etc/mce/mce.ini instead of script? we need both? what I've to write in /init.d directory? a new file or I've to modify existing mce file? please, don't forget to the newbies too and help them to understand. thank you cehteh :) |
Re: Blink Notification led on Battery Low
Quote:
otherwise this should be safe. or am I wrong? Quote:
2) you can make as many as LED pattern in mce.ini, but if nothing ever triggered it (such as "scripts"), then it'll do nothing please correct me if I'm wrong |
Re: Blink Notification led on Battery Low
This is not working for me...
|
Re: Blink Notification led on Battery Low
Quote:
have you set PatternBatteryLow in yours? if you haven't, and you don't wish to hassle with your mce.ini, change the code like below Code:
# Default error pattern is always present bit may be inapprobiate |
Re: Blink Notification led on Battery Low
I inserted PatternBatteryLow in mce.ini, no luck - I also tried changing to PatternError but still no go...
|
Re: Blink Notification led on Battery Low
try move the script to /home/user, and run it using X-Term and see if it works
it should not print anything unless triggered by battery low notification or changer being connected. if you see some lines while running the script, there might be an error while copying the code please also make sure that "/com/nokia/mce/request" and "com.nokia.mce.request.req_led_pattern_activat e/deactivate" are in the same line (the code on my browser, it looked as if they're on different lines). or add trailing backslash after "/com/nokia/mce/request" (there are 2 of them, change both) Code:
dbus-send --system --dest="com.nokia.mce" --type=method_call \ |
Re: Blink Notification led on Battery Low
Quote:
If there is no PatternBatteryLow in mce.ini, the package postinst will add it using mceledpattern and restart MCE. |
Re: Blink Notification led on Battery Low
A lot of these small daemons can be translated into scripts that run on dbuscron, it would be a lot easier to manage and might reduce ticks.
Just an observation. |
All times are GMT. The time now is 03:33. |
vBulletin® Version 3.8.8