Active Topics

 


Poll: How useful is this post?
Poll Options
How useful is this post?

Reply
Thread Tools
Posts: 10 | Thanked: 8 times | Joined on Jul 2010 @ UK
#1
Hi everyone,

I have been trying for a while to find a way to schedule my IM accounts online/offline status in order to preserve battery, when not needed.

After some digging and reading, I compiled the information gathered from different threads and decided to post a summary of my findings into a post, which others may follow easily without having to dig around as I did.

So basically the idea is to have a script that will put your IM accounts to online and also to offline mode, so that you can schedule that script ( via Alarmed for example http://talk.maemo.org/showthread.php?p=558772 )

After reading about the mc-tool ( http://wiki.maemo.org/N900_Mission_C...ively_from_CLI ) and installing it : apt-get install Libmissioncontrol-Utils

I recompiled the following 2 scripts that would bring all IM accounts I am using to offline an after that to online mode.

Set IM accounts to offline:

Code:
#!/bin/sh
mc-tool list | grep "haze" | awk {'print "mc-tool request "$1" offline"'} | sh
mc-tool list | grep "gabble" | awk {'print "mc-tool request "$1" offline"'} | sh
mc-tool list | grep "spirit" | awk {'print "mc-tool request "$1" offline"'} | sh
Set IM accounts to online:

Code:
#!/bin/sh
mc-tool list | grep "haze" | awk {'print "mc-tool request "$1" online"'} | sh
mc-tool list | grep "gabble" | awk {'print "mc-tool request "$1" online"'} | sh
mc-tool list | grep "spirit" | awk {'print "mc-tool request "$1" online"'} | sh
Please, take a note that haze, gabble & spirit are just the plugins that handle a particular IM account ( as per mc-tool list command ) and not the actual IM accounts.

You are free to edit the above scripts as per your own requirements. The list of the plugins you are using for your IM accounts you can get via shell, typing: mc-tool list

Also, once you have created your offline.sh and online.sh files, remember to put them in some system directory ( mines are in /home/user/scripts ) and also set the mod of the files to executable ( I have done chmod 777 offline.sh and chmod 777 online.sh )
Then you can try your scripts by typing in shell: sh /home/user/scripts/offline.sh - this should bring all selected IM accounts to offline mode
sh /home/user/scripts/online.sh - this should bring all selected IM accounts to online mode.

In a conclusion, you can schedule the above 2 commands in Alarmed and set them to your prefered times.

Appologies if I have missed anything!

All credits go to:

http://talk.maemo.org/showthread.php?p=558772

http://wiki.maemo.org/N900_Mission_C...ively_from_CLI

http://maemo.org/packages/view/libmissioncontrol-utils/

http://maemo.org/packages/package_in...7-0maemo6+0m5/

Last edited by killian; 2013-10-31 at 13:28. Reason: spelling
 

The Following 7 Users Say Thank You to killian For This Useful Post:
Posts: 958 | Thanked: 483 times | Joined on May 2010
#2
been using a similar script for quite a while. 8:30am - logs into my work Lync account. 6pm - logs out

works wonders
 
Posts: 10 | Thanked: 8 times | Joined on Jul 2010 @ UK
#3
Originally Posted by droll View Post
been using a similar script for quite a while. 8:30am - logs into my work Lync account. 6pm - logs out

works wonders
Thanks droll,

The reason for my post is that I have been looking around for an application to do so and found nothing but just partial advises.
I might be wrong, but it would be nice if someone proficient would be able to compile an app to do these things in a more user friendly way.
I am just a noob.
 
Reply

Tags
im status


 
Forum Jump


All times are GMT. The time now is 18:38.