<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://maemo.octonezd.me/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=91.66.29.77</id>
	<title>Maemo Wiki Mirror - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://maemo.octonezd.me/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=91.66.29.77"/>
	<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php/Special:Contributions/91.66.29.77"/>
	<updated>2026-04-22T08:39:47Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=Desktop_Command_Execution_Widget_scripts&amp;diff=5629</id>
		<title>Desktop Command Execution Widget scripts</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=Desktop_Command_Execution_Widget_scripts&amp;diff=5629"/>
		<updated>2011-04-17T07:14:31Z</updated>

		<summary type="html">&lt;p&gt;91.66.29.77: /* Toggle vibrating alert */ minor changes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Desktop Command Execution widget is one of the most useful widgets on your Maemo desktop. It can be used to show certain information (for example battery level in percentage) or as a button which can be used for example to disconnect active internet connection (you need to tap 3 times and also wait for menus to appear without this widget). Therefore it can replace many other applications/widgets/applets and you can also make something new. Here you&#039;ll find a collection of scripts that can be added to the widget. The discussion about the widget is [http://talk.maemo.org/showthread.php?t=39177 on the forum].&lt;br /&gt;
&lt;br /&gt;
Scripts are also compatible with [[Queen BeeCon Widget]] which has extended graphic and cosmetic functionality, but is far more complicated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Making your own scripts==&lt;br /&gt;
&lt;br /&gt;
===Scripts without output===&lt;br /&gt;
&lt;br /&gt;
When there&#039;s no output (for example if you&#039;re using widget as a button and you use D-Bus call) the widget displays &amp;quot;Invalid Command&amp;quot;. This can be most easily avoided if you pipe echo &amp;quot;&amp;quot; at the end of the command. This is also usable if your script produces unwanted output (D-Bus reply for example).&lt;br /&gt;
&lt;br /&gt;
 dbus-send -options -moreoptions | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Collection of D-Bus calls can be found on [[Phone control]] wiki page. The basic principle for making a script for DCEW is the same as above (D-Bus command and piping an echo).&lt;br /&gt;
&lt;br /&gt;
===Scripts with long output===&lt;br /&gt;
&lt;br /&gt;
Some scripts may create multiple lines which are too long to be displayed on a single line. The widget will not wrap these. In order to wrap them you can use the fold command:&lt;br /&gt;
 &lt;br /&gt;
 command-that-produces-long-lines | fold -s -w 80&lt;br /&gt;
