Active Topics

 


Reply
Thread Tools
Posts: 4 | Thanked: 1 time | Joined on Mar 2008
#1
I've started using my n810 as an alarm clock, and have been looking for ways to make this more convenient/useful. As part of this, I'd like to be able to set it up to launch mClock whenever it is plugged into the charger (since I usually only charge it at night). On my laptop this would be a simple matter of editing an acpi script, but it appears that the tablet uses a different power management system, about which I have been able to find no useful information. So, does anyone here know if/how this can be done?

Thanks in advance.
 
Posts: 99 | Thanked: 65 times | Joined on Jan 2008 @ Finland
#2
You should receive a D-Bus message every time you connect and disconnect recharger.

Code:
signal sender=:1.2 -> dest=(null destination) path=/com/nokia/bme/signal; interface=com.nokia.bme.signal; member=charger_connected
signal sender=:1.2 -> dest=(null destination) path=/com/nokia/bme/signal; interface=com.nokia.bme.signal; member=charger_disconnected
 
Posts: 631 | Thanked: 837 times | Joined on May 2007 @ Milton, Ontario, Canada
#3
Just to add to that last post...

Knowing the DBUS information you should then be able to use something like Dbus-Scripts to launch mClock whenever the appropriate event occurs.

Thanks,
-Rob
 

The Following User Says Thank You to jolouis For This Useful Post:
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#4
I wanted to do this recently for the xscreensaver packages I put out.

What I did was take derf's acmonitor and remove the things I didn't want and add some system() calls to run a script that was ran when plugging in the charger and one that was ran when taking it out.

The source for the xscreensaver one I did is here:
http://qwerty12.maemobox.org/xscreen...or-0.1.tar.bz2

It shouldn't be hard to change the system calls in the script to programs that you want run. Just a note, programs are started as "nobody" by default so I have to use rootsh in the first script (sudo would be nice but my sudoers has user instead of ALL and I'm not going through it to change it) (rootsh is setuid) which then runs a second script as root (rootsh doesn't seem to be brilliant with arguments it seems). If I need to start a process as the tablet's default user, I just prefix the command I want run in the second script with "su - user".

Last edited by qwerty12; 2009-01-07 at 16:06.
 

The Following User Says Thank You to qwerty12 For This Useful Post:
Posts: 4 | Thanked: 1 time | Joined on Mar 2008
#5
I've actually just been playing with your xscreensaver packages. I think the ideal solution might be to get mClock or flipclock working as a xscreensaver hack. I'll try to take a look at that this weekend.
 
TrueJournals's Avatar
Posts: 480 | Thanked: 378 times | Joined on Apr 2008 @ Chicago-ish
#6
I'm actually slightly working on a program I've been calling pyacmonitor to help with this. It creates two directories, /etc/pyacmon.d/connected.d and /etc/pyacmon.d/disconnected.d, and sits in the background waiting for the power to be connected or disconnected. When the power is connected, it will run everything that is executable in connected.d. When the power is disconnected, it will run everything that is executable in disconnected.d. I've been playing around with getting it working well before releasing it, and I seem to almost be at that point... Just need to work out a few more kinks.

Watch the developers forum, I'll release it there first.
__________________
Disclaimer: If a program I wrote doesn't work/breaks your tablet... It's not my fault
mcedit | Utility Calculators (WIP) | PyRDesktop
My Blog | Twitter
 

The Following 2 Users Say Thank You to TrueJournals For This Useful Post:
Posts: 109 | Thanked: 91 times | Joined on Dec 2007
#7
Thanks for putting in the effort on this.

It sounds like a well-thought-out approach. I can't wait to play with it once it's released.

Could this be generalized to other dbus events? Specifically, I'm thinking of Wifi connectivity.
 
Posts: 631 | Thanked: 837 times | Joined on May 2007 @ Milton, Ontario, Canada
#8
Umm just curious, but what was wrong with dbus-scripts? Which does exactly what you guys are talking about...?
 
kondor's Avatar
Posts: 5 | Thanked: 11 times | Joined on Mar 2008 @ Russia
#9
Originally Posted by z2n View Post
Specifically, I'm thinking of Wifi connectivity.
It already exists . http://maemo.org/downloads/product/OS2008/conler/
__________________
Nokia N810 proud user

from Russia with the kind regards .
 

The Following User Says Thank You to kondor For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 22:15.