N900 Mission Control
(→Set all SIP accounts to online or offline) |
(→Set all SIP accounts to online or offline) |
||
Line 25: | Line 25: | ||
mc-tool list | grep "sofiasip" | awk {'print "mc-tool request "$1" offline"'} | sh | mc-tool list | grep "sofiasip" | awk {'print "mc-tool request "$1" offline"'} | sh | ||
</source> | </source> | ||
+ | |||
+ | ==== /usr/bin/im-connections | ||
+ | Simple script that will allow you to individually control each account (you must update the LIST variable with your actual accounts (get the names from "mc-tool list") - and update the menu accordingly. | ||
+ | |||
+ | <source lang="bash"> | ||
+ | #!/bin/sh | ||
+ | #Change status of IM accounts on N900 | ||
+ | LIST="haze/yahoo/your_account | ||
+ | haze/aim/your_account" | ||
+ | |||
+ | modify() { | ||
+ | ACCOUNT=$1 | ||
+ | STATE=$2 | ||
+ | echo -n "setting account to $STATE: " | ||
+ | /usr/bin/mc-tool request $ACCOUNT $STATE | ||
+ | if [ $? = 0 ]; then | ||
+ | echo "[OK]" | ||
+ | else | ||
+ | echo "[FAIL]" | ||
+ | exit 1 | ||
+ | fi | ||
+ | exit 0 | ||
+ | } | ||
+ | |||
+ | choose() { | ||
+ | ACCOUNT=$1 | ||
+ | echo "[1] online | ||
+ | [2] offline" | ||
+ | echo -n "select state: " | ||
+ | read STATE | ||
+ | if [ "$STATE" = "1" ]; then | ||
+ | modify $ACCOUNT "available" | ||
+ | elif [ "$STATE" = "2" ]; then | ||
+ | modify $ACCOUNT "offline" | ||
+ | else | ||
+ | echo "incorrect choice" | ||
+ | exit 1 | ||
+ | fi | ||
+ | } | ||
+ | |||
+ | echo "[1] your_account - yahooIM | ||
+ | [2] your_acount - AIM | ||
+ | [2] ALL ACCOUNTS - show status | ||
+ | [3] ALL ACCOUNTS - online | ||
+ | [4] ALL ACCOUNTS - offline" | ||
+ | |||
+ | echo -n "select account: " | ||
+ | read r | ||
+ | |||
+ | if [ "$r" = "1" ]; then | ||
+ | choose "haze/yahoo/your_account" | ||
+ | |||
+ | elif [ "$r" = "2" ]; then | ||
+ | choose "haze/aim/your_account" | ||
+ | |||
+ | elif [ "$r" = "2" ]; then | ||
+ | echo "showing status of all accounts" | ||
+ | for each in $LIST; do | ||
+ | /usr/bin/mc-tool show $each | ||
+ | done | ||
+ | |||
+ | elif [ "$r" = "3" ]; then | ||
+ | for each in $LIST; do | ||
+ | echo -n "setting '$each' to online: " | ||
+ | /usr/bin/mc-tool request $each available | ||
+ | if [ $? = 0 ]; then | ||
+ | echo "[OK]" | ||
+ | else | ||
+ | echo "[FAIL]" | ||
+ | fi | ||
+ | done | ||
+ | elif [ "$r" = "4" ]; then | ||
+ | for each in $LIST; do | ||
+ | echo -n "setting '$each' to offline: " | ||
+ | /usr/bin/mc-tool request $each offline | ||
+ | if [ $? = 0 ]; then | ||
+ | echo "[OK]" | ||
+ | else | ||
+ | echo "[FAIL]" | ||
+ | fi | ||
+ | done | ||
+ | fi |
Revision as of 22:02, 27 July 2010
Contents |
N900 Mission Control
This page aims to document the Mission Control interface on the Nokia N900, as several things have changed since earlier versions of Maemo and previous instructions for e.g. setting presence no longer work as expected.
It is actively a work in progress as of late July / early August 2010.
Accessing osso-mission-control
mc-tool
dbus
Example scripts
Set all SIP accounts to online or offline
Requires "libmissioncontrol-utils"
/usr/bin/siponline
#!/bin/sh mc-tool list | grep "sofiasip" | awk {'print "mc-tool request "$1" online"'} | sh
/usr/bin/sipoffline
#!/bin/sh mc-tool list | grep "sofiasip" | awk {'print "mc-tool request "$1" offline"'} | sh
==== /usr/bin/im-connections Simple script that will allow you to individually control each account (you must update the LIST variable with your actual accounts (get the names from "mc-tool list") - and update the menu accordingly.
#!/bin/sh #Change status of IM accounts on N900 LIST="haze/yahoo/your_account haze/aim/your_account" modify() { ACCOUNT=$1 STATE=$2 echo -n "setting account to $STATE: " /usr/bin/mc-tool request $ACCOUNT $STATE if [ $? = 0 ]; then echo "[OK]" else echo "[FAIL]" exit 1 fi exit 0 } choose() { ACCOUNT=$1 echo "[1] online [2] offline" echo -n "select state: " read STATE if [ "$STATE" = "1" ]; then modify $ACCOUNT "available" elif [ "$STATE" = "2" ]; then modify $ACCOUNT "offline" else echo "incorrect choice" exit 1 fi } echo "[1] your_account - yahooIM [2] your_acount - AIM [2] ALL ACCOUNTS - show status [3] ALL ACCOUNTS - online [4] ALL ACCOUNTS - offline" echo -n "select account: " read r if [ "$r" = "1" ]; then choose "haze/yahoo/your_account" elif [ "$r" = "2" ]; then choose "haze/aim/your_account" elif [ "$r" = "2" ]; then echo "showing status of all accounts" for each in $LIST; do /usr/bin/mc-tool show $each done elif [ "$r" = "3" ]; then for each in $LIST; do echo -n "setting '$each' to online: " /usr/bin/mc-tool request $each available if [ $? = 0 ]; then echo "[OK]" else echo "[FAIL]" fi done elif [ "$r" = "4" ]; then for each in $LIST; do echo -n "setting '$each' to offline: " /usr/bin/mc-tool request $each offline if [ $? = 0 ]; then echo "[OK]" else echo "[FAIL]" fi done fi