&lt;br /&gt;
The 80 in that instance is the maximum length of the line, which you can change. The -s option makes fold word wrap with spaces. More information is available from the [http://unixhelp.ed.ac.uk/CGI/man-cgi?fold fold man page].&lt;br /&gt;
&lt;br /&gt;
==Scripts to display information==&lt;br /&gt;
&lt;br /&gt;
===Battery===&lt;br /&gt;
&lt;br /&gt;
All battery scripts are collected here. Pick the one which suits your needs. Examples of the output values are under each one.&lt;br /&gt;
&lt;br /&gt;
There are 2 values for full battery capacity available. First one is design charge in mAh, which is always the same (1273 mAh). The second one is the one used in these scripts and it is the full charge from last charging. With displaying this one you can also monitor battery wear level.&lt;br /&gt;
&lt;br /&gt;
Battery percentage level is calculated using first value and is therefore less accurate, that&#039;s why you cannot achieve 100% full battery, but only about 95%. After some time the full percentage will be even lower.&lt;br /&gt;
&lt;br /&gt;
But last full charge value has one disadvantage. This is that after a reboot the phone forgets this value and the value returned is 0. It shows the proper value after next charging.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Percentage, current and last full charge====&lt;br /&gt;
&lt;br /&gt;
 hal-device bme | awk &#039;/l.p/ {perc = $3}; /g.c/ {curr = $3}; /g.la/ {last = $3}; /s_c/ {isch = $3} END if (isch == &amp;quot;false&amp;quot;) {print perc&amp;quot; % (&amp;quot;curr&amp;quot;/&amp;quot;last&amp;quot; mAh)&amp;quot;} else {print &amp;quot;Charging&amp;quot;}&#039;&lt;br /&gt;
&lt;br /&gt;
Output example: &#039;&#039;&#039;83 % (1000/1200 mAh)&#039;&#039;&#039;, when charging &#039;&#039;&#039;Charging&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Percentage and current charge====&lt;br /&gt;
&lt;br /&gt;
 hal-device bme | awk &#039;/l.p/ {perc = $3}; /g.c/ {curr = $3}; /s_c/ {isch = $3} END if (isch == &amp;quot;false&amp;quot;) {print perc&amp;quot; % (&amp;quot;curr&amp;quot; mAh)&amp;quot;} else {print &amp;quot;Charging&amp;quot;}&#039;&lt;br /&gt;
&lt;br /&gt;
Output example: &#039;&#039;&#039;83 % (1000 mAh)&#039;&#039;&#039;, when charging &#039;&#039;&#039;Charging&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Percentage====&lt;br /&gt;
&lt;br /&gt;
 hal-device bme | awk &#039;/l.p/ {perc = $3}; /s_c/ {isch = $3} END if (isch == &amp;quot;false&amp;quot;) {print perc&amp;quot; %&amp;quot;} else {print &amp;quot;Chrg&amp;quot;}&#039;&lt;br /&gt;
&lt;br /&gt;
Output example: &#039;&#039;&#039;83 %&#039;&#039;&#039;, when charging &#039;&#039;&#039;Chrg&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Current and last full charge====&lt;br /&gt;
&lt;br /&gt;
 hal-device bme | awk &#039;/g.c/ {curr = $3}; /g.la/ {last = $3} END {print curr&amp;quot;/&amp;quot;last&amp;quot; mAh&amp;quot;}&#039;&lt;br /&gt;
&lt;br /&gt;
Output example: &#039;&#039;&#039;1000/1200 mAh&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Current charge====&lt;br /&gt;
&lt;br /&gt;
 hal-device bme | awk &#039;/g.c/ {print $3&amp;quot; mAh&amp;quot;}&#039;&lt;br /&gt;
&lt;br /&gt;
Output example: &#039;&#039;&#039;1000 mAh&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Last full charge====&lt;br /&gt;
&lt;br /&gt;
 hal-device bme | awk &#039;/g.la/ {print $3&amp;quot; mAh&amp;quot;}&#039;&lt;br /&gt;
&lt;br /&gt;
Output example: &#039;&#039;&#039;1200 mAh&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===IP===&lt;br /&gt;
&lt;br /&gt;
Internal IPs are obtained from the ifconfig and external IPs are obtained from the internet, because gprs0 IP which you can get with ifconfig is often from private address range, because mobile operators like to use NAT.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====External (WAN) and internal (LAN)====&lt;br /&gt;
&lt;br /&gt;
 echo WAN IP: `wget -t 2 -T 3 -q -O - api.myiptest.com | awk -F &amp;quot;\&amp;quot;&amp;quot; &#039;{print $4}&#039;`; echo LAN IP: `/sbin/ifconfig wlan0 | awk -F &amp;quot;[: ]&amp;quot; &#039;/Bc/ {print $13}&#039;`&lt;br /&gt;
&lt;br /&gt;
Output example:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WAN IP: 1.2.3.4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;LAN IP: 192.168.1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 echo WAN IP: `wget -t 2 -T 3 -q -O - api.myiptest.com | awk -F &amp;quot;\&amp;quot;&amp;quot; &#039;{print $4 &amp;quot; (&amp;quot;$12&amp;quot; &amp;quot;toupper($28)&amp;quot;)&amp;quot;}&#039;`; echo LAN IP: `/sbin/ifconfig wlan0 | awk -F &amp;quot;[: ]&amp;quot; &#039;/Bc/ {print $13}&#039;`&lt;br /&gt;
&lt;br /&gt;
Output example:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WAN IP: 1.2.3.4 (ISP CountryCode)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;LAN IP: 192.168.1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 echo WAN IP: `wget -t 2 -T 3 -q -O - api.myiptest.com | awk -F &amp;quot;\&amp;quot;&amp;quot; &#039;{print $4&amp;quot; (&amp;quot;$12&amp;quot; @ &amp;quot;$20&amp;quot;, &amp;quot;toupper($28)&amp;quot;)&amp;quot;}&#039;`; echo LAN IP: `/sbin/ifconfig wlan0 | awk -F &amp;quot;[: ]&amp;quot; &#039;/Bc/ {print $13}&#039;`&lt;br /&gt;
&lt;br /&gt;
Output example:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WAN IP: 1.2.3.4 (ISP @ City, CountryCode)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;LAN IP: 192.168.1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====External (WAN)====&lt;br /&gt;
&lt;br /&gt;
 wget -t 2 -T 3 -q -O - api.myiptest.com | awk -F &amp;quot;\&amp;quot;&amp;quot; &#039;{print $4}&#039;&lt;br /&gt;
&lt;br /&gt;
Output example: &#039;&#039;&#039;1.2.3.4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 wget -t 2 -T 3 -q -O - api.myiptest.com | awk -F &amp;quot;\&amp;quot;&amp;quot; &#039;{print $4 &amp;quot; (&amp;quot;$12&amp;quot; &amp;quot;toupper($28)&amp;quot;)&amp;quot;}&#039;&lt;br /&gt;
&lt;br /&gt;
Output example: &#039;&#039;&#039;1.2.3.4 (ISP CountryCode)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 wget -t 2 -T 3 -q -O - api.myiptest.com | awk -F &amp;quot;\&amp;quot;&amp;quot; &#039;{print $4&amp;quot; (&amp;quot;$12&amp;quot; @ &amp;quot;$20&amp;quot;, &amp;quot;toupper($28)&amp;quot;)&amp;quot;}&#039;&lt;br /&gt;
&lt;br /&gt;
Output example: &#039;&#039;&#039;1.2.3.4 (ISP @ City, CountryCode)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Internal (LAN)====&lt;br /&gt;
&lt;br /&gt;
 /sbin/ifconfig wlan0 | awk -F &amp;quot;[: ]&amp;quot; &#039;/Bc/ {print $13}&#039;&lt;br /&gt;
&lt;br /&gt;
This one displays only wlan0 IP (used for SSH, WinSCP, VNC... in LAN).&lt;br /&gt;
&lt;br /&gt;
===Disk usage===&lt;br /&gt;
&lt;br /&gt;
====rootfs (256MB /) percentage used====&lt;br /&gt;
&lt;br /&gt;
 df | awk &#039;$1 == &amp;quot;rootfs&amp;quot; {print $5}&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====rootfs (256MB /) free space====&lt;br /&gt;
&lt;br /&gt;
 df -h | awk &#039;$1 == &amp;quot;rootfs&amp;quot; {print $4}&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Internal memory for user data (27GB /home/user/MyDocs) percentage used====&lt;br /&gt;
&lt;br /&gt;
 df /home/user/MyDocs | awk &#039;/My/ {print $5}&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Internal memory for user data (27GB /home/user/MyDocs) free space====&lt;br /&gt;
&lt;br /&gt;
 df -h /home/user/MyDocs | awk &#039;/My/ {print $4}&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Internal memory for application data (2GB /home) percentage used====&lt;br /&gt;
&lt;br /&gt;
 df /home | awk &#039;/ho/ {print $5}&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Internal memory for application data (2GB /home) free space====&lt;br /&gt;
&lt;br /&gt;
 df -h /home | awk &#039;/ho/ {print $4}&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Memory card (/media/mmc1) percentage used====&lt;br /&gt;
&lt;br /&gt;
 df /media/mmc1 | awk &#039;/mm/ {print $5}&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Memory card (/media/mmc1) free space====&lt;br /&gt;
&lt;br /&gt;
 df -h /media/mmc1 | awk &#039;/mm/ {print $4}&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Cellular signal===&lt;br /&gt;
&lt;br /&gt;
====Quality====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --print-reply --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.get_signal_strength | awk &#039;NR==2 {print $2&amp;quot; %&amp;quot;}&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Strength====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --print-reply --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.get_signal_strength | awk &#039;NR==3 {print &amp;quot;-&amp;quot;$2&amp;quot; dBm&amp;quot;}&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Wi-Fi signal===&lt;br /&gt;
&lt;br /&gt;
====Quality====&lt;br /&gt;
&lt;br /&gt;
 awk -F &amp;quot;[. ]&amp;quot; &#039;/0/ {print $6&amp;quot; %&amp;quot;}&#039; /proc/net/wireless&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====RSSI====&lt;br /&gt;
&lt;br /&gt;
 awk &#039;/0/ {print $4&amp;quot; dBm&amp;quot;}&#039; /proc/net/wireless&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Noise====&lt;br /&gt;
&lt;br /&gt;
 awk -F &amp;quot;[. ]&amp;quot; &#039;/0/ {print $12&amp;quot; dBm&amp;quot;}&#039; /proc/net/wireless&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===CPU frequency===&lt;br /&gt;
&lt;br /&gt;
 awk &#039;{print $1/1000&amp;quot; MHz&amp;quot;}&#039; /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq&lt;br /&gt;
&lt;br /&gt;
====Usage of each frequency====&lt;br /&gt;
&lt;br /&gt;
 awk -v var=$(awk &#039;{sum+=$2}; END {print sum};&#039; /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state) &#039;{arr[$3]=$2}{for (i in arr) {print $1/1000 &amp;quot; mhz &amp;quot; int(arr[i]*100/var)&amp;quot;%&amp;quot;}}&#039; /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state&lt;br /&gt;
&lt;br /&gt;
===Memory usage===&lt;br /&gt;
&lt;br /&gt;
====RAM used====&lt;br /&gt;
&lt;br /&gt;
 awk &#039;/mT/ {memttl = $2}; /mF/ {memfre = $2}; /Bu/ {membff = $2}; $1 == &amp;quot;Cached:&amp;quot; {memcch = $2} END {printf (&amp;quot;%.1f MB\n&amp;quot;,(memttl-memfre-membff-memcch)/1024)}&#039; /proc/meminfo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====RAM free====&lt;br /&gt;
&lt;br /&gt;
 awk &#039;/mF/ {memfre = $2}; /Bu/ {membff = $2}; $1 == &amp;quot;Cached:&amp;quot; {memcch = $2} END {printf (&amp;quot;%.1f MB\n&amp;quot;,(memfre+membff+memcch)/1024)}&#039; /proc/meminfo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Swap used====&lt;br /&gt;
&lt;br /&gt;
 awk &#039;/pT/ {swpttl = $2}; /pF/ {swpfre = $2} END {printf (&amp;quot;%.1f MB\n&amp;quot;,(swpttl-swpfre)/1024)}&#039; /proc/meminfo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Swap free====&lt;br /&gt;
&lt;br /&gt;
 awk &#039;/pF/ {printf (&amp;quot;%.1f MB\n&amp;quot;,$2/1024)}&#039; /proc/meminfo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Total memory used====&lt;br /&gt;
&lt;br /&gt;
 awk &#039;/mT/ {memttl = $2}; /mF/ {memfre = $2}; /Bu/ {membff = $2}; $1 == &amp;quot;Cached:&amp;quot; {memcch = $2}; /pT/ {swpttl = $2}; /pF/ {swpfre = $2} END {printf (&amp;quot;%.1f MB\n&amp;quot;,(memttl+swpttl-memfre-membff-memcch-swpfre)/1024)}&#039; /proc/meminfo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Total memory free====&lt;br /&gt;
&lt;br /&gt;
 awk &#039;/mF/ {memfre = $2}; /Bu/ {membff = $2}; $1 == &amp;quot;Cached:&amp;quot; {memcch = $2}; /pF/ {swpfre = $2} END {printf (&amp;quot;%.1f MB\n&amp;quot;,(memfre+membff+memcch+swpfre)/1024)}&#039; /proc/meminfo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===GPRS data usage===&lt;br /&gt;
&lt;br /&gt;
You can use this with scheduled reset of the GPRS data counter to display data usage for current month. Additional info can be found on [[fcron]] wiki page.&lt;br /&gt;
&lt;br /&gt;
These scripts are now compatibile with PR1.2 (separate home and roaming counter), which means they won&#039;t work on previous versions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Home counter (combined)====&lt;br /&gt;
&lt;br /&gt;
 echo `gconftool-2 -g /system/osso/connectivity/network_type/GPRS/gprs_home_rx_bytes` `gconftool-2 -g /system/osso/connectivity/network_type/GPRS/gprs_home_tx_bytes` | awk &#039;{printf (&amp;quot;%.1f MB\n&amp;quot;,($1+$2)/1048576)}&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Home counter (separated)====&lt;br /&gt;
&lt;br /&gt;
 echo `gconftool-2 -g /system/osso/connectivity/network_type/GPRS/gprs_home_rx_bytes | awk &#039;{printf (&amp;quot;Download: %.1f MB\n&amp;quot;,$1/1048576)}&#039;`; echo `gconftool-2 -g /system/osso/connectivity/network_type/GPRS/gprs_home_tx_bytes | awk &#039;{printf (&amp;quot;Upload: %.1f MB\n&amp;quot;,$1/1048576)}&#039;`&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Roaming counter (combined)====&lt;br /&gt;
&lt;br /&gt;
 echo `gconftool-2 -g /system/osso/connectivity/network_type/GPRS/gprs_roaming_rx_bytes` `gconftool-2 -g /system/osso/connectivity/network_type/GPRS/gprs_roaming_tx_bytes` | awk &#039;{printf (&amp;quot;%.1f MB\n&amp;quot;,($1+$2)/1048576)}&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Roaming counter (separated)====&lt;br /&gt;
&lt;br /&gt;
 echo `gconftool-2 -g /system/osso/connectivity/network_type/GPRS/gprs_roaming_rx_bytes | awk &#039;{printf (&amp;quot;Download: %.1f MB\n&amp;quot;,$1/1048576)}&#039;`; echo `gconftool-2 -g /system/osso/connectivity/network_type/GPRS/gprs_roaming_tx_bytes | awk &#039;{printf (&amp;quot;Upload: %.1f MB\n&amp;quot;,$1/1048576)}&#039;`&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Time and date===&lt;br /&gt;
&lt;br /&gt;
====Date====&lt;br /&gt;
&lt;br /&gt;
 date +&amp;quot;%a, %-d.%-m.%Y&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This command will show the date in format (for example) &#039;&#039;&#039;Tue, 4.5.2010&#039;&#039;&#039;. You can define your own format (between the quotation marks). Possible options are described on [http://unixhelp.ed.ac.uk/CGI/man-cgi?date manpage].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Time in different timezones====&lt;br /&gt;
 &lt;br /&gt;
 export TZ=&amp;quot;Europe/London&amp;quot;; date +%R&lt;br /&gt;
&lt;br /&gt;
This one shows two timezones in format &#039;&#039;London: 13:04 | Denver: 06:04&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;London:&amp;quot; `export TZ=&amp;quot;Europe/London&amp;quot;; date +%R` &amp;quot;| Denver:&amp;quot; `export TZ=&amp;quot;America/Denver&amp;quot;; date +%R`&lt;br /&gt;
&lt;br /&gt;
London and Denver are taken as an example. TZ values can be found on [[:wikipedia:List_of_tz_database_time_zones|Wikipedia]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Uptime and load===&lt;br /&gt;
&lt;br /&gt;
These scripts are formatproof meaning that they display what they&#039;re supposed to no matter what format is command &amp;quot;uptime&amp;quot; outputting. Not all scripts found are like that, because &amp;quot;uptime&amp;quot; command is a little bit complicated for scripted text processing. For example when the system is running under one hour only &amp;quot;x min&amp;quot; is shown, when it is running under one day &amp;quot;hour:min:sec&amp;quot; is shown and after that it is shown in format &amp;quot;x days, hour:min:sec&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Both====&lt;br /&gt;
&lt;br /&gt;
 uptime | sed -e &#039;s/.*up */uptime: /&#039; -e &#039;s/ average//&#039; -e &#039;s/  / /&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Uptime====&lt;br /&gt;
&lt;br /&gt;
 uptime | sed -e &#039;s/.*p *//&#039; -e &#039;s/, l.*//&#039; -e &#039;s/  / /&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Load====&lt;br /&gt;
&lt;br /&gt;
 uptime | sed &#039;s/.*e: //&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Boot reason===&lt;br /&gt;
&lt;br /&gt;
 cat /proc/bootreason&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Boot count===&lt;br /&gt;
&lt;br /&gt;
 cat /var/lib/dsme/boot_count&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Temperature===&lt;br /&gt;
&lt;br /&gt;
CPU&#039;s thermal sensors are not accessible, but there is one near the battery. This commands displays output of its readings, but IT IS NOT RELIABLE, because it doesn&#039;t always work. Sometimes the value returned is wrong or constant. It needs to be tested further.&lt;br /&gt;
&lt;br /&gt;
 cat /sys/devices/platform/omap34xx_temp/temp1_input | awk &#039;{ sub(/-/,&amp;quot;&amp;quot;); print $1&amp;quot; °C&amp;quot;}&#039;&lt;br /&gt;
&lt;br /&gt;
There is a working way now to read the correct temperature, but it is working only on a newer titan&#039;s kernels (normal, overclock, undervoltage). The bq27x00_battery module has to be loaded first.&lt;br /&gt;
&lt;br /&gt;
 echo `cat /sys/class/power_supply/bq27200-0/temp` °C&lt;br /&gt;
&lt;br /&gt;
===Top processes===&lt;br /&gt;
&lt;br /&gt;
This script displays top &#039;&#039;N&#039;&#039; CPU consuming processes. It excludes top itself, which is quite processor intensive so you probably don&#039;t want this updating too often. Modify &#039;&#039;N=3&#039;&#039; at the start to display different number of processes.&lt;br /&gt;
&lt;br /&gt;
 N=3; top -bn 1 | grep -v top | head -n $(($N+4)) | tail -n $(($N+1)) | awk &#039;{OFS = &amp;quot;\t&amp;quot;} {print $7,$8}&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Random Number Generator===&lt;br /&gt;
&lt;br /&gt;
This script displays a random number between 0 and &#039;&#039;M&#039;&#039; (&#039;&#039;M&#039;&#039; included)&lt;br /&gt;
&lt;br /&gt;
 M=6; dd if=/dev/urandom bs=1 count=4 2&amp;gt;/dev/null | od -l | awk -v M=$M &#039;{M++;print $2&amp;lt;0?-$2%M:$2%M;exit}&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Ping a Host===&lt;br /&gt;
Preferred method. Install netcat from [http://wiki.maemo.org/Documentation/devtools/maemo5#Installation]&lt;br /&gt;
&lt;br /&gt;
 if (nc -zw1 192.168.2.1 80);then echo up;else echo down;fi&lt;br /&gt;
&lt;br /&gt;
Alternate method. Ping has a long timeout when down. Warning: it will block the desktop while running.&lt;br /&gt;
&lt;br /&gt;
 if (echo &#039;ping -c1 192.168.2.1&#039; | rootsh /bin/sh  2&amp;gt;&amp;amp;1 &amp;gt;/dev/null);then echo up;else echo down;fi&lt;br /&gt;
&lt;br /&gt;
==Scripts for buttons==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure that update policy for button widgets is set only to &amp;quot;update when clicked&amp;quot;. &amp;quot;Update when switched to desktop&amp;quot;, &amp;quot;update interval&amp;quot; and &amp;quot;network presence&amp;quot; should be disabled to avoid automatic actions. Also keep in mind that widgets are executed at every boot so they can for example automatically disable Wi-Fi when phone boots.&lt;br /&gt;
&lt;br /&gt;
There is a bug in version 0.9 or lower which prevents you from using DCEW widgets as buttons, because they get activated (pressed) automatically all the time. You have to make sure DCEW is at least version 1.0, to check which version you have installed do this: dpkg -l desktop-cmd-exec.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Networking===&lt;br /&gt;
&lt;br /&gt;
====Connect/disconnect====&lt;br /&gt;
&lt;br /&gt;
 sh /path/conn-disconn.sh | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;conn-disconn.sh&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 if [ `/sbin/route | awk &#039;/au/ {print $1}&#039;` = default ]; then&lt;br /&gt;
 dbus-send --system --dest=com.nokia.icd /com/nokia/icd_ui com.nokia.icd_ui.disconnect boolean:true&lt;br /&gt;
 else&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.icd /com/nokia/icd com.nokia.icd.connect string:&amp;quot;[ANY]&amp;quot; uint32:0&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Connect internet (show connections)====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.icd_ui /com/nokia/icd_ui com.nokia.icd_ui.show_conn_dlg boolean:false | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Connect to any saved connection====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.icd /com/nokia/icd com.nokia.icd.connect string:&amp;quot;[ANY]&amp;quot; uint32:0 | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Disconnect internet====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --dest=com.nokia.icd /com/nokia/icd_ui com.nokia.icd_ui.disconnect boolean:true | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Enable/disable Wi-Fi====&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;/path/to/script/wifi.sh&amp;quot; | sudo gainroot | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;wifi.sh script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 out=`ifconfig wlan0`&lt;br /&gt;
 if [ $? -eq &amp;quot;0&amp;quot; ] ; then&lt;br /&gt;
 if [ `echo &amp;quot;$out&amp;quot; | grep -c RUNNING` -gt &amp;quot;0&amp;quot; ] ; then&lt;br /&gt;
 run-standalone.sh dbus-send --system --dest=com.nokia.icd /com/nokia/icd_ui com.nokia.icd_ui.disconnect boolean:true&lt;br /&gt;
 fi&lt;br /&gt;
 ifconfig wlan0 down&lt;br /&gt;
 rmmod wl12xx&lt;br /&gt;
 run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:&#039;Wi-Fi disabled&#039;&lt;br /&gt;
 exit 2&lt;br /&gt;
 else&lt;br /&gt;
 modprobe wl12xx&lt;br /&gt;
 wl1251-cal&lt;br /&gt;
 stop wlancond&lt;br /&gt;
 start wlancond&lt;br /&gt;
 ifconfig wlan0 up&lt;br /&gt;
 run-standalone.sh dbus-send --system --type=method_call --dest=com.nokia.icd_ui /com/nokia/icd_ui com.nokia.icd_ui.show_conn_dlg boolean:false&lt;br /&gt;
 exit 0&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget to make it executable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Wake On Lan====&lt;br /&gt;
 &lt;br /&gt;
 /path/to/script/wol.py | echo &amp;quot;&amp;quot;&lt;br /&gt;
wol.py script;&lt;br /&gt;
&lt;br /&gt;
 #! /usr/bin/python&lt;br /&gt;
 # Wake-On-LAN&lt;br /&gt;
 # Change ip range in the &amp;quot;s.sendto(msg&amp;quot; line &lt;br /&gt;
 # and the MAC of the pc to wakeup in the bottom line&lt;br /&gt;
 import struct, socket&lt;br /&gt;
 def WakeOnLan(ethernet_address):&lt;br /&gt;
  # Construct a six-byte hardware address&lt;br /&gt;
  addr_byte = ethernet_address.split(&#039;:&#039;)&lt;br /&gt;
  hw_addr = struct.pack(&#039;BBBBBB&#039;, int(addr_byte[0], 16),&lt;br /&gt;
    int(addr_byte[1], 16),&lt;br /&gt;
    int(addr_byte[2], 16),&lt;br /&gt;
    int(addr_byte[3], 16),&lt;br /&gt;
    int(addr_byte[4], 16),&lt;br /&gt;
    int(addr_byte[5], 16))&lt;br /&gt;
  # Build the Wake-On-LAN &amp;quot;Magic Packet&amp;quot;...&lt;br /&gt;
  msg = &#039;\xff&#039; * 6 + hw_addr * 16&lt;br /&gt;
  # ...and send it to the broadcast address using UDP&lt;br /&gt;
  s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)&lt;br /&gt;
  s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)&lt;br /&gt;
  s.sendto(msg, (&#039;192.168.1.255&#039;, 9))&lt;br /&gt;
  s.close()&lt;br /&gt;
 # Example use&lt;br /&gt;
 WakeOnLan(&#039;00:13:21:00:62:AE&#039;)&lt;br /&gt;
Don&#039;t forget to Chmod 755 wol.py&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Disconnect mobile network====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.phone.SSC /com/nokia/phone/SSC com.nokia.phone.SSC.set_radio boolean:false | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Connect mobile network====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.phone.SSC /com/nokia/phone/SSC com.nokia.phone.SSC.set_radio boolean:true | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Lock screen and keys===&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_tklock_mode_change string:&amp;quot;locked&amp;quot; | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Radio mode===&lt;br /&gt;
&lt;br /&gt;
====2G/3G====&lt;br /&gt;
&lt;br /&gt;
 sh /path/to/script/2g3g.sh | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2g3g.sh script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 if [ `dbus-send --system --type=method_call --print-reply --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.get_selected_radio_access_technology | awk &#039;/b/ {print $2}&#039;` -eq 1 ]; then&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.set_selected_radio_access_technology byte:2&lt;br /&gt;
 else&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.set_selected_radio_access_technology byte:1&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
When 3G or Dual mode is active, the script will switch to 2G. And when 2G is active, it will switch to 3G.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget to make the script executable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====2G====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.set_selected_radio_access_technology byte:1 | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====3G====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.set_selected_radio_access_technology byte:2 | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Dual====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.set_selected_radio_access_technology byte:0 | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Bluetooth===&lt;br /&gt;
&lt;br /&gt;
====Enable====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez / org.bluez.Manager.ListAdapters | awk -F &amp;quot;\&amp;quot;&amp;quot; &#039;/at/ {print $2}&#039;) org.bluez.Adapter.SetProperty string:Powered variant:boolean:true | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Disable====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez / org.bluez.Manager.ListAdapters | awk -F &amp;quot;\&amp;quot;&amp;quot; &#039;/at/ {print $2}&#039;) org.bluez.Adapter.SetProperty string:Powered variant:boolean:false | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Profiles===&lt;br /&gt;
&lt;br /&gt;
====General====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --type=method_call --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.set_profile string:&amp;quot;general&amp;quot; | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Silent====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --type=method_call --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.set_profile string:&amp;quot;silent&amp;quot; | echo&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Toggle vibrating alert====&lt;br /&gt;
&lt;br /&gt;
There are far more things you can do with your profile. Please have a look at the [[Phone_control#Get_all_profile_Values|profile values at the phone control page]]. This example disables vibrating alert for the active profile.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 # Which profile is active?&lt;br /&gt;
 if \&lt;br /&gt;
 dbus-send --print-reply --type=method_call \&lt;br /&gt;
 --dest=com.nokia.profiled /com/nokia/profiled \&lt;br /&gt;
 com.nokia.profiled.get_profile | grep -q general&lt;br /&gt;
 then&lt;br /&gt;
 	# general profile is active&lt;br /&gt;
 	dbus-send --type=method_call \&lt;br /&gt;
 	--dest=com.nokia.profiled /com/nokia/profiled \&lt;br /&gt;
 	com.nokia.profiled.set_value string:&amp;quot;general&amp;quot; \&lt;br /&gt;
 	string:&amp;quot;vibrating.alert.enabled&amp;quot; string:&amp;quot;Off&amp;quot;&lt;br /&gt;
 else&lt;br /&gt;
 	# silent profile is active&lt;br /&gt;
 	dbus-send --type=method_call \&lt;br /&gt;
 	--dest=com.nokia.profiled /com/nokia/profiled \&lt;br /&gt;
 	com.nokia.profiled.set_value string:&amp;quot;silent&amp;quot; \&lt;br /&gt;
 	string:&amp;quot;vibrating.alert.enabled&amp;quot; string:&amp;quot;Off&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
You get the opposite behaviour (enable vibrating alert) simply by replacing &amp;quot;Off&amp;quot; two times by &amp;quot;On&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Lock (secure) the device===&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.system_ui /com/nokia/system_ui/request com.nokia.system_ui.request.devlock_open string:&amp;quot;com.nokia.mce&amp;quot; string:&amp;quot;/com/nokia/mce/request&amp;quot; string:&amp;quot;com.nokia.mce.request&amp;quot; string:&amp;quot;devlock_callback&amp;quot; uint32:&#039;3&#039; | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Update e-mail===&lt;br /&gt;
&lt;br /&gt;
 sh /path/to/script/email.sh | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;email.sh script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The script connects to the internet and refreshes e-mail. Keep in mind that Modest e-mail client which N900 uses is very slow in this aspect and send and recive can take up to minute and a half. Make it executable.&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:&amp;quot;Updating e-mail...&amp;quot;&lt;br /&gt;
 run-standalone.sh dbus-send --system --type=method_call --dest=com.nokia.icd /com/nokia/icd com.nokia.icd.connect string:&amp;quot;[ANY]&amp;quot; uint32:0&lt;br /&gt;
 sleep 10&lt;br /&gt;
 run-standalone.sh dbus-send --type=method_call --dest=com.nokia.modest /com/nokia/modest com.nokia.modest.SendReceive&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Set maximum CPU frequency===&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;echo 600000 &amp;gt; /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq&amp;quot; | sudo gainroot | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Replace 600000 with desired maximum frequency. This is usable with the new overclocking kernels if you wish to manually change the maximum frequency to which processor can scale. Pay attention to the two exceptions in titan&#039;s kernels (124999 and 599000). The list of available frequencies on your device/kernel can be obtained with command:&lt;br /&gt;
&lt;br /&gt;
 awk &#039;{print $1/1000&amp;quot; MHz&amp;quot;}&#039; /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Reboot===&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;reboot&amp;quot; | sudo gainroot | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Warning: Consult forums before you try this, because currently DCEW executes some (all?) commands at startup. This will be optional in next version. Making a reboot button on current DCEW version could result in endless reboot loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===FM transmitter===&lt;br /&gt;
&lt;br /&gt;
====Enable/disable====&lt;br /&gt;
&lt;br /&gt;
 /usr/bin/fmtx_client -p$(if [ $(cut -d. -f1 /proc/uptime ) -lt 100 ]; then echo 0; else /usr/bin/fmtx_client | /bin/grep -q &#039;^state=enabled&#039; ; echo $? ; fi) | /usr/bin/awk -F &amp;quot;=&amp;quot; &#039;($1==&amp;quot;state&amp;quot;) {print $2}&#039;&lt;br /&gt;
&lt;br /&gt;
Note: when you reboot the device, this script waits 100 seconds before you can turn the transmitter on/off again.&lt;br /&gt;
&lt;br /&gt;
====Increase power====&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;echo 118 &amp;gt; /sys/class/i2c-adapter/i2c-2/2-0063/power_level&amp;quot; | sudo gainroot | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===DBUS call to start browser===&lt;br /&gt;
&lt;br /&gt;
 /usr/bin/browser_dbuscmd.sh load_url http://www.bbc.co.uk/iplayer/console/bbc_radio_fourfm&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Power users]]&lt;br /&gt;
&lt;br /&gt;
===Display a Conboy Note===&lt;br /&gt;
 python /home/user/conboy_note_to_text.py print noteid&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;conboy_note_to_text.py&#039;&#039;&#039;&lt;br /&gt;
Looks like the author removed the script from his site, google cached copy: [http://webcache.googleusercontent.com/search?q=cache:M1zKXdYI4LwJ:khertan.net/articles/conboy_note_to_text+conboy_note_to_text.py]. Make sure to make this python script executable (chmod 755 /path/to/conboy_note_to_text.py). To list all notes with their title and id in xterm, just use the following commands: python /home/user/conboy_note_to_text.py list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 #!/usr/lib/python2.5&lt;br /&gt;
 &lt;br /&gt;
 from xml.dom import minidom&lt;br /&gt;
 import os.path&lt;br /&gt;
 import glob&lt;br /&gt;
 import sys&lt;br /&gt;
 import re&lt;br /&gt;
 from xml.sax.handler import ContentHandler&lt;br /&gt;
 import xml.sax&lt;br /&gt;
 &lt;br /&gt;
 class NoteList:&lt;br /&gt;
    def __init__(self,path):&lt;br /&gt;
        self.path = path&lt;br /&gt;
        self.noteList = {}&lt;br /&gt;
        for infile in glob.glob( os.path.join(self.path, &#039;*.note&#039;) ):&lt;br /&gt;
          note = Reader(os.path.basename(infile)[:-5])&lt;br /&gt;
          if note.title != None:&lt;br /&gt;
              self.noteList[note.title]=note.note_id&lt;br /&gt;
 &lt;br /&gt;
    def get_note_id_by_title(self,title):&lt;br /&gt;
        try:&lt;br /&gt;
            return self.noteList[title]&lt;br /&gt;
        except:&lt;br /&gt;
            return None&lt;br /&gt;
 &lt;br /&gt;
 class textHandler(ContentHandler):&lt;br /&gt;
    def __init__(self):&lt;br /&gt;
      ContentHandler.__init__(self)&lt;br /&gt;
      self.content = &amp;quot;&amp;quot;&lt;br /&gt;
      self.title = &amp;quot;&amp;quot;&lt;br /&gt;
      self.selector = None&lt;br /&gt;
 &lt;br /&gt;
    def startElement(self, element,attributes):&lt;br /&gt;
        if (element == &#039;note-content&#039;) and (self.selector == None):&lt;br /&gt;
            self.selector = element&lt;br /&gt;
        elif (element == &#039;title&#039;) and (self.selector == None):&lt;br /&gt;
            self.selector = element&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
    def endElement(self, element):&lt;br /&gt;
        if (element == self.selector):&lt;br /&gt;
            self.selector = None&lt;br /&gt;
 &lt;br /&gt;
    def characters(self, ch):&lt;br /&gt;
        if self.selector == &#039;note-content&#039;:&lt;br /&gt;
            self.content = self.content + unicode(ch)&lt;br /&gt;
        elif self.selector == &#039;title&#039;:&lt;br /&gt;
            self.title = self.title + unicode(ch)&lt;br /&gt;
 &lt;br /&gt;
 class Reader:&lt;br /&gt;
    def __init__(self,note_id):&lt;br /&gt;
        self.note_id = note_id&lt;br /&gt;
        self.content = None&lt;br /&gt;
        self.title = None&lt;br /&gt;
 &lt;br /&gt;
        try:&lt;br /&gt;
            parser = xml.sax.make_parser()&lt;br /&gt;
            handler = textHandler()&lt;br /&gt;
            parser.setContentHandler(handler)&lt;br /&gt;
              parser.parse(os.path.join(os.path.expanduser(&amp;quot;~&amp;quot;),&#039;.conboy&#039;,self.note_id+&#039;.note&#039;))&lt;br /&gt;
            self.content = handler.content&lt;br /&gt;
            self.title = handler.title &lt;br /&gt;
        except StandardError,e:&lt;br /&gt;
            print e&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
    try:&lt;br /&gt;
        if (sys.argv[1]==&#039;print&#039;):&lt;br /&gt;
            print Reader(unicode(sys.argv[2])).content&lt;br /&gt;
        elif (sys.argv[1]==&#039;list&#039;):&lt;br /&gt;
            nlist = NoteList(&#039;/home/user/.conboy/&#039;).noteList&lt;br /&gt;
            for key in nlist.keys():&lt;br /&gt;
                print key, &#039; : &#039;, nlist[key]&lt;br /&gt;
        elif (sys.argv[1]==&#039;search&#039;):&lt;br /&gt;
            nlist = NoteList(&#039;/home/user/.conboy/&#039;)&lt;br /&gt;
            print nlist.get_note_id_by_title(sys.argv[2])&lt;br /&gt;
        else:&lt;br /&gt;
            raise&lt;br /&gt;
    except StandardError,e:&lt;br /&gt;
            print &amp;quot;&amp;quot;&amp;quot;Usage : python conboy_note_reader.py option [note_id or note title]&lt;br /&gt;
            Option : &lt;br /&gt;
                - list : list all note by title with id&lt;br /&gt;
                - print : print content of note with the given id&lt;br /&gt;
                - search : print id of the given title&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
            print e&lt;/div&gt;</summary>
		<author><name>91.66.29.77</name></author>
	</entry>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=Desktop_Command_Execution_Widget_scripts&amp;diff=5630</id>
		<title>Desktop Command Execution Widget scripts</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=Desktop_Command_Execution_Widget_scripts&amp;diff=5630"/>
		<updated>2011-04-17T07:07:58Z</updated>

		<summary type="html">&lt;p&gt;91.66.29.77: Added vibration toggling for profiles&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Desktop Command Execution widget is one of the most useful widgets on your Maemo desktop. It can be used to show certain information (for example battery level in percentage) or as a button which can be used for example to disconnect active internet connection (you need to tap 3 times and also wait for menus to appear without this widget). Therefore it can replace many other applications/widgets/applets and you can also make something new. Here you&#039;ll find a collection of scripts that can be added to the widget. The discussion about the widget is [http://talk.maemo.org/showthread.php?t=39177 on the forum].&lt;br /&gt;
&lt;br /&gt;
Scripts are also compatible with [[Queen BeeCon Widget]] which has extended graphic and cosmetic functionality, but is far more complicated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Making your own scripts==&lt;br /&gt;
&lt;br /&gt;
===Scripts without output===&lt;br /&gt;
&lt;br /&gt;
When there&#039;s no output (for example if you&#039;re using widget as a button and you use D-Bus call) the widget displays &amp;quot;Invalid Command&amp;quot;. This can be most easily avoided if you pipe echo &amp;quot;&amp;quot; at the end of the command. This is also usable if your script produces unwanted output (D-Bus reply for example).&lt;br /&gt;
&lt;br /&gt;
 dbus-send -options -moreoptions | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Collection of D-Bus calls can be found on [[Phone control]] wiki page. The basic principle for making a script for DCEW is the same as above (D-Bus command and piping an echo).&lt;br /&gt;
&lt;br /&gt;
===Scripts with long output===&lt;br /&gt;
&lt;br /&gt;
Some scripts may create multiple lines which are too long to be displayed on a single line. The widget will not wrap these. In order to wrap them you can use the fold command:&lt;br /&gt;
 &lt;br /&gt;
 command-that-produces-long-lines | fold -s -w 80&lt;br /&gt;
&lt;br /&gt;
The 80 in that instance is the maximum length of the line, which you can change. The -s option makes fold word wrap with spaces. More information is available from the [http://unixhelp.ed.ac.uk/CGI/man-cgi?fold fold man page].&lt;br /&gt;
&lt;br /&gt;
==Scripts to display information==&lt;br /&gt;
&lt;br /&gt;
===Battery===&lt;br /&gt;
&lt;br /&gt;
All battery scripts are collected here. Pick the one which suits your needs. Examples of the output values are under each one.&lt;br /&gt;
&lt;br /&gt;
There are 2 values for full battery capacity available. First one is design charge in mAh, which is always the same (1273 mAh). The second one is the one used in these scripts and it is the full charge from last charging. With displaying this one you can also monitor battery wear level.&lt;br /&gt;
&lt;br /&gt;
Battery percentage level is calculated using first value and is therefore less accurate, that&#039;s why you cannot achieve 100% full battery, but only about 95%. After some time the full percentage will be even lower.&lt;br /&gt;
&lt;br /&gt;
But last full charge value has one disadvantage. This is that after a reboot the phone forgets this value and the value returned is 0. It shows the proper value after next charging.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Percentage, current and last full charge====&lt;br /&gt;
&lt;br /&gt;
 hal-device bme | awk &#039;/l.p/ {perc = $3}; /g.c/ {curr = $3}; /g.la/ {last = $3}; /s_c/ {isch = $3} END if (isch == &amp;quot;false&amp;quot;) {print perc&amp;quot; % (&amp;quot;curr&amp;quot;/&amp;quot;last&amp;quot; mAh)&amp;quot;} else {print &amp;quot;Charging&amp;quot;}&#039;&lt;br /&gt;
&lt;br /&gt;
Output example: &#039;&#039;&#039;83 % (1000/1200 mAh)&#039;&#039;&#039;, when charging &#039;&#039;&#039;Charging&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Percentage and current charge====&lt;br /&gt;
&lt;br /&gt;
 hal-device bme | awk &#039;/l.p/ {perc = $3}; /g.c/ {curr = $3}; /s_c/ {isch = $3} END if (isch == &amp;quot;false&amp;quot;) {print perc&amp;quot; % (&amp;quot;curr&amp;quot; mAh)&amp;quot;} else {print &amp;quot;Charging&amp;quot;}&#039;&lt;br /&gt;
&lt;br /&gt;
Output example: &#039;&#039;&#039;83 % (1000 mAh)&#039;&#039;&#039;, when charging &#039;&#039;&#039;Charging&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Percentage====&lt;br /&gt;
&lt;br /&gt;
 hal-device bme | awk &#039;/l.p/ {perc = $3}; /s_c/ {isch = $3} END if (isch == &amp;quot;false&amp;quot;) {print perc&amp;quot; %&amp;quot;} else {print &amp;quot;Chrg&amp;quot;}&#039;&lt;br /&gt;
&lt;br /&gt;
Output example: &#039;&#039;&#039;83 %&#039;&#039;&#039;, when charging &#039;&#039;&#039;Chrg&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Current and last full charge====&lt;br /&gt;
&lt;br /&gt;
 hal-device bme | awk &#039;/g.c/ {curr = $3}; /g.la/ {last = $3} END {print curr&amp;quot;/&amp;quot;last&amp;quot; mAh&amp;quot;}&#039;&lt;br /&gt;
&lt;br /&gt;
Output example: &#039;&#039;&#039;1000/1200 mAh&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Current charge====&lt;br /&gt;
&lt;br /&gt;
 hal-device bme | awk &#039;/g.c/ {print $3&amp;quot; mAh&amp;quot;}&#039;&lt;br /&gt;
&lt;br /&gt;
Output example: &#039;&#039;&#039;1000 mAh&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Last full charge====&lt;br /&gt;
&lt;br /&gt;
 hal-device bme | awk &#039;/g.la/ {print $3&amp;quot; mAh&amp;quot;}&#039;&lt;br /&gt;
&lt;br /&gt;
Output example: &#039;&#039;&#039;1200 mAh&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===IP===&lt;br /&gt;
&lt;br /&gt;
Internal IPs are obtained from the ifconfig and external IPs are obtained from the internet, because gprs0 IP which you can get with ifconfig is often from private address range, because mobile operators like to use NAT.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====External (WAN) and internal (LAN)====&lt;br /&gt;
&lt;br /&gt;
 echo WAN IP: `wget -t 2 -T 3 -q -O - api.myiptest.com | awk -F &amp;quot;\&amp;quot;&amp;quot; &#039;{print $4}&#039;`; echo LAN IP: `/sbin/ifconfig wlan0 | awk -F &amp;quot;[: ]&amp;quot; &#039;/Bc/ {print $13}&#039;`&lt;br /&gt;
&lt;br /&gt;
Output example:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WAN IP: 1.2.3.4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;LAN IP: 192.168.1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 echo WAN IP: `wget -t 2 -T 3 -q -O - api.myiptest.com | awk -F &amp;quot;\&amp;quot;&amp;quot; &#039;{print $4 &amp;quot; (&amp;quot;$12&amp;quot; &amp;quot;toupper($28)&amp;quot;)&amp;quot;}&#039;`; echo LAN IP: `/sbin/ifconfig wlan0 | awk -F &amp;quot;[: ]&amp;quot; &#039;/Bc/ {print $13}&#039;`&lt;br /&gt;
&lt;br /&gt;
Output example:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WAN IP: 1.2.3.4 (ISP CountryCode)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;LAN IP: 192.168.1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 echo WAN IP: `wget -t 2 -T 3 -q -O - api.myiptest.com | awk -F &amp;quot;\&amp;quot;&amp;quot; &#039;{print $4&amp;quot; (&amp;quot;$12&amp;quot; @ &amp;quot;$20&amp;quot;, &amp;quot;toupper($28)&amp;quot;)&amp;quot;}&#039;`; echo LAN IP: `/sbin/ifconfig wlan0 | awk -F &amp;quot;[: ]&amp;quot; &#039;/Bc/ {print $13}&#039;`&lt;br /&gt;
&lt;br /&gt;
Output example:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WAN IP: 1.2.3.4 (ISP @ City, CountryCode)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;LAN IP: 192.168.1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====External (WAN)====&lt;br /&gt;
&lt;br /&gt;
 wget -t 2 -T 3 -q -O - api.myiptest.com | awk -F &amp;quot;\&amp;quot;&amp;quot; &#039;{print $4}&#039;&lt;br /&gt;
&lt;br /&gt;
Output example: &#039;&#039;&#039;1.2.3.4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 wget -t 2 -T 3 -q -O - api.myiptest.com | awk -F &amp;quot;\&amp;quot;&amp;quot; &#039;{print $4 &amp;quot; (&amp;quot;$12&amp;quot; &amp;quot;toupper($28)&amp;quot;)&amp;quot;}&#039;&lt;br /&gt;
&lt;br /&gt;
Output example: &#039;&#039;&#039;1.2.3.4 (ISP CountryCode)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 wget -t 2 -T 3 -q -O - api.myiptest.com | awk -F &amp;quot;\&amp;quot;&amp;quot; &#039;{print $4&amp;quot; (&amp;quot;$12&amp;quot; @ &amp;quot;$20&amp;quot;, &amp;quot;toupper($28)&amp;quot;)&amp;quot;}&#039;&lt;br /&gt;
&lt;br /&gt;
Output example: &#039;&#039;&#039;1.2.3.4 (ISP @ City, CountryCode)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Internal (LAN)====&lt;br /&gt;
&lt;br /&gt;
 /sbin/ifconfig wlan0 | awk -F &amp;quot;[: ]&amp;quot; &#039;/Bc/ {print $13}&#039;&lt;br /&gt;
&lt;br /&gt;
This one displays only wlan0 IP (used for SSH, WinSCP, VNC... in LAN).&lt;br /&gt;
&lt;br /&gt;
===Disk usage===&lt;br /&gt;
&lt;br /&gt;
====rootfs (256MB /) percentage used====&lt;br /&gt;
&lt;br /&gt;
 df | awk &#039;$1 == &amp;quot;rootfs&amp;quot; {print $5}&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====rootfs (256MB /) free space====&lt;br /&gt;
&lt;br /&gt;
 df -h | awk &#039;$1 == &amp;quot;rootfs&amp;quot; {print $4}&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Internal memory for user data (27GB /home/user/MyDocs) percentage used====&lt;br /&gt;
&lt;br /&gt;
 df /home/user/MyDocs | awk &#039;/My/ {print $5}&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Internal memory for user data (27GB /home/user/MyDocs) free space====&lt;br /&gt;
&lt;br /&gt;
 df -h /home/user/MyDocs | awk &#039;/My/ {print $4}&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Internal memory for application data (2GB /home) percentage used====&lt;br /&gt;
&lt;br /&gt;
 df /home | awk &#039;/ho/ {print $5}&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Internal memory for application data (2GB /home) free space====&lt;br /&gt;
&lt;br /&gt;
 df -h /home | awk &#039;/ho/ {print $4}&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Memory card (/media/mmc1) percentage used====&lt;br /&gt;
&lt;br /&gt;
 df /media/mmc1 | awk &#039;/mm/ {print $5}&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Memory card (/media/mmc1) free space====&lt;br /&gt;
&lt;br /&gt;
 df -h /media/mmc1 | awk &#039;/mm/ {print $4}&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Cellular signal===&lt;br /&gt;
&lt;br /&gt;
====Quality====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --print-reply --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.get_signal_strength | awk &#039;NR==2 {print $2&amp;quot; %&amp;quot;}&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Strength====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --print-reply --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.get_signal_strength | awk &#039;NR==3 {print &amp;quot;-&amp;quot;$2&amp;quot; dBm&amp;quot;}&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Wi-Fi signal===&lt;br /&gt;
&lt;br /&gt;
====Quality====&lt;br /&gt;
&lt;br /&gt;
 awk -F &amp;quot;[. ]&amp;quot; &#039;/0/ {print $6&amp;quot; %&amp;quot;}&#039; /proc/net/wireless&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====RSSI====&lt;br /&gt;
&lt;br /&gt;
 awk &#039;/0/ {print $4&amp;quot; dBm&amp;quot;}&#039; /proc/net/wireless&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Noise====&lt;br /&gt;
&lt;br /&gt;
 awk -F &amp;quot;[. ]&amp;quot; &#039;/0/ {print $12&amp;quot; dBm&amp;quot;}&#039; /proc/net/wireless&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===CPU frequency===&lt;br /&gt;
&lt;br /&gt;
 awk &#039;{print $1/1000&amp;quot; MHz&amp;quot;}&#039; /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq&lt;br /&gt;
&lt;br /&gt;
====Usage of each frequency====&lt;br /&gt;
&lt;br /&gt;
 awk -v var=$(awk &#039;{sum+=$2}; END {print sum};&#039; /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state) &#039;{arr[$3]=$2}{for (i in arr) {print $1/1000 &amp;quot; mhz &amp;quot; int(arr[i]*100/var)&amp;quot;%&amp;quot;}}&#039; /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state&lt;br /&gt;
&lt;br /&gt;
===Memory usage===&lt;br /&gt;
&lt;br /&gt;
====RAM used====&lt;br /&gt;
&lt;br /&gt;
 awk &#039;/mT/ {memttl = $2}; /mF/ {memfre = $2}; /Bu/ {membff = $2}; $1 == &amp;quot;Cached:&amp;quot; {memcch = $2} END {printf (&amp;quot;%.1f MB\n&amp;quot;,(memttl-memfre-membff-memcch)/1024)}&#039; /proc/meminfo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====RAM free====&lt;br /&gt;
&lt;br /&gt;
 awk &#039;/mF/ {memfre = $2}; /Bu/ {membff = $2}; $1 == &amp;quot;Cached:&amp;quot; {memcch = $2} END {printf (&amp;quot;%.1f MB\n&amp;quot;,(memfre+membff+memcch)/1024)}&#039; /proc/meminfo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Swap used====&lt;br /&gt;
&lt;br /&gt;
 awk &#039;/pT/ {swpttl = $2}; /pF/ {swpfre = $2} END {printf (&amp;quot;%.1f MB\n&amp;quot;,(swpttl-swpfre)/1024)}&#039; /proc/meminfo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Swap free====&lt;br /&gt;
&lt;br /&gt;
 awk &#039;/pF/ {printf (&amp;quot;%.1f MB\n&amp;quot;,$2/1024)}&#039; /proc/meminfo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Total memory used====&lt;br /&gt;
&lt;br /&gt;
 awk &#039;/mT/ {memttl = $2}; /mF/ {memfre = $2}; /Bu/ {membff = $2}; $1 == &amp;quot;Cached:&amp;quot; {memcch = $2}; /pT/ {swpttl = $2}; /pF/ {swpfre = $2} END {printf (&amp;quot;%.1f MB\n&amp;quot;,(memttl+swpttl-memfre-membff-memcch-swpfre)/1024)}&#039; /proc/meminfo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Total memory free====&lt;br /&gt;
&lt;br /&gt;
 awk &#039;/mF/ {memfre = $2}; /Bu/ {membff = $2}; $1 == &amp;quot;Cached:&amp;quot; {memcch = $2}; /pF/ {swpfre = $2} END {printf (&amp;quot;%.1f MB\n&amp;quot;,(memfre+membff+memcch+swpfre)/1024)}&#039; /proc/meminfo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===GPRS data usage===&lt;br /&gt;
&lt;br /&gt;
You can use this with scheduled reset of the GPRS data counter to display data usage for current month. Additional info can be found on [[fcron]] wiki page.&lt;br /&gt;
&lt;br /&gt;
These scripts are now compatibile with PR1.2 (separate home and roaming counter), which means they won&#039;t work on previous versions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Home counter (combined)====&lt;br /&gt;
&lt;br /&gt;
 echo `gconftool-2 -g /system/osso/connectivity/network_type/GPRS/gprs_home_rx_bytes` `gconftool-2 -g /system/osso/connectivity/network_type/GPRS/gprs_home_tx_bytes` | awk &#039;{printf (&amp;quot;%.1f MB\n&amp;quot;,($1+$2)/1048576)}&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Home counter (separated)====&lt;br /&gt;
&lt;br /&gt;
 echo `gconftool-2 -g /system/osso/connectivity/network_type/GPRS/gprs_home_rx_bytes | awk &#039;{printf (&amp;quot;Download: %.1f MB\n&amp;quot;,$1/1048576)}&#039;`; echo `gconftool-2 -g /system/osso/connectivity/network_type/GPRS/gprs_home_tx_bytes | awk &#039;{printf (&amp;quot;Upload: %.1f MB\n&amp;quot;,$1/1048576)}&#039;`&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Roaming counter (combined)====&lt;br /&gt;
&lt;br /&gt;
 echo `gconftool-2 -g /system/osso/connectivity/network_type/GPRS/gprs_roaming_rx_bytes` `gconftool-2 -g /system/osso/connectivity/network_type/GPRS/gprs_roaming_tx_bytes` | awk &#039;{printf (&amp;quot;%.1f MB\n&amp;quot;,($1+$2)/1048576)}&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Roaming counter (separated)====&lt;br /&gt;
&lt;br /&gt;
 echo `gconftool-2 -g /system/osso/connectivity/network_type/GPRS/gprs_roaming_rx_bytes | awk &#039;{printf (&amp;quot;Download: %.1f MB\n&amp;quot;,$1/1048576)}&#039;`; echo `gconftool-2 -g /system/osso/connectivity/network_type/GPRS/gprs_roaming_tx_bytes | awk &#039;{printf (&amp;quot;Upload: %.1f MB\n&amp;quot;,$1/1048576)}&#039;`&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Time and date===&lt;br /&gt;
&lt;br /&gt;
====Date====&lt;br /&gt;
&lt;br /&gt;
 date +&amp;quot;%a, %-d.%-m.%Y&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This command will show the date in format (for example) &#039;&#039;&#039;Tue, 4.5.2010&#039;&#039;&#039;. You can define your own format (between the quotation marks). Possible options are described on [http://unixhelp.ed.ac.uk/CGI/man-cgi?date manpage].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Time in different timezones====&lt;br /&gt;
 &lt;br /&gt;
 export TZ=&amp;quot;Europe/London&amp;quot;; date +%R&lt;br /&gt;
&lt;br /&gt;
This one shows two timezones in format &#039;&#039;London: 13:04 | Denver: 06:04&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;London:&amp;quot; `export TZ=&amp;quot;Europe/London&amp;quot;; date +%R` &amp;quot;| Denver:&amp;quot; `export TZ=&amp;quot;America/Denver&amp;quot;; date +%R`&lt;br /&gt;
&lt;br /&gt;
London and Denver are taken as an example. TZ values can be found on [[:wikipedia:List_of_tz_database_time_zones|Wikipedia]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Uptime and load===&lt;br /&gt;
&lt;br /&gt;
These scripts are formatproof meaning that they display what they&#039;re supposed to no matter what format is command &amp;quot;uptime&amp;quot; outputting. Not all scripts found are like that, because &amp;quot;uptime&amp;quot; command is a little bit complicated for scripted text processing. For example when the system is running under one hour only &amp;quot;x min&amp;quot; is shown, when it is running under one day &amp;quot;hour:min:sec&amp;quot; is shown and after that it is shown in format &amp;quot;x days, hour:min:sec&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Both====&lt;br /&gt;
&lt;br /&gt;
 uptime | sed -e &#039;s/.*up */uptime: /&#039; -e &#039;s/ average//&#039; -e &#039;s/  / /&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Uptime====&lt;br /&gt;
&lt;br /&gt;
 uptime | sed -e &#039;s/.*p *//&#039; -e &#039;s/, l.*//&#039; -e &#039;s/  / /&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Load====&lt;br /&gt;
&lt;br /&gt;
 uptime | sed &#039;s/.*e: //&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Boot reason===&lt;br /&gt;
&lt;br /&gt;
 cat /proc/bootreason&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Boot count===&lt;br /&gt;
&lt;br /&gt;
 cat /var/lib/dsme/boot_count&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Temperature===&lt;br /&gt;
&lt;br /&gt;
CPU&#039;s thermal sensors are not accessible, but there is one near the battery. This commands displays output of its readings, but IT IS NOT RELIABLE, because it doesn&#039;t always work. Sometimes the value returned is wrong or constant. It needs to be tested further.&lt;br /&gt;
&lt;br /&gt;
 cat /sys/devices/platform/omap34xx_temp/temp1_input | awk &#039;{ sub(/-/,&amp;quot;&amp;quot;); print $1&amp;quot; °C&amp;quot;}&#039;&lt;br /&gt;
&lt;br /&gt;
There is a working way now to read the correct temperature, but it is working only on a newer titan&#039;s kernels (normal, overclock, undervoltage). The bq27x00_battery module has to be loaded first.&lt;br /&gt;
&lt;br /&gt;
 echo `cat /sys/class/power_supply/bq27200-0/temp` °C&lt;br /&gt;
&lt;br /&gt;
===Top processes===&lt;br /&gt;
&lt;br /&gt;
This script displays top &#039;&#039;N&#039;&#039; CPU consuming processes. It excludes top itself, which is quite processor intensive so you probably don&#039;t want this updating too often. Modify &#039;&#039;N=3&#039;&#039; at the start to display different number of processes.&lt;br /&gt;
&lt;br /&gt;
 N=3; top -bn 1 | grep -v top | head -n $(($N+4)) | tail -n $(($N+1)) | awk &#039;{OFS = &amp;quot;\t&amp;quot;} {print $7,$8}&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Random Number Generator===&lt;br /&gt;
&lt;br /&gt;
This script displays a random number between 0 and &#039;&#039;M&#039;&#039; (&#039;&#039;M&#039;&#039; included)&lt;br /&gt;
&lt;br /&gt;
 M=6; dd if=/dev/urandom bs=1 count=4 2&amp;gt;/dev/null | od -l | awk -v M=$M &#039;{M++;print $2&amp;lt;0?-$2%M:$2%M;exit}&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Ping a Host===&lt;br /&gt;
Preferred method. Install netcat from [http://wiki.maemo.org/Documentation/devtools/maemo5#Installation]&lt;br /&gt;
&lt;br /&gt;
 if (nc -zw1 192.168.2.1 80);then echo up;else echo down;fi&lt;br /&gt;
&lt;br /&gt;
Alternate method. Ping has a long timeout when down. Warning: it will block the desktop while running.&lt;br /&gt;
&lt;br /&gt;
 if (echo &#039;ping -c1 192.168.2.1&#039; | rootsh /bin/sh  2&amp;gt;&amp;amp;1 &amp;gt;/dev/null);then echo up;else echo down;fi&lt;br /&gt;
&lt;br /&gt;
==Scripts for buttons==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure that update policy for button widgets is set only to &amp;quot;update when clicked&amp;quot;. &amp;quot;Update when switched to desktop&amp;quot;, &amp;quot;update interval&amp;quot; and &amp;quot;network presence&amp;quot; should be disabled to avoid automatic actions. Also keep in mind that widgets are executed at every boot so they can for example automatically disable Wi-Fi when phone boots.&lt;br /&gt;
&lt;br /&gt;
There is a bug in version 0.9 or lower which prevents you from using DCEW widgets as buttons, because they get activated (pressed) automatically all the time. You have to make sure DCEW is at least version 1.0, to check which version you have installed do this: dpkg -l desktop-cmd-exec.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Networking===&lt;br /&gt;
&lt;br /&gt;
====Connect/disconnect====&lt;br /&gt;
&lt;br /&gt;
 sh /path/conn-disconn.sh | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;conn-disconn.sh&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 if [ `/sbin/route | awk &#039;/au/ {print $1}&#039;` = default ]; then&lt;br /&gt;
 dbus-send --system --dest=com.nokia.icd /com/nokia/icd_ui com.nokia.icd_ui.disconnect boolean:true&lt;br /&gt;
 else&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.icd /com/nokia/icd com.nokia.icd.connect string:&amp;quot;[ANY]&amp;quot; uint32:0&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Connect internet (show connections)====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.icd_ui /com/nokia/icd_ui com.nokia.icd_ui.show_conn_dlg boolean:false | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Connect to any saved connection====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.icd /com/nokia/icd com.nokia.icd.connect string:&amp;quot;[ANY]&amp;quot; uint32:0 | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Disconnect internet====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --dest=com.nokia.icd /com/nokia/icd_ui com.nokia.icd_ui.disconnect boolean:true | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Enable/disable Wi-Fi====&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;/path/to/script/wifi.sh&amp;quot; | sudo gainroot | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;wifi.sh script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 out=`ifconfig wlan0`&lt;br /&gt;
 if [ $? -eq &amp;quot;0&amp;quot; ] ; then&lt;br /&gt;
 if [ `echo &amp;quot;$out&amp;quot; | grep -c RUNNING` -gt &amp;quot;0&amp;quot; ] ; then&lt;br /&gt;
 run-standalone.sh dbus-send --system --dest=com.nokia.icd /com/nokia/icd_ui com.nokia.icd_ui.disconnect boolean:true&lt;br /&gt;
 fi&lt;br /&gt;
 ifconfig wlan0 down&lt;br /&gt;
 rmmod wl12xx&lt;br /&gt;
 run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:&#039;Wi-Fi disabled&#039;&lt;br /&gt;
 exit 2&lt;br /&gt;
 else&lt;br /&gt;
 modprobe wl12xx&lt;br /&gt;
 wl1251-cal&lt;br /&gt;
 stop wlancond&lt;br /&gt;
 start wlancond&lt;br /&gt;
 ifconfig wlan0 up&lt;br /&gt;
 run-standalone.sh dbus-send --system --type=method_call --dest=com.nokia.icd_ui /com/nokia/icd_ui com.nokia.icd_ui.show_conn_dlg boolean:false&lt;br /&gt;
 exit 0&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget to make it executable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Wake On Lan====&lt;br /&gt;
 &lt;br /&gt;
 /path/to/script/wol.py | echo &amp;quot;&amp;quot;&lt;br /&gt;
wol.py script;&lt;br /&gt;
&lt;br /&gt;
 #! /usr/bin/python&lt;br /&gt;
 # Wake-On-LAN&lt;br /&gt;
 # Change ip range in the &amp;quot;s.sendto(msg&amp;quot; line &lt;br /&gt;
 # and the MAC of the pc to wakeup in the bottom line&lt;br /&gt;
 import struct, socket&lt;br /&gt;
 def WakeOnLan(ethernet_address):&lt;br /&gt;
  # Construct a six-byte hardware address&lt;br /&gt;
  addr_byte = ethernet_address.split(&#039;:&#039;)&lt;br /&gt;
  hw_addr = struct.pack(&#039;BBBBBB&#039;, int(addr_byte[0], 16),&lt;br /&gt;
    int(addr_byte[1], 16),&lt;br /&gt;
    int(addr_byte[2], 16),&lt;br /&gt;
    int(addr_byte[3], 16),&lt;br /&gt;
    int(addr_byte[4], 16),&lt;br /&gt;
    int(addr_byte[5], 16))&lt;br /&gt;
  # Build the Wake-On-LAN &amp;quot;Magic Packet&amp;quot;...&lt;br /&gt;
  msg = &#039;\xff&#039; * 6 + hw_addr * 16&lt;br /&gt;
  # ...and send it to the broadcast address using UDP&lt;br /&gt;
  s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)&lt;br /&gt;
  s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)&lt;br /&gt;
  s.sendto(msg, (&#039;192.168.1.255&#039;, 9))&lt;br /&gt;
  s.close()&lt;br /&gt;
 # Example use&lt;br /&gt;
 WakeOnLan(&#039;00:13:21:00:62:AE&#039;)&lt;br /&gt;
Don&#039;t forget to Chmod 755 wol.py&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Disconnect mobile network====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.phone.SSC /com/nokia/phone/SSC com.nokia.phone.SSC.set_radio boolean:false | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Connect mobile network====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.phone.SSC /com/nokia/phone/SSC com.nokia.phone.SSC.set_radio boolean:true | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Lock screen and keys===&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_tklock_mode_change string:&amp;quot;locked&amp;quot; | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Radio mode===&lt;br /&gt;
&lt;br /&gt;
====2G/3G====&lt;br /&gt;
&lt;br /&gt;
 sh /path/to/script/2g3g.sh | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2g3g.sh script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 if [ `dbus-send --system --type=method_call --print-reply --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.get_selected_radio_access_technology | awk &#039;/b/ {print $2}&#039;` -eq 1 ]; then&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.set_selected_radio_access_technology byte:2&lt;br /&gt;
 else&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.set_selected_radio_access_technology byte:1&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
When 3G or Dual mode is active, the script will switch to 2G. And when 2G is active, it will switch to 3G.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget to make the script executable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====2G====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.set_selected_radio_access_technology byte:1 | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====3G====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.set_selected_radio_access_technology byte:2 | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Dual====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.set_selected_radio_access_technology byte:0 | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Bluetooth===&lt;br /&gt;
&lt;br /&gt;
====Enable====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez / org.bluez.Manager.ListAdapters | awk -F &amp;quot;\&amp;quot;&amp;quot; &#039;/at/ {print $2}&#039;) org.bluez.Adapter.SetProperty string:Powered variant:boolean:true | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Disable====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez / org.bluez.Manager.ListAdapters | awk -F &amp;quot;\&amp;quot;&amp;quot; &#039;/at/ {print $2}&#039;) org.bluez.Adapter.SetProperty string:Powered variant:boolean:false | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Profiles===&lt;br /&gt;
&lt;br /&gt;
====General====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --type=method_call --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.set_profile string:&amp;quot;general&amp;quot; | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Silent====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --type=method_call --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.set_profile string:&amp;quot;silent&amp;quot; | echo&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Toggle vibrating alert for active profile to &amp;quot;off&amp;quot;====&lt;br /&gt;
&lt;br /&gt;
There are far more things you can do with your profile. Please have a look at the [[Phone_control#Get_all_profile_Values|profile values at the phone control page]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 # Which profile is active?&lt;br /&gt;
 if \&lt;br /&gt;
 dbus-send --print-reply --type=method_call \&lt;br /&gt;
 --dest=com.nokia.profiled /com/nokia/profiled \&lt;br /&gt;
 com.nokia.profiled.get_profile | grep -q general&lt;br /&gt;
 then&lt;br /&gt;
 	# general profile is active&lt;br /&gt;
 	dbus-send --type=method_call \&lt;br /&gt;
 	--dest=com.nokia.profiled /com/nokia/profiled \&lt;br /&gt;
 	com.nokia.profiled.set_value string:&amp;quot;general&amp;quot; \&lt;br /&gt;
 	string:&amp;quot;vibrating.alert.enabled&amp;quot; string:&amp;quot;Off&amp;quot;&lt;br /&gt;
 else&lt;br /&gt;
 	# silent profile is active&lt;br /&gt;
 	dbus-send --type=method_call \&lt;br /&gt;
 	--dest=com.nokia.profiled /com/nokia/profiled \&lt;br /&gt;
 	com.nokia.profiled.set_value string:&amp;quot;silent&amp;quot; \&lt;br /&gt;
 	string:&amp;quot;vibrating.alert.enabled&amp;quot; string:&amp;quot;Off&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
If you want to toggle it back on, simply replace &amp;quot;Off&amp;quot; two times by &amp;quot;On&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Lock (secure) the device===&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.system_ui /com/nokia/system_ui/request com.nokia.system_ui.request.devlock_open string:&amp;quot;com.nokia.mce&amp;quot; string:&amp;quot;/com/nokia/mce/request&amp;quot; string:&amp;quot;com.nokia.mce.request&amp;quot; string:&amp;quot;devlock_callback&amp;quot; uint32:&#039;3&#039; | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Update e-mail===&lt;br /&gt;
&lt;br /&gt;
 sh /path/to/script/email.sh | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;email.sh script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The script connects to the internet and refreshes e-mail. Keep in mind that Modest e-mail client which N900 uses is very slow in this aspect and send and recive can take up to minute and a half. Make it executable.&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:&amp;quot;Updating e-mail...&amp;quot;&lt;br /&gt;
 run-standalone.sh dbus-send --system --type=method_call --dest=com.nokia.icd /com/nokia/icd com.nokia.icd.connect string:&amp;quot;[ANY]&amp;quot; uint32:0&lt;br /&gt;
 sleep 10&lt;br /&gt;
 run-standalone.sh dbus-send --type=method_call --dest=com.nokia.modest /com/nokia/modest com.nokia.modest.SendReceive&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Set maximum CPU frequency===&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;echo 600000 &amp;gt; /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq&amp;quot; | sudo gainroot | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Replace 600000 with desired maximum frequency. This is usable with the new overclocking kernels if you wish to manually change the maximum frequency to which processor can scale. Pay attention to the two exceptions in titan&#039;s kernels (124999 and 599000). The list of available frequencies on your device/kernel can be obtained with command:&lt;br /&gt;
&lt;br /&gt;
 awk &#039;{print $1/1000&amp;quot; MHz&amp;quot;}&#039; /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Reboot===&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;reboot&amp;quot; | sudo gainroot | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Warning: Consult forums before you try this, because currently DCEW executes some (all?) commands at startup. This will be optional in next version. Making a reboot button on current DCEW version could result in endless reboot loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===FM transmitter===&lt;br /&gt;
&lt;br /&gt;
====Enable/disable====&lt;br /&gt;
&lt;br /&gt;
 /usr/bin/fmtx_client -p$(if [ $(cut -d. -f1 /proc/uptime ) -lt 100 ]; then echo 0; else /usr/bin/fmtx_client | /bin/grep -q &#039;^state=enabled&#039; ; echo $? ; fi) | /usr/bin/awk -F &amp;quot;=&amp;quot; &#039;($1==&amp;quot;state&amp;quot;) {print $2}&#039;&lt;br /&gt;
&lt;br /&gt;
Note: when you reboot the device, this script waits 100 seconds before you can turn the transmitter on/off again.&lt;br /&gt;
&lt;br /&gt;
====Increase power====&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;echo 118 &amp;gt; /sys/class/i2c-adapter/i2c-2/2-0063/power_level&amp;quot; | sudo gainroot | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===DBUS call to start browser===&lt;br /&gt;
&lt;br /&gt;
 /usr/bin/browser_dbuscmd.sh load_url http://www.bbc.co.uk/iplayer/console/bbc_radio_fourfm&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Power users]]&lt;br /&gt;
&lt;br /&gt;
===Display a Conboy Note===&lt;br /&gt;
 python /home/user/conboy_note_to_text.py print noteid&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;conboy_note_to_text.py&#039;&#039;&#039;&lt;br /&gt;
Looks like the author removed the script from his site, google cached copy: [http://webcache.googleusercontent.com/search?q=cache:M1zKXdYI4LwJ:khertan.net/articles/conboy_note_to_text+conboy_note_to_text.py]. Make sure to make this python script executable (chmod 755 /path/to/conboy_note_to_text.py). To list all notes with their title and id in xterm, just use the following commands: python /home/user/conboy_note_to_text.py list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 #!/usr/lib/python2.5&lt;br /&gt;
 &lt;br /&gt;
 from xml.dom import minidom&lt;br /&gt;
 import os.path&lt;br /&gt;
 import glob&lt;br /&gt;
 import sys&lt;br /&gt;
 import re&lt;br /&gt;
 from xml.sax.handler import ContentHandler&lt;br /&gt;
 import xml.sax&lt;br /&gt;
 &lt;br /&gt;
 class NoteList:&lt;br /&gt;
    def __init__(self,path):&lt;br /&gt;
        self.path = path&lt;br /&gt;
        self.noteList = {}&lt;br /&gt;
        for infile in glob.glob( os.path.join(self.path, &#039;*.note&#039;) ):&lt;br /&gt;
          note = Reader(os.path.basename(infile)[:-5])&lt;br /&gt;
          if note.title != None:&lt;br /&gt;
              self.noteList[note.title]=note.note_id&lt;br /&gt;
 &lt;br /&gt;
    def get_note_id_by_title(self,title):&lt;br /&gt;
        try:&lt;br /&gt;
            return self.noteList[title]&lt;br /&gt;
        except:&lt;br /&gt;
            return None&lt;br /&gt;
 &lt;br /&gt;
 class textHandler(ContentHandler):&lt;br /&gt;
    def __init__(self):&lt;br /&gt;
      ContentHandler.__init__(self)&lt;br /&gt;
      self.content = &amp;quot;&amp;quot;&lt;br /&gt;
      self.title = &amp;quot;&amp;quot;&lt;br /&gt;
      self.selector = None&lt;br /&gt;
 &lt;br /&gt;
    def startElement(self, element,attributes):&lt;br /&gt;
        if (element == &#039;note-content&#039;) and (self.selector == None):&lt;br /&gt;
            self.selector = element&lt;br /&gt;
        elif (element == &#039;title&#039;) and (self.selector == None):&lt;br /&gt;
            self.selector = element&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
    def endElement(self, element):&lt;br /&gt;
        if (element == self.selector):&lt;br /&gt;
            self.selector = None&lt;br /&gt;
 &lt;br /&gt;
    def characters(self, ch):&lt;br /&gt;
        if self.selector == &#039;note-content&#039;:&lt;br /&gt;
            self.content = self.content + unicode(ch)&lt;br /&gt;
        elif self.selector == &#039;title&#039;:&lt;br /&gt;
            self.title = self.title + unicode(ch)&lt;br /&gt;
 &lt;br /&gt;
 class Reader:&lt;br /&gt;
    def __init__(self,note_id):&lt;br /&gt;
        self.note_id = note_id&lt;br /&gt;
        self.content = None&lt;br /&gt;
        self.title = None&lt;br /&gt;
 &lt;br /&gt;
        try:&lt;br /&gt;
            parser = xml.sax.make_parser()&lt;br /&gt;
            handler = textHandler()&lt;br /&gt;
            parser.setContentHandler(handler)&lt;br /&gt;
              parser.parse(os.path.join(os.path.expanduser(&amp;quot;~&amp;quot;),&#039;.conboy&#039;,self.note_id+&#039;.note&#039;))&lt;br /&gt;
            self.content = handler.content&lt;br /&gt;
            self.title = handler.title &lt;br /&gt;
        except StandardError,e:&lt;br /&gt;
            print e&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
    try:&lt;br /&gt;
        if (sys.argv[1]==&#039;print&#039;):&lt;br /&gt;
            print Reader(unicode(sys.argv[2])).content&lt;br /&gt;
        elif (sys.argv[1]==&#039;list&#039;):&lt;br /&gt;
            nlist = NoteList(&#039;/home/user/.conboy/&#039;).noteList&lt;br /&gt;
            for key in nlist.keys():&lt;br /&gt;
                print key, &#039; : &#039;, nlist[key]&lt;br /&gt;
        elif (sys.argv[1]==&#039;search&#039;):&lt;br /&gt;
            nlist = NoteList(&#039;/home/user/.conboy/&#039;)&lt;br /&gt;
            print nlist.get_note_id_by_title(sys.argv[2])&lt;br /&gt;
        else:&lt;br /&gt;
            raise&lt;br /&gt;
    except StandardError,e:&lt;br /&gt;
            print &amp;quot;&amp;quot;&amp;quot;Usage : python conboy_note_reader.py option [note_id or note title]&lt;br /&gt;
            Option : &lt;br /&gt;
                - list : list all note by title with id&lt;br /&gt;
                - print : print content of note with the given id&lt;br /&gt;
                - search : print id of the given title&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
            print e&lt;/div&gt;</summary>
		<author><name>91.66.29.77</name></author>
	</entry>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=Phone_control&amp;diff=31787</id>
		<title>Phone control</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=Phone_control&amp;diff=31787"/>
		<updated>2011-04-16T07:40:38Z</updated>

		<summary type="html">&lt;p&gt;91.66.29.77: added getting and setting of profile values&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{ambox&lt;br /&gt;
| type = notice&lt;br /&gt;
| image= &lt;br /&gt;
| text = &#039;&#039;&#039;This page is about controlling your Nokia device.  For historical reasons this page is called &#039;&#039;&#039;phone&#039;&#039;&#039; control even though it really covers more than just the phone functions.&#039;&#039;&#039;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Recommended phone usage}}&lt;br /&gt;
&lt;br /&gt;
==D-Bus==&lt;br /&gt;
&lt;br /&gt;
These D-Bus commands can be run from terminal or as shell scripts. Useful for scheduling events with [[fcron]], executing from [[Desktop Command Execution Widget scripts|Desktop Command Execution Widget]] or [[Queen BeeCon Widget]], startup events, install scripts, etc. They should be run as:&lt;br /&gt;
&lt;br /&gt;
 run-standalone.sh SCRIPT.sh&lt;br /&gt;
 run-standalone.sh dbus-send COMMAND&lt;br /&gt;
&lt;br /&gt;
This is important to set up the environment correctly otherwise they may barf. If run as user &amp;quot;user&amp;quot; this is not needed.&lt;br /&gt;
&lt;br /&gt;
Also note that most commands don&#039;t need &amp;quot;--print-reply&amp;quot; option. Those that don&#039;t need it should be &#039;&#039;&#039;tested without it&#039;&#039;&#039; and this page should be edited.&lt;br /&gt;
&lt;br /&gt;
===Phone===&lt;br /&gt;
&lt;br /&gt;
====Open Phone application====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --type=method_call --dest=com.nokia.HildonDesktop.AppMgr /com/nokia/HildonDesktop/AppMgr com.nokia.HildonDesktop.AppMgr.LaunchApplication string:&amp;quot;rtcom-call-ui&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====Make a phone call====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --print-reply --dest=com.nokia.csd.Call /com/nokia/csd/call com.nokia.csd.Call.CreateWith string:&amp;quot;$NUMBER&amp;quot; uint32:0&lt;br /&gt;
&lt;br /&gt;
Change $NUMBER to phone number you want to call.&lt;br /&gt;
&lt;br /&gt;
====End current phone call====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --print-reply --dest=com.nokia.csd.Call /com/nokia/csd/call com.nokia.csd.Call.Release&lt;br /&gt;
&lt;br /&gt;
This will release/end/hangup/reject the current call (or possibly all calls if more then one call is active) or do nothing if no calls are active.&lt;br /&gt;
&lt;br /&gt;
====Answer current phone call====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --print-reply --dest=com.nokia.csd.Call /com/nokia/csd/call/1 com.nokia.csd.Call.Instance.Answer&lt;br /&gt;
&lt;br /&gt;
This will answer/pickup the current (first) call. &lt;br /&gt;
&lt;br /&gt;
If you answer the call immediately as you receive the Call Coming D-Bus message the phone seems to be in a specific call state where answering yields a &amp;lt;code&amp;gt;com.nokia.csd.Call.Error.NotAllowed&amp;lt;/code&amp;gt; exception.&lt;br /&gt;
&lt;br /&gt;
You need to answer the call after a delay of e.g. 1 s.&lt;br /&gt;
&lt;br /&gt;
Another (probably better) approach is to register to the CallStatus D-Bus message (&amp;lt;code&amp;gt;com.nokia.csd.Call&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;/com/nokia/csd/call/1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;com.nokia.csd.Call.Instance.CallStatus&amp;lt;/code&amp;gt;) and wait for a call status &amp;gt;= 2 (=&amp;lt;code&amp;gt;CSD_CALL_STATUS_COMING&amp;lt;/code&amp;gt;) after the &amp;quot;Coming&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
====Get [[:wikipedia:International_Mobile_Equipment_Identity|IMEI]]====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --print-reply --dest=com.nokia.phone.SIM /com/nokia/phone/SIM/security Phone.Sim.Security.get_imei&lt;br /&gt;
&lt;br /&gt;
====Get [[:wikipedia:International_Mobile_Subscriber_Identity|IMSI]]====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --print-reply --dest=com.nokia.phone.SIM /com/nokia/phone/SIM Phone.Sim.get_imsi&lt;br /&gt;
&lt;br /&gt;
====Get SIM status====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --print-reply --dest=com.nokia.phone.SIM /com/nokia/phone/SIM Phone.Sim.get_sim_status&lt;br /&gt;
&lt;br /&gt;
====Get cellular signal strength====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --print-reply --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.get_signal_strength&lt;br /&gt;
&lt;br /&gt;
First line is percentage, second is dBm, third unknown.&lt;br /&gt;
&lt;br /&gt;
====Get cellular registration status====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --print-reply --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.get_registration_status&lt;br /&gt;
&lt;br /&gt;
====Turn loudspeaker on====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --type=method_call --dest=com.nokia.osso_hp_ls_controller /com/nokia/osso_hp_ls_controller com.nokia.osso_hp_ls_controller.loudspeaker.force_loudspeaker_on&lt;br /&gt;
&lt;br /&gt;
(These loudspeaker ones don&#039;t work on my N900. If I add --print-reply I get &amp;quot;Error org.freedesktop.DBus.Error.ServiceUnknown: The name com.nokia.osso_hp_ls_controller was not provided by any .service files&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
====Turn loudspeaker off====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --type=method_call --dest=com.nokia.osso_hp_ls_controller /com/nokia/osso_hp_ls_controller com.nokia.osso_hp_ls_controller.loudspeaker.force_loudspeaker_off&lt;br /&gt;
&lt;br /&gt;
====Turn loudspeaker on (N900)====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --type=method_call --dest=org.maemo.Playback.Manager /org/maemo/Playback/Manager org.maemo.Playback.Manager.RequestPrivacyOverride boolean:True&lt;br /&gt;
&lt;br /&gt;
====Turn loudspeaker off (N900)====&lt;br /&gt;
 dbus-send --type=method_call --dest=org.maemo.Playback.Manager /org/maemo/Playback/Manager org.maemo.Playback.Manager.RequestPrivacyOverride boolean:False&lt;br /&gt;
&lt;br /&gt;
====Turn mute on (N900)====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --type=method_call --dest=org.maemo.Playback.Manager /org/maemo/Playback/Manager org.maemo.Playback.Manager.RequestMute boolean:True&lt;br /&gt;
&lt;br /&gt;
====Turn mute off (N900)====&lt;br /&gt;
 dbus-send --type=method_call --dest=org.maemo.Playback.Manager /org/maemo/Playback/Manager org.maemo.Playback.Manager.RequestMute boolean:False&lt;br /&gt;
&lt;br /&gt;
====Turn bluetooth override on (N900)====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --type=method_call --dest=org.maemo.Playback.Manager /org/maemo/Playback/Manager org.maemo.Playback.Manager.RequestBluetoothOverride boolean:True&lt;br /&gt;
&lt;br /&gt;
====Turn bluetooth override off (N900)====&lt;br /&gt;
 dbus-send --type=method_call --dest=org.maemo.Playback.Manager /org/maemo/Playback/Manager org.maemo.Playback.Manager.RequestBluetoothOverride boolean:False&lt;br /&gt;
&lt;br /&gt;
====Start vibrating====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --print-reply --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_vibrator_pattern_activate string:PatternIncomingCall&lt;br /&gt;
&lt;br /&gt;
====Stop vibrating====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --print-reply --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_vibrator_pattern_deactivate string:PatternIncomingCall&lt;br /&gt;
&lt;br /&gt;
===Profiles===&lt;br /&gt;
&lt;br /&gt;
====Set General====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --type=method_call --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.set_profile string:&amp;quot;general&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====Set Silent====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --type=method_call --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.set_profile string:&amp;quot;silent&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====Query current profile====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --type=method_call --print-reply --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.get_profile&lt;br /&gt;
&lt;br /&gt;
====List all profiles====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --type=method_call --print-reply --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.get_profiles&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Get all profile Values====&lt;br /&gt;
&lt;br /&gt;
You can modify any profile value, eg. clock alarm enabled, im alert volume, keypad sound level, touchscreen sound level, ... To find out which keys exist, to what value they are set and what values can be given you can use the following command. (For the profile &amp;quot;silent&amp;quot; just put &amp;quot;silent&amp;quot; at the end instead of &amp;quot;general&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
 dbus-send --type=method_call --print-reply --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.get_values string:&amp;quot;general&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The returned value is an array of struct. Each struct has 3 strings: key, value, type. Type can be eg. &amp;quot;INTEGER 0-2&amp;quot; saying that the values 0, 1 and 2 are correct values for this key.&lt;br /&gt;
&lt;br /&gt;
====Set a profile value====&lt;br /&gt;
&lt;br /&gt;
To modify the above mentioned profile values you need this method. The method takes three parameters, all strings: profile, key and value. Profile can be &amp;quot;general&amp;quot; or &amp;quot;silent&amp;quot;, key is one of the keys from the above (get all profile values), value can be set to anything allowed by &amp;quot;type&amp;quot; from the above method.&lt;br /&gt;
&lt;br /&gt;
To enable vibrating alert for the profile &amp;quot;general&amp;quot; your script would look like this:&lt;br /&gt;
&lt;br /&gt;
 dbus-send --type=method_call --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.set_value string:&amp;quot;general&amp;quot; string:&amp;quot;vibrating.alert.enabled&amp;quot; string:&amp;quot;On&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===LED===&lt;br /&gt;
&lt;br /&gt;
====Activate LEDs====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_led_pattern_activate string:&amp;quot;PatternCommunicationIM&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====Deactivate LEDs====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_led_pattern_deactivate string:&amp;quot;PatternCommunicationIM&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Messaging===&lt;br /&gt;
&lt;br /&gt;
====New e-mail====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --type=method_call --dest=com.nokia.modest /com/nokia/modest com.nokia.modest.MailTo string:&amp;quot;mailto:&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====Send and receive e-mail====&lt;br /&gt;
&lt;br /&gt;
It works, but it takes up to 2 minutes for modest to start refreshing and after that it depends on the speed of the connection how fast it is going to be completed, usually up to 5 seconds, 2G can be a bit slower.&lt;br /&gt;
&lt;br /&gt;
 dbus-send --type=method_call --dest=com.nokia.modest /com/nokia/modest com.nokia.modest.SendReceive&lt;br /&gt;
&lt;br /&gt;
====Set presence====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --type=method_call --print-reply --dest=org.freedesktop.Telepathy.MissionControl /org/freedesktop/Telepathy/MissionControl org.freedesktop.Telepathy.MissionControl.SetPresence uint32:2 string:&amp;quot;I&#039;m here&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note: This method does not work in Maemo 5. Workaround: http://talk.maemo.org/showthread.php?t=55686&lt;br /&gt;
&lt;br /&gt;
====Change peak_schedule settings====&lt;br /&gt;
&lt;br /&gt;
Check:&lt;br /&gt;
 run-standalone.sh gconftool-2 -R /apps/activesync&lt;br /&gt;
&lt;br /&gt;
Set (check if yours is named ActiveSyncAccount1):&lt;br /&gt;
 run-standalone.sh gconftool-2 --set /apps/activesync/ActiveSyncAccount1/schedule/peak_schedule --type=int 15&lt;br /&gt;
Where the last number is one of the following (as standard in GUI):&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;0&#039;&#039;&#039; = Always on&lt;br /&gt;
* &#039;&#039;&#039;-1&#039;&#039;&#039; = Manual&lt;br /&gt;
* &#039;&#039;&#039;15&#039;&#039;&#039; = Every 15 minutes&lt;br /&gt;
* &#039;&#039;&#039;30&#039;&#039;&#039; = Every 30 minutes&lt;br /&gt;
* &#039;&#039;&#039;60&#039;&#039;&#039; = Every hour&lt;br /&gt;
* &#039;&#039;&#039;240&#039;&#039;&#039; = Every 4 hours&lt;br /&gt;
* &#039;&#039;&#039;720&#039;&#039;&#039; = Every 12 hours&lt;br /&gt;
&lt;br /&gt;
===Media player===&lt;br /&gt;
&lt;br /&gt;
====Open file in media player====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --print-reply --dest=com.nokia.mediaplayer /com/nokia/mediaplayer com.nokia.mediaplayer.mime_open string:&amp;quot;file:///$1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====Pause what&#039;s currently playing====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.pause&lt;br /&gt;
&lt;br /&gt;
====Stop what&#039;s currently playing====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.stop&lt;br /&gt;
&lt;br /&gt;
====Play what&#039;s currently selected====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.play&lt;br /&gt;
&lt;br /&gt;
====Unpause what&#039;s currently selected====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.resume&lt;br /&gt;
&lt;br /&gt;
====Play next mediafile====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.next&lt;br /&gt;
&lt;br /&gt;
====Play previous mediafile====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.previous&lt;br /&gt;
&lt;br /&gt;
===Notifications===&lt;br /&gt;
&lt;br /&gt;
====Send notification (orange one line popup)====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:&amp;quot;NOTIFICATION&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====Send dialog notification (orange multi line popup requiring user interaction)====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteDialog string:&amp;quot;QUESTION?&amp;quot; uint32:0 string:&amp;quot;OK&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Not sure what string &amp;quot;OK&amp;quot; does, but it is needed and can be anything.&lt;br /&gt;
&lt;br /&gt;
===Securing===&lt;br /&gt;
&lt;br /&gt;
====Lock====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.system_ui /com/nokia/system_ui/request com.nokia.system_ui.request.devlock_open string:&amp;quot;com.nokia.mce&amp;quot; string:&amp;quot;/com/nokia/mce/request&amp;quot; string:&amp;quot;com.nokia.mce.request&amp;quot; string:&amp;quot;devlock_callback&amp;quot; uint32:&#039;3&#039;&lt;br /&gt;
&lt;br /&gt;
====Unlock====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.system_ui /com/nokia/system_ui/request com.nokia.system_ui.request.devlock_close string:&amp;quot;com.nokia.mce&amp;quot; string:&amp;quot;/com/nokia/mce/request&amp;quot; string:&amp;quot;com.nokia.mce.request&amp;quot; string:&amp;quot;devlock_callback&amp;quot; uint32:&#039;0&#039;&lt;br /&gt;
&lt;br /&gt;
====Lock screen and keys====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_tklock_mode_change string:&amp;quot;locked&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====Unlock screen and keys====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_tklock_mode_change string:&amp;quot;unlocked&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Networking===&lt;br /&gt;
&lt;br /&gt;
====Enable ICD log====&lt;br /&gt;
There are two methods to enable ICD logs&lt;br /&gt;
&lt;br /&gt;
1. Print to the syslog:&lt;br /&gt;
   (1)Use the following cmd &lt;br /&gt;
   (2)$ syslogd&lt;br /&gt;
   (3)$ icd2 –l0&lt;br /&gt;
   (4)The log will print to the /var/log/syslog&lt;br /&gt;
2. Print to the standard output  &lt;br /&gt;
   (1)Get the source code of icd2&lt;br /&gt;
   (2)Add the begging of source code of “support/osso-log.h” &amp;quot;#define OSSOLOG_STDOUT&amp;quot;&lt;br /&gt;
   (3)$ icd2 –l0&lt;br /&gt;
   (4)The log will print to the standard output&lt;br /&gt;
&lt;br /&gt;
====Connect to specific saved connection====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.icd /com/nokia/icd com.nokia.icd.connect string:&amp;quot;IAP_ID&amp;quot; uint32:0&lt;br /&gt;
&lt;br /&gt;
IAP_ID is internet access point identifier and can be obtained with the following command:&lt;br /&gt;
&lt;br /&gt;
 gconftool -R /system/osso/connectivity/IAP&lt;br /&gt;
&lt;br /&gt;
Find lines which matches /system/osso/connectivity/IAP/&amp;lt;IAP_ID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For GPRS connections replace &amp;quot;@32@&amp;quot; with a space in IAP_ID string.&lt;br /&gt;
&lt;br /&gt;
Keep in mind that phone has to be disconnected in order to connect via this call.&lt;br /&gt;
If not, an error message will occur if you add --print-reply to the dbus-send command.&lt;br /&gt;
&lt;br /&gt;
====Connect to any saved connection====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.icd /com/nokia/icd com.nokia.icd.connect string:&amp;quot;[ANY]&amp;quot; uint32:0&lt;br /&gt;
&lt;br /&gt;
====Disconnect internet====&lt;br /&gt;
&lt;br /&gt;
=====ICD2=====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --print-reply --system --dest=com.nokia.icd2 /com/nokia/icd2 com.nokia.icd2.disconnect_req uint32:0x8000&lt;br /&gt;
&lt;br /&gt;
=====ICD=====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --dest=com.nokia.icd /com/nokia/icd_ui com.nokia.icd_ui.disconnect boolean:true&lt;br /&gt;
&lt;br /&gt;
On [[Maemo 5/PR1.2|PR1.2]] :&lt;br /&gt;
Error org.freedesktop.DBus.Error.UnknownMethod: Method &amp;quot;disconnect&amp;quot; with signature &amp;quot;b&amp;quot; on interface &amp;quot;com.nokia.icd_ui&amp;quot; doesn&#039;t exist&lt;br /&gt;
&lt;br /&gt;
====Connect (show change connection UI)====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.icd_ui /com/nokia/icd_ui com.nokia.icd_ui.show_conn_dlg boolean:false&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;boolean:true&amp;quot; at the end, one-line notification saying &amp;quot;No saved connections available&amp;quot; appears. Maybe affects more than that? Most likely, boolean:true leads to using saved connections if there are any, and boolean:false forces to display the connection dialog.&lt;br /&gt;
&lt;br /&gt;
====Enable cellular radio====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.phone.SSC /com/nokia/phone/SSC com.nokia.phone.SSC.set_radio boolean:true&lt;br /&gt;
&lt;br /&gt;
====Disable cellular radio====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.phone.SSC /com/nokia/phone/SSC com.nokia.phone.SSC.set_radio boolean:false&lt;br /&gt;
&lt;br /&gt;
===Radio mode===&lt;br /&gt;
&lt;br /&gt;
====Current Mode====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --print-reply --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.get_radio_access_technology&lt;br /&gt;
&lt;br /&gt;
====2G====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.set_selected_radio_access_technology byte:1&lt;br /&gt;
&lt;br /&gt;
====3G====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.set_selected_radio_access_technology byte:2&lt;br /&gt;
&lt;br /&gt;
====Dual====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.set_selected_radio_access_technology byte:0&lt;br /&gt;
&lt;br /&gt;
===Bluetooth===&lt;br /&gt;
&lt;br /&gt;
====Identify adapter path====&lt;br /&gt;
&lt;br /&gt;
You need to know adapter path in order to send D-Bus call to the right place. You can get it with entering this command into the terminal:&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --print-reply --dest=org.bluez / org.bluez.Manager.ListAdapters | awk -F&#039;&amp;quot;&#039; &#039;/at/ {print $2}&#039;&lt;br /&gt;
&lt;br /&gt;
====Enable====&lt;br /&gt;
&lt;br /&gt;
Using the adapter path value returned with previous command, for example &#039;&#039;/org/bluez/906/hci0&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=org.bluez /org/bluez/906/hci0 org.bluez.Adapter.SetProperty string:Powered variant:boolean:true&lt;br /&gt;
&lt;br /&gt;
This one automatically inserts adapter path:&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez / org.bluez.Manager.ListAdapters | awk -F&#039;&amp;quot;&#039; &#039;/at/ {print $2}&#039;) org.bluez.Adapter.SetProperty string:Powered variant:boolean:true&lt;br /&gt;
&lt;br /&gt;
====Disable====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=org.bluez /org/bluez/906/hci0 org.bluez.Adapter.SetProperty string:Powered variant:boolean:false&lt;br /&gt;
&lt;br /&gt;
With auto-discovery of adapter path:&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez / org.bluez.Manager.ListAdapters | awk -F&#039;&amp;quot;&#039; &#039;/at/ {print $2}&#039;) org.bluez.Adapter.SetProperty string:Powered variant:boolean:false&lt;br /&gt;
&lt;br /&gt;
====Connect to specific device====&lt;br /&gt;
&lt;br /&gt;
 devmac=00:11:22:33:44:55&lt;br /&gt;
 service=AudioSink&lt;br /&gt;
 &lt;br /&gt;
 adapter=$(dbus-send --system --print-reply --dest=org.bluez / org.bluez.Manager.ListAdapters | awk -F&#039;&amp;quot;&#039; &#039;/at/ {print $2}&#039;)&lt;br /&gt;
 device=$(dbus-send --system --print-reply --dest=org.bluez ${adapter} org.bluez.Adapter.FindDevice string:${devmac} | sed -ne &#039;s/^.*object path //p&#039; -e &#039;s/&amp;quot;//g&#039;)&lt;br /&gt;
 dbus-send --system --type=method_call --print-reply --dest=org.bluez ${device} org.bluez.${service}.Connect&lt;br /&gt;
&lt;br /&gt;
Change the AudoSink to any service and the devmac to the MAC of bluetooth device.&lt;br /&gt;
&lt;br /&gt;
===Check for updates===&lt;br /&gt;
&lt;br /&gt;
 dbus-send --type=method_call --dest=com.nokia.hildon_application_manager /com/nokia/hildon_application_manager com.nokia.hildon_application_manager.check_for_updates&lt;br /&gt;
&lt;br /&gt;
===Open link in browser===&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --dest=com.nokia.osso_browser /com/nokia/osso_browser/request com.nokia.osso_browser.load_url string:&amp;quot;google.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Open a pdf file with the default pdf reader application===&lt;br /&gt;
&lt;br /&gt;
 dbus-send --print-reply --dest=com.nokia.osso_pdfviewer /com/nokia/osso_pdfviewer com.nokia.osso_pdfviewer.mime_open string:/home/user/MyDocs/.documents/file_name.pdf&lt;br /&gt;
&lt;br /&gt;
===Open a file with the default notes application===&lt;br /&gt;
&lt;br /&gt;
 dbus-send --print-reply --dest=com.nokia.osso_notes /com/nokia/osso_notes com.nokia.osso_notes.mine_open string:/home/user/MyDocs/.documents/file_name&lt;br /&gt;
&lt;br /&gt;
===Open the default notes application===&lt;br /&gt;
&lt;br /&gt;
 dbus-send --print-reply --dest=com.nokia.osso_notes /com/nokia/osso_notes com.nokia.osso_notes.top_application&lt;br /&gt;
&lt;br /&gt;
=== Open folder ===&lt;br /&gt;
&lt;br /&gt;
 dbus-send --print-reply --dest=com.nokia.osso_filemanager /com/nokia/osso_filemanager com.nokia.osso_filemanager.open_folder string:/home/user/MyDocs/&lt;br /&gt;
&lt;br /&gt;
===Set volume===&lt;br /&gt;
&lt;br /&gt;
 dbus-send --type=method_call --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.extension.set_extension_property string:volume variant:uint32:50&lt;br /&gt;
&lt;br /&gt;
The value can be between 0 and 100.&lt;br /&gt;
&lt;br /&gt;
===Get volume===&lt;br /&gt;
&lt;br /&gt;
 dbus-send --print-reply --type=method_call --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.extension.get_extension_property string:volume&lt;br /&gt;
&lt;br /&gt;
===Reboot===&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --print-reply --dest=com.nokia.mce &amp;quot;/com/nokia/mce/request&amp;quot; com.nokia.mce.request.req_reboot&lt;br /&gt;
This is same as rebooting from power key menu (needs uncommenting in certain XML file to appear) and has been identified as insecure way to reboot the device (no filesystem synchronization, etc.). Better command is to simply enter &amp;quot;reboot&amp;quot; in root terminal.&lt;br /&gt;
&lt;br /&gt;
===Shutdown===&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --type=method_call --print-reply --dest=com.nokia.mce &amp;quot;/com/nokia/mce/request&amp;quot; com.nokia.mce.request.req_shutdown&lt;br /&gt;
See warning at reboot D-Bus call (needs testing).&lt;br /&gt;
&lt;br /&gt;
===Show dashboard===&lt;br /&gt;
&lt;br /&gt;
 dbus-send /com/nokia/hildon_desktop com.nokia.hildon_desktop.exit_app_view&lt;br /&gt;
&lt;br /&gt;
===Other===&lt;br /&gt;
&lt;br /&gt;
====D-Bus Scripts====&lt;br /&gt;
&lt;br /&gt;
You can also use [[DbusScripts|dbus-scripts]] to execute any command when various actions are triggered on D-Bus.&lt;br /&gt;
&lt;br /&gt;
====Panucci (pause)====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --type=method_call --dest=org.panucci.panucciInterface /panucciInterface org.panucci.panucciInterface.playPause&lt;br /&gt;
&lt;br /&gt;
====Device Orientation====&lt;br /&gt;
&lt;br /&gt;
 dbus-send --system --print-reply --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.get_device_orientation&lt;br /&gt;
&lt;br /&gt;
==GConf==&lt;br /&gt;
&lt;br /&gt;
===Reset GPRS data counter===&lt;br /&gt;
&lt;br /&gt;
The commands are PR1.2 compliant and do not work on previous versions.&lt;br /&gt;
&lt;br /&gt;
 gconftool-2 -u /system/osso/connectivity/network_type/GPRS/gprs_home_rx_bytes&lt;br /&gt;
 gconftool-2 -u /system/osso/connectivity/network_type/GPRS/gprs_home_tx_bytes&lt;br /&gt;
 gconftool-2 -s /system/osso/connectivity/network_type/GPRS/gprs_home_reset_time --type=string $(date +%s)&lt;br /&gt;
&lt;br /&gt;
==Command line==&lt;br /&gt;
&lt;br /&gt;
===Enable FM Transmitter===&lt;br /&gt;
&lt;br /&gt;
 /usr/bin/fmtx_client -p 1&lt;br /&gt;
&lt;br /&gt;
===Disable FM Transmitter===&lt;br /&gt;
&lt;br /&gt;
 /usr/bin/fmtx_client -p 0&lt;br /&gt;
&lt;br /&gt;
==GStreamer==&lt;br /&gt;
&lt;br /&gt;
===Take a picture with front camera===&lt;br /&gt;
&lt;br /&gt;
 gst-launch v4l2src device=/dev/video1 num-buffers=1 ! ffmpegcolorspace ! jpegenc ! filesink location=frontcam.jpg&lt;br /&gt;
&lt;br /&gt;
===Shoot photo after 10 seconds===&lt;br /&gt;
&lt;br /&gt;
The camera application must be off for it to work. And of course the camera shutter must be open...gst-launch comes with gstreamer-tools (or gst-launch-0.10 and gstreamer0.10-tools)&lt;br /&gt;
&lt;br /&gt;
 /bin/sleep 10 ; /usr/bin/gst-launch v4l2camsrc device=/dev/video0 num-buffers=1 \! video/x-raw-yuv,width=2592,height=1968  \! ffmpegcolorspace \! jpegenc \! filesink location=/home/user/MyDocs/DCIM/photo.jpg&lt;br /&gt;
&lt;br /&gt;
To shoot from the front camera, change &#039;&#039;&#039;/dev/video0&#039;&#039;&#039; to &#039;&#039;&#039;/dev/video1&#039;&#039;&#039; and the proper resolution:&lt;br /&gt;
&lt;br /&gt;
 /bin/sleep 10 ; /usr/bin/gst-launch v4l2camsrc device=/dev/video1 num-buffers=1 \! video/x-raw-yuv,width=640,height=480  \! ffmpegcolorspace \! jpegenc \! filesink location=/home/user/MyDocs/DCIM/photo.jpg&lt;br /&gt;
&lt;br /&gt;
Other way:&lt;br /&gt;
&lt;br /&gt;
 /bin/sleep 10; /usr/bin/gst-launch v4l2camsrc ! ffmpegcolorspace ! jpegenc ! identity error-after=1 ! filesink location=/home/user/MyDocs/DCIM/photo.jpg&lt;br /&gt;
&lt;br /&gt;
==Python==&lt;br /&gt;
&lt;br /&gt;
===Make a phone call via the cellular network===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import dbus&lt;br /&gt;
def place_call(number):&lt;br /&gt;
  bus = dbus.SystemBus()&lt;br /&gt;
  csd_call = dbus.Interface(bus.get_object(&#039;com.nokia.csd&#039;,&lt;br /&gt;
                                           &#039;/com/nokia/csd/call&#039;),&lt;br /&gt;
                                           &#039;com.nokia.csd.Call&#039;)&lt;br /&gt;
  csd_call.CreateWith(str(number), dbus.UInt32(0))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Make a phone call via SIP ===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/python&lt;br /&gt;
&lt;br /&gt;
import dbus&lt;br /&gt;
import sys&lt;br /&gt;
&lt;br /&gt;
# Get the target phone number (or SIP address) from the command line&lt;br /&gt;
TARGET = sys.argv[1];&lt;br /&gt;
&lt;br /&gt;
# Configure the telepathy path to the SofiaSIP account that we wish to use.&lt;br /&gt;
# Use &amp;quot;mc-tool list&amp;quot; (from the libmissioncontrol-utils package) to see your accounts.&lt;br /&gt;
SIP_ACCOUNT = &#039;sofiasip/sip/_31234567_40sipgate_2eco_2euk0&#039;&lt;br /&gt;
&lt;br /&gt;
# This gets us a connnection to the session bus&lt;br /&gt;
bus = dbus.SessionBus()&lt;br /&gt;
&lt;br /&gt;
# This sets up a path to the SIP account within telepathy.&lt;br /&gt;
PATH = &#039;/org/freedesktop/Telepathy/Account/&#039;&lt;br /&gt;
PATH += SIP_ACCOUNT&lt;br /&gt;
&lt;br /&gt;
# This sets up a proxy object as a &amp;quot;handle&amp;quot; to the AccountManager of our target account&lt;br /&gt;
account = bus.get_object(&#039;org.freedesktop.Telepathy.AccountManager&#039;, PATH)&lt;br /&gt;
&lt;br /&gt;
# This launches the actual SIP call with a method call to EnsureChannel on that object&lt;br /&gt;
account.EnsureChannel( \&lt;br /&gt;
        dbus.Dictionary({&lt;br /&gt;
                dbus.String(u&#039;org.freedesktop.Telepathy.Channel.TargetHandleType&#039;): dbus.UInt32(1),&lt;br /&gt;
                dbus.String(u&#039;org.freedesktop.Telepathy.Channel.ChannelType&#039;): dbus.String(u&#039;org.freedesktop.Telepathy.Channel.Type.StreamedMedia&#039;),&lt;br /&gt;
                dbus.String(u&#039;org.freedesktop.Telepathy.Channel.TargetID&#039;): dbus.String(TARGET),&lt;br /&gt;
        }, signature=&#039;sv&#039;),&lt;br /&gt;
        dbus.UInt64(0),&lt;br /&gt;
        dbus.String(&#039;&#039;),&lt;br /&gt;
        dbus_interface=&#039;com.nokia.Account.Interface.ChannelRequests&#039;)&lt;br /&gt;
&lt;br /&gt;
sys.exit(0)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Send SMS===&lt;br /&gt;
&lt;br /&gt;
ssms.py using new QtMobility bindings by ossipena:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
# -*- coding: utf-8 -*-&lt;br /&gt;
&lt;br /&gt;
#ssms Ossipena/TimoP&lt;br /&gt;
#send smses from command line&lt;br /&gt;
#licence : Do whatever you want&lt;br /&gt;
#deps:&lt;br /&gt;
#pyside-qt4&lt;br /&gt;
#pyside-mobility&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;imports&#039;&#039;&#039;&lt;br /&gt;
from QtMobility.Messaging import *&lt;br /&gt;
from PySide.QtCore import *&lt;br /&gt;
import sys&lt;br /&gt;
from PyQt4 import QtCore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
app = QCoreApplication(sys.argv)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;get number and name&#039;&#039;&#039;&lt;br /&gt;
stringit = sys.argv&lt;br /&gt;
numpertemp = str(stringit[1:2])&lt;br /&gt;
mesits = str(stringit[2:])[2:-2]&lt;br /&gt;
&lt;br /&gt;
num = str(numpertemp[2:-2])&lt;br /&gt;
&lt;br /&gt;
if (mesits == &amp;quot;&amp;quot;):&lt;br /&gt;
  print &amp;quot;Usage:&amp;quot;&lt;br /&gt;
  print &amp;quot;python ssms.py 01234567 &#039;message text here&#039;&amp;quot;&lt;br /&gt;
  sys.exit(69)&lt;br /&gt;
else:&lt;br /&gt;
  print &amp;quot;number is &amp;quot; + str(num)&lt;br /&gt;
  print &amp;quot;message is &amp;quot; + str(mesits)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;define message to be sent&#039;&#039;&#039;&lt;br /&gt;
numperi = QtCore.QString(num)&lt;br /&gt;
&lt;br /&gt;
numper = QMessageAddress(QMessageAddress.Phone, numperi)&lt;br /&gt;
mesitsi = QMessage()&lt;br /&gt;
mesitsi.setType(QMessage.Sms)&lt;br /&gt;
mesitsi.setTo(numper)&lt;br /&gt;
mesitsi.setBody(mesits)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;send message&#039;&#039;&#039;&lt;br /&gt;
sender = QMessageService()&lt;br /&gt;
if (sender.send(mesitsi)):&lt;br /&gt;
  print &amp;quot;success&amp;quot;&lt;br /&gt;
else:&lt;br /&gt;
  print &amp;quot;fail&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From:&lt;br /&gt;
http://talk.maemo.org/showpost.php?p=548948&amp;amp;postcount=52&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env python2.5&lt;br /&gt;
&lt;br /&gt;
import pexpect&lt;br /&gt;
import time&lt;br /&gt;
from subprocess import *&lt;br /&gt;
&lt;br /&gt;
child = pexpect.spawn(&#039;pnatd&#039;);&lt;br /&gt;
child.send(&#039;at\r&#039;);&lt;br /&gt;
time.sleep(0.25);&lt;br /&gt;
child.send(&#039;at+cmgf=1\r&#039;);&lt;br /&gt;
time.sleep(0.25);&lt;br /&gt;
child.send(&#039;at+cmgs=&amp;quot;+XXXXXXX&amp;quot;\r&#039;);&lt;br /&gt;
child.send(&#039;SMSTEXTSMSTEXTSMSTEXT&#039;);&lt;br /&gt;
child.send(chr(26));&lt;br /&gt;
child.send(chr(26));&lt;br /&gt;
child.sendeof();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There&#039;s also a python script that uses D-Bus instead from http://talk.maemo.org/showpost.php?p=558430&amp;amp;postcount=57:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env python2.5          &lt;br /&gt;
import sched, time                &lt;br /&gt;
import dbus                       &lt;br /&gt;
import gobject                    &lt;br /&gt;
from dbus.mainloop.glib import DBusGMainLoop&lt;br /&gt;
&lt;br /&gt;
def octify(str):&lt;br /&gt;
        &#039;&#039;&#039;     &lt;br /&gt;
        Returns a list of octet bytes representing&lt;br /&gt;
        each char of the input str.               &lt;br /&gt;
        &#039;&#039;&#039;                                       &lt;br /&gt;
&lt;br /&gt;
        bytes = map(ord, str)&lt;br /&gt;
        bitsconsumed = 0     &lt;br /&gt;
        referencebit = 7     &lt;br /&gt;
        octets = []          &lt;br /&gt;
&lt;br /&gt;
        while len(bytes):&lt;br /&gt;
                byte = bytes.pop(0)&lt;br /&gt;
                byte = byte &amp;gt;&amp;gt; bitsconsumed&lt;br /&gt;
                                           &lt;br /&gt;
                try:                       &lt;br /&gt;
                        nextbyte = bytes[0]&lt;br /&gt;
                        bitstocopy = (nextbyte &amp;amp; (0xff &amp;gt;&amp;gt; referencebit)) &amp;lt;&amp;lt; referencebit&lt;br /&gt;
                        octet = (byte | bitstocopy)                                     &lt;br /&gt;
&lt;br /&gt;
                except:&lt;br /&gt;
                        octet = (byte | 0x00)&lt;br /&gt;
&lt;br /&gt;
                if bitsconsumed != 7:&lt;br /&gt;
                        octets.append(byte | bitstocopy)&lt;br /&gt;
                        bitsconsumed += 1               &lt;br /&gt;
                        referencebit -= 1               &lt;br /&gt;
                else:                                   &lt;br /&gt;
                        bitsconsumed = 0                &lt;br /&gt;
                        referencebit = 7                &lt;br /&gt;
&lt;br /&gt;
        return octets&lt;br /&gt;
&lt;br /&gt;
def semi_octify(str):&lt;br /&gt;
        &#039;&#039;&#039;          &lt;br /&gt;
        Expects a string containing two digits.&lt;br /&gt;
        Returns an octet -                     &lt;br /&gt;
        first nibble in the octect is the first&lt;br /&gt;
        digit and the second nibble represents &lt;br /&gt;
        the second digit.                      &lt;br /&gt;
        &#039;&#039;&#039;                                    &lt;br /&gt;
        try:                                   &lt;br /&gt;
                digit_1 = int(str[0])          &lt;br /&gt;
                digit_2 = int(str[1])          &lt;br /&gt;
                octet = (digit_2 &amp;lt;&amp;lt; 4) | digit_1&lt;br /&gt;
        except:                                 &lt;br /&gt;
                octet = (1 &amp;lt;&amp;lt; 4) | digit_1      &lt;br /&gt;
&lt;br /&gt;
        return octet&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def deoctify(arr):&lt;br /&gt;
&lt;br /&gt;
        referencebit = 1&lt;br /&gt;
        doctect = []    &lt;br /&gt;
        bnext = 0x00    &lt;br /&gt;
&lt;br /&gt;
        for i in arr:&lt;br /&gt;
&lt;br /&gt;
                bcurr = ((i &amp;amp; (0xff &amp;gt;&amp;gt; referencebit)) &amp;lt;&amp;lt; referencebit) &amp;gt;&amp;gt; 1&lt;br /&gt;
                bcurr = bcurr | bnext                                      &lt;br /&gt;
&lt;br /&gt;
                if referencebit != 7:&lt;br /&gt;
                        doctect.append( bcurr )&lt;br /&gt;
                        bnext = (i &amp;amp; (0xff &amp;lt;&amp;lt; (8 - referencebit)) ) &amp;gt;&amp;gt; 8 - referencebit&lt;br /&gt;
                        referencebit += 1                                              &lt;br /&gt;
                else:                                                                  &lt;br /&gt;
                        doctect.append( bcurr )                                        &lt;br /&gt;
                        bnext = (i &amp;amp; (0xff &amp;lt;&amp;lt; (8 - referencebit)) ) &amp;gt;&amp;gt; 8 - referencebit&lt;br /&gt;
                        doctect.append( bnext )                                        &lt;br /&gt;
                        bnext = 0x00                                                   &lt;br /&gt;
                        referencebit = 1                                               &lt;br /&gt;
&lt;br /&gt;
        return &#039;&#039;.join([chr(i) for i in doctect])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def createPDUmessage(number, msg):&lt;br /&gt;
        &#039;&#039;&#039;                       &lt;br /&gt;
        Returns a list of bytes to represent a valid PDU message&lt;br /&gt;
        &#039;&#039;&#039;                                                     &lt;br /&gt;
        numlength = len(number)                                 &lt;br /&gt;
        if (numlength % 2) == 0:                                &lt;br /&gt;
                rangelength = numlength                         &lt;br /&gt;
        else:                                                   &lt;br /&gt;
                number = number + &#039;F&#039;                           &lt;br /&gt;
                rangelength = len(number)                       &lt;br /&gt;
&lt;br /&gt;
        octifiednumber = [ semi_octify(number[i:i+2]) for i in range(0,rangelength,2) ]&lt;br /&gt;
        octifiedmsg = octify(msg)                                                      &lt;br /&gt;
        HEADER = 1                                                                     &lt;br /&gt;
        FIRSTOCTETOFSMSDELIVERMSG = 10                                                 &lt;br /&gt;
        ADDR_TYPE = 129 #unknown format                                                &lt;br /&gt;
        number_length = len(number)                                                    &lt;br /&gt;
        msg_length = len(msg)                                                          &lt;br /&gt;
        pdu_message = [HEADER, FIRSTOCTETOFSMSDELIVERMSG, number_length, ADDR_TYPE]    &lt;br /&gt;
        pdu_message.extend(octifiednumber)                                             &lt;br /&gt;
        pdu_message.append(0)                                                          &lt;br /&gt;
        pdu_message.append(0)                                                          &lt;br /&gt;
        pdu_message.append(msg_length)                                                 &lt;br /&gt;
        pdu_message.extend(octifiedmsg)                                                &lt;br /&gt;
        return pdu_message                                                             &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def sendmessage(number, message):&lt;br /&gt;
&lt;br /&gt;
        bus = dbus.SystemBus()&lt;br /&gt;
        smsobject = bus.get_object(&#039;com.nokia.phone.SMS&#039;, &#039;/com/nokia/phone/SMS/ba212ae1&#039;)&lt;br /&gt;
        smsiface = dbus.Interface(smsobject, &#039;com.nokia.csd.SMS.Outgoing&#039;)&lt;br /&gt;
        arr = dbus.Array(createPDUmessage(number.replace(&#039;+&#039;, &#039;00&#039;), message))&lt;br /&gt;
&lt;br /&gt;
        msg = dbus.Array([arr])&lt;br /&gt;
        smsiface.Send(msg,&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def callback(pdumsg, msgcenter, somestring, sendernumber):&lt;br /&gt;
&lt;br /&gt;
        msglength = int(pdumsg[18])&lt;br /&gt;
        msgarray = pdumsg[19:len(pdumsg)]&lt;br /&gt;
&lt;br /&gt;
        msg = deoctify(msgarray)&lt;br /&gt;
&lt;br /&gt;
        if msg &amp;gt; 0:&lt;br /&gt;
               print &#039;New message received from %s&#039; % sendernumber&lt;br /&gt;
               print &#039;Message length %d&#039; % msglength&lt;br /&gt;
               print &#039;Message: %s&#039; % msg&lt;br /&gt;
&lt;br /&gt;
               if msg == &amp;quot;ping&amp;quot;:&lt;br /&gt;
                       print &amp;quot;Sending reply: pong&amp;quot;&lt;br /&gt;
                       sendmessage(sendernumber.replace(&amp;quot;+&amp;quot;,&amp;quot;00&amp;quot;), &amp;quot;pong&amp;quot;)&lt;br /&gt;
               else:&lt;br /&gt;
                       print &amp;quot;Unknown command&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def listen():&lt;br /&gt;
        DBusGMainLoop(set_as_default=True)&lt;br /&gt;
        bus = dbus.SystemBus() #should connect to system bus instead of session because the former is where the incoming signals come from&lt;br /&gt;
        bus.add_signal_receiver(callback, path=&#039;/com/nokia/phone/SMS&#039;, dbus_interface=&#039;Phone.SMS&#039;, signal_name=&#039;IncomingSegment&#039;)&lt;br /&gt;
        gobject.MainLoop().run()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
  import time&lt;br /&gt;
  &lt;br /&gt;
  def schedule_task(schedule, fn, *args):&lt;br /&gt;
      import sched&lt;br /&gt;
      s = sched.scheduler(time.time, time.sleep)&lt;br /&gt;
      startTime = time.mktime(time.strptime(schedule, &#039;%b %d %H:%M %Y&#039;))&lt;br /&gt;
      s.enterabs(startTime, 0, fn, args)&lt;br /&gt;
      s.run()&lt;br /&gt;
&lt;br /&gt;
  import getopt, sys&lt;br /&gt;
  try:  &lt;br /&gt;
    opts, args = getopt.getopt(sys.argv[1:],&amp;quot;hlt:&amp;quot;, [&amp;quot;help&amp;quot;,&amp;quot;listen&amp;quot;,&amp;quot;time=&amp;quot;])&lt;br /&gt;
&lt;br /&gt;
  except getopt.GetoptError, err:&lt;br /&gt;
    # print help information and exit:&lt;br /&gt;
    print str(err) # will print something like &amp;quot;option -a not recognized&amp;quot;&lt;br /&gt;
    usage()&lt;br /&gt;
    sys.exit(2)  &lt;br /&gt;
  listening = False &lt;br /&gt;
  timeofday = &#039;&#039;&lt;br /&gt;
  for opt, arg in opts:&lt;br /&gt;
    if opt in (&amp;quot;-h&amp;quot;, &amp;quot;--help&amp;quot;):&lt;br /&gt;
      usage()                     &lt;br /&gt;
      sys.exit()                  &lt;br /&gt;
    elif opt in (&amp;quot;-l&amp;quot;, &amp;quot;--listen&amp;quot;):&lt;br /&gt;
      listening = True                 &lt;br /&gt;
    elif opt in (&amp;quot;-t&amp;quot;, &amp;quot;--time&amp;quot;):&lt;br /&gt;
      timeofday = arg                           &lt;br /&gt;
    else:&lt;br /&gt;
      assert False, &amp;quot;unhandled option&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  number = args[0]           &lt;br /&gt;
  msg = args[1]&lt;br /&gt;
  if msg != &#039;&#039;:&lt;br /&gt;
    if timeofday == &#039;&#039;:&lt;br /&gt;
        sendmessage(number, msg)&lt;br /&gt;
    else:&lt;br /&gt;
        today = time.strftime(&#039;%b %d x %Y&#039;, time.localtime())&lt;br /&gt;
        schedule = today.replace(&#039;x&#039;, timeofday)&lt;br /&gt;
        schedule_task(schedule, sendmessage, number, msg)&lt;br /&gt;
  if listening:&lt;br /&gt;
    listen()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Send dialog notification (orange multi line popup requiring user interaction)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import dbus&lt;br /&gt;
def show_notification_dialog(message, mode=&amp;quot;single&amp;quot;):&lt;br /&gt;
  bus = dbus.SystemBus()&lt;br /&gt;
  iface = dbus.Interface(bus.get_object(&#039;org.freedesktop.Notifications&#039;,&lt;br /&gt;
                                        &#039;/org/freedesktop/Notifications&#039;),&lt;br /&gt;
                                        &#039;org.freedesktop.Notifications&#039;)&lt;br /&gt;
  if mode == &amp;quot;single&amp;quot;:&lt;br /&gt;
      iface.SystemNoteInfoprint(message)&lt;br /&gt;
  elif mode == &amp;quot;multiline&amp;quot;:&lt;br /&gt;
      iface.SystemNoteDialog(str(message), dbus.UInt32(0), &#039;Ok&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function allows you to show notification either with multiline (on Maemo pre-5 it will show a dialog with an &amp;quot;Ok&amp;quot; button) or single line (tiny notifications hiding automatically).&lt;br /&gt;
&lt;br /&gt;
===Take a screenshot===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import gtk.gdk&lt;br /&gt;
&lt;br /&gt;
w = gtk.gdk.get_default_root_window()&lt;br /&gt;
sz = w.get_size()&lt;br /&gt;
print &amp;quot;The size of the window is %d x %d&amp;quot; % sz&lt;br /&gt;
pb = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB,False,8,sz[0],sz[1])&lt;br /&gt;
pb = pb.get_from_drawable(w,w.get_colormap(),0,0,0,0,sz[0],sz[1])&lt;br /&gt;
if (pb != None):&lt;br /&gt;
  pb.save(&amp;quot;screenshot.png&amp;quot;,&amp;quot;png&amp;quot;)&lt;br /&gt;
  print &amp;quot;Screenshot saved to screenshot.png.&amp;quot;&lt;br /&gt;
else:&lt;br /&gt;
  print &amp;quot;Unable to get the screenshot.&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Credits: took code from [http://stackoverflow.com/questions/69645/take-a-screenshot-via-a-python-script-linux here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There is also a way using PyQt:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import time&lt;br /&gt;
from PyQt4.QtGui import QPixmap, QApplication&lt;br /&gt;
app = QApplication(sys.argv)&lt;br /&gt;
file = &amp;quot;/home/user/MyDocs/.images/Screenshots/Screenshot-&amp;quot;+time.strftime(&amp;quot;%Y%m%d&amp;quot;)+&amp;quot;-&amp;quot;+time.strftime(&amp;quot;%H%M%S&amp;quot;)+&amp;quot;.png&amp;quot;&lt;br /&gt;
QPixmap.grabWindow(QApplication.desktop().winId()).save(file, &#039;png&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Make an &amp;quot;Email Style&amp;quot; notification dialog===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import dbus&lt;br /&gt;
&lt;br /&gt;
bus = dbus.SessionBus()&lt;br /&gt;
proxy = bus.get_object(&#039;org.freedesktop.Notifications&#039;, &#039;/org/freedesktop/Notifications&#039;)&lt;br /&gt;
interface = dbus.Interface(proxy,dbus_interface=&#039;org.freedesktop.Notifications&#039;)&lt;br /&gt;
interface.Notify(&#039;Notification&#039;, 0, &#039;control_bluetooth_paired&#039;, &#039;Testing 123&#039;, &#039;Hello World&#039;, [], {}, 0)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Credits: MohammadAG (on irc).&lt;br /&gt;
&lt;br /&gt;
[[Category:Power users]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>91.66.29.77</name></author>
	</entry>
</feed>