![]() |
2011-02-10
, 17:46
|
Posts: 1,463 |
Thanked: 1,916 times |
Joined on Feb 2008
@ Edmonton, AB
|
#11
|
The Following User Says Thank You to Creamy Goodness For This Useful Post: | ||
![]() |
2011-02-10
, 17:53
|
|
Posts: 1,503 |
Thanked: 2,688 times |
Joined on Oct 2010
@ Denmark
|
#12
|
![]() |
2011-02-10
, 19:14
|
|
Posts: 1,030 |
Thanked: 792 times |
Joined on Jun 2009
|
#13
|
The Following User Says Thank You to hawaii For This Useful Post: | ||
![]() |
2011-02-11
, 01:29
|
Posts: 235 |
Thanked: 86 times |
Joined on Dec 2010
|
#14
|
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.
oohh very useful app, thanks hawaii. I wanted to laugh at these guys with "low battery scripts" that cause a low battery...
![]() |
2011-02-11
, 06:39
|
|
Posts: 491 |
Thanked: 341 times |
Joined on Nov 2009
@ LA
|
#15
|
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.
![]() |
2011-02-11
, 09:44
|
|
Posts: 491 |
Thanked: 341 times |
Joined on Nov 2009
@ LA
|
#16
|
I've implemented the script in Vala and packaged it as Low Battery LED (lowbatled).
If there is no PatternBatteryLow in mce.ini, the package postinst will add it using mceledpattern and restart MCE.
The Following User Says Thank You to xxxxts For This Useful Post: | ||
![]() |
2011-02-11
, 10:21
|
Posts: 539 |
Thanked: 518 times |
Joined on May 2010
@ nanaurbusiness
|
#17
|
I've implemented the script in Vala and packaged it as Low Battery LED (lowbatled).
If there is no PatternBatteryLow in mce.ini, the package postinst will add it using mceledpattern and restart MCE.
The Following User Says Thank You to J4ZZ For This Useful Post: | ||
![]() |
2011-02-12
, 18:16
|
|
Posts: 138 |
Thanked: 375 times |
Joined on Aug 2009
@ Berlin
|
#18
|
diff --git a/modules/battery.c b/modules/battery.c index cec3f0d..a1ab114 100644 --- a/modules/battery.c +++ b/modules/battery.c @@ -129,7 +129,7 @@ static gboolean battery_ok_dbus_cb(DBusMessage *const msg) mce_log(LL_DEBUG, "Received battery ok signal"); -// execute_datapipe_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_LOW, USE_INDATA); + execute_datapipe_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_LOW, USE_INDATA); execute_datapipe(&battery_status_pipe, GINT_TO_POINTER(BATTERY_STATUS_OK), @@ -156,7 +156,7 @@ static gboolean battery_low_dbus_cb(DBusMessage *const msg) mce_log(LL_DEBUG, "Received battery low signal"); -// execute_datapipe_output_triggers(&led_pattern_activate_pipe, MCE_LED_PATTERN_BATTERY_LOW, USE_INDATA); + execute_datapipe_output_triggers(&led_pattern_activate_pipe, MCE_LED_PATTERN_BATTERY_LOW, USE_INDATA); execute_datapipe(&battery_status_pipe, GINT_TO_POINTER(BATTERY_STATUS_LOW), @@ -263,7 +263,7 @@ static gboolean charger_charging_on_dbus_cb(DBusMessage *const msg) /* In case these are active; there's no harm to call them anyway */ execute_datapipe_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_FULL, USE_INDATA); -// execute_datapipe_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_LOW, USE_INDATA); + execute_datapipe_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_LOW, USE_INDATA); execute_datapipe_output_triggers(&led_pattern_activate_pipe, MCE_LED_PATTERN_BATTERY_CHARGING, USE_INDATA);
The Following 4 Users Say Thank You to pH5 For This Useful Post: | ||
![]() |
2011-02-13
, 15:25
|
|
Posts: 491 |
Thanked: 341 times |
Joined on Nov 2009
@ LA
|
#19
|
No. The most efficient way would be to add this to the libbattery.so module of the mce daemon because this is running anyway. And guess what, mce is now open source!
After downloading the MeeGo mce from http://meego.gitorious.org/meego-middleware/mce and applying the patch below, I ran "make modules/libbattery.so" and put the result into /usr/lib/mce/modules. It seems to work, but I'm still waiting for the next battery_low signal to verify.
Code:diff --git a/modules/battery.c b/modules/battery.c index cec3f0d..a1ab114 100644 --- a/modules/battery.c +++ b/modules/battery.c @@ -129,7 +129,7 @@ static gboolean battery_ok_dbus_cb(DBusMessage *const msg) mce_log(LL_DEBUG, "Received battery ok signal"); -// execute_datapipe_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_LOW, USE_INDATA); + execute_datapipe_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_LOW, USE_INDATA); execute_datapipe(&battery_status_pipe, GINT_TO_POINTER(BATTERY_STATUS_OK), @@ -156,7 +156,7 @@ static gboolean battery_low_dbus_cb(DBusMessage *const msg) mce_log(LL_DEBUG, "Received battery low signal"); -// execute_datapipe_output_triggers(&led_pattern_activate_pipe, MCE_LED_PATTERN_BATTERY_LOW, USE_INDATA); + execute_datapipe_output_triggers(&led_pattern_activate_pipe, MCE_LED_PATTERN_BATTERY_LOW, USE_INDATA); execute_datapipe(&battery_status_pipe, GINT_TO_POINTER(BATTERY_STATUS_LOW), @@ -263,7 +263,7 @@ static gboolean charger_charging_on_dbus_cb(DBusMessage *const msg) /* In case these are active; there's no harm to call them anyway */ execute_datapipe_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_FULL, USE_INDATA); -// execute_datapipe_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_LOW, USE_INDATA); + execute_datapipe_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_LOW, USE_INDATA); execute_datapipe_output_triggers(&led_pattern_activate_pipe, MCE_LED_PATTERN_BATTERY_CHARGING, USE_INDATA);
The daemon is sleeping most of the time, it is only woken up by the D-Bus signals. And so is the script. Of course the daemon is way more efficient once the signal comes in, but given the expected frequency of battery_low signals this isn't worth all that much. It occupies less memory though.