<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://bugs.maemo.com/skins/common/feed.css?207"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>maemo.org wiki - User contributions [en]</title>
		<link>http://bugs.maemo.com/Special:Contributions/82.95.81.43</link>
		<description>From maemo.org wiki</description>
		<language>en</language>
		<generator>MediaWiki 1.15.5-7</generator>
		<lastBuildDate>Tue, 14 Apr 2026 11:12:13 GMT</lastBuildDate>
		<item>
			<title>Desktop Command Execution Widget scripts</title>
			<link>http://bugs.maemo.com/Desktop_Command_Execution_Widget_scripts</link>
			<guid>http://bugs.maemo.com/Desktop_Command_Execution_Widget_scripts</guid>
			<description>&lt;p&gt;82.95.81.43:&amp;#32;Added wol script&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'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.&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's no output (for example if you'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 alo usable if your script produces unwandet 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;
&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;
&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'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 '/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;}'&lt;br /&gt;
&lt;br /&gt;
Output example: '''83 % (1000/1200 mAh)''', when charging '''Charging'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Percentage and current charge====&lt;br /&gt;
&lt;br /&gt;
 hal-device bme | awk '/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;}'&lt;br /&gt;
&lt;br /&gt;
Output example: '''83 % (1000 mAh)''', when charging '''Charging'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Percentage====&lt;br /&gt;
&lt;br /&gt;
 hal-device bme | awk '/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;}'&lt;br /&gt;
&lt;br /&gt;
Output example: '''83 %''', when charging '''Chrg'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Current and last full charge====&lt;br /&gt;
&lt;br /&gt;
 hal-device bme | awk '/g.c/ {curr = $3}; /g.la/ {last = $3} END {print curr&amp;quot;/&amp;quot;last&amp;quot; mAh&amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
Output example: '''1000/1200 mAh'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Current charge====&lt;br /&gt;
&lt;br /&gt;
 hal-device bme | awk '/g.c/ {print $3&amp;quot; mAh&amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
Output example: '''1000 mAh'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Last full charge====&lt;br /&gt;
&lt;br /&gt;
 hal-device bme | awk '/g.la/ {print $3&amp;quot; mAh&amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
Output example: '''1200 mAh'''&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 -q -O - api.myiptest.com | awk -F&amp;quot;\&amp;quot;&amp;quot; '{print $4}'`; echo LAN IP: `/sbin/ifconfig wlan0 | awk -F &amp;quot;[: ]&amp;quot; '/Bc/ {print $13}'`&lt;br /&gt;
&lt;br /&gt;
Output example:&lt;br /&gt;
&lt;br /&gt;
'''WAN IP: 1.2.3.4'''&lt;br /&gt;
&lt;br /&gt;
'''LAN IP: 192.168.1.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 echo WAN IP: `wget -q -O - api.myiptest.com | awk -F&amp;quot;\&amp;quot;&amp;quot; '{print $4 &amp;quot; (&amp;quot;$12&amp;quot; &amp;quot;toupper($28)&amp;quot;)&amp;quot;}'`; echo LAN IP: `/sbin/ifconfig wlan0 | awk -F &amp;quot;[: ]&amp;quot; '/Bc/ {print $13}'`&lt;br /&gt;
&lt;br /&gt;
Output example:&lt;br /&gt;
&lt;br /&gt;
'''WAN IP: 1.2.3.4 (ISP CountryCode)'''&lt;br /&gt;
&lt;br /&gt;
'''LAN IP: 192.168.1.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 echo WAN IP: `wget -q -O - api.myiptest.com | awk -F&amp;quot;\&amp;quot;&amp;quot; '{print $4&amp;quot; (&amp;quot;$12&amp;quot; @ &amp;quot;$20&amp;quot;, &amp;quot;toupper($28)&amp;quot;)&amp;quot;}'`; echo LAN IP: `/sbin/ifconfig wlan0 | awk -F &amp;quot;[: ]&amp;quot; '/Bc/ {print $13}'`&lt;br /&gt;
&lt;br /&gt;
Output example:&lt;br /&gt;
&lt;br /&gt;
'''WAN IP: 1.2.3.4 (ISP @ City, CountryCode)'''&lt;br /&gt;
&lt;br /&gt;
'''LAN IP: 192.168.1.2'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====External (WAN)====&lt;br /&gt;
&lt;br /&gt;
 wget -q -O - api.myiptest.com | awk -F&amp;quot;\&amp;quot;&amp;quot; '{print $4}'&lt;br /&gt;
&lt;br /&gt;
Output example: '''1.2.3.4'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 wget -q -O - api.myiptest.com | awk -F&amp;quot;\&amp;quot;&amp;quot; '{print $4 &amp;quot; (&amp;quot;$12&amp;quot; &amp;quot;toupper($28)&amp;quot;)&amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
Output example: '''1.2.3.4 (ISP CountryCode)'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 wget -q -O - api.myiptest.com | awk -F&amp;quot;\&amp;quot;&amp;quot; '{print $4&amp;quot; (&amp;quot;$12&amp;quot; @ &amp;quot;$20&amp;quot;, &amp;quot;toupper($28)&amp;quot;)&amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
Output example: '''1.2.3.4 (ISP @ City, CountryCode)'''&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; '/Bc/ {print $13}'&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;
&lt;br /&gt;
===Disk usage===&lt;br /&gt;
&lt;br /&gt;
====rootfs (256MB /) percentage used====&lt;br /&gt;
&lt;br /&gt;
 df | awk '$1 == &amp;quot;rootfs&amp;quot; {print $5}'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====rootfs (256MB /) free space====&lt;br /&gt;
&lt;br /&gt;
 df -h | awk '$1 == &amp;quot;rootfs&amp;quot; {print $4}'&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 '/My/ {print $5}'&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 '/My/ {print $4}'&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 '/ho/ {print $5}'&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 '/ho/ {print $4}'&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 '/mm/ {print $5}'&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 '/mm/ {print $4}'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Wi-Fi signal===&lt;br /&gt;
&lt;br /&gt;
====Link quality====&lt;br /&gt;
&lt;br /&gt;
 awk -F &amp;quot;[. ]&amp;quot; '/0/ {print $6&amp;quot; %&amp;quot;}' /proc/net/wireless&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====RSSI====&lt;br /&gt;
&lt;br /&gt;
 awk '/0/ {print $4&amp;quot; dBm&amp;quot;}' /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; '/0/ {print $12&amp;quot; dBm&amp;quot;}' /proc/net/wireless&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===CPU frequency===&lt;br /&gt;
&lt;br /&gt;
 awk '{print $1/1000&amp;quot; MHz&amp;quot;}' /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Memory usage===&lt;br /&gt;
&lt;br /&gt;
====RAM used====&lt;br /&gt;
&lt;br /&gt;
 awk '/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)}' /proc/meminfo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====RAM free====&lt;br /&gt;
&lt;br /&gt;
 awk '/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)}' /proc/meminfo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Swap used====&lt;br /&gt;
&lt;br /&gt;
 awk '/pT/ {swpttl = $2}; /pF/ {swpfre = $2} END {printf (&amp;quot;%.1f MB\n&amp;quot;,(swpttl-swpfre)/1024)}' /proc/meminfo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Swap free====&lt;br /&gt;
&lt;br /&gt;
 awk '/pF/ {printf (&amp;quot;%.1f MB\n&amp;quot;,$2/1024)}' /proc/meminfo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Total memory used====&lt;br /&gt;
&lt;br /&gt;
 awk '/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)}' /proc/meminfo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Total memory free====&lt;br /&gt;
&lt;br /&gt;
 awk '/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)}' /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;
&lt;br /&gt;
====Download and upload combined====&lt;br /&gt;
&lt;br /&gt;
 rx=`gconftool-2 -g /system/osso/connectivity/network_type/GPRS/gprs_rx_bytes`; tx=`gconftool-2 -g /system/osso/connectivity/network_type/GPRS/gprs_tx_bytes`; echo $(($tx + $rx)) | awk '{printf (&amp;quot;%.1f MB\n&amp;quot;,$1/1048576)}'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Download and upload separated====&lt;br /&gt;
&lt;br /&gt;
 echo `gconftool-2 -g /system/osso/connectivity/network_type/GPRS/gprs_rx_bytes | awk '{printf (&amp;quot;Download: %.1f MB\n&amp;quot;,$1/1048576)}'`; echo `gconftool-2 -g /system/osso/connectivity/network_type/GPRS/gprs_tx_bytes | awk '{printf (&amp;quot;Upload: %.1f MB\n&amp;quot;,$1/1048576)}'`&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) '''Tue, 4.5.2010'''. 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 ''London: 13:04 | Denver: 06:04''&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;
===Uptime and load===&lt;br /&gt;
&lt;br /&gt;
These scripts are formatproof meaning that they display what they'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 's/.*up */uptime: /' -e 's/ average//' -e 's/  / /'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Uptime====&lt;br /&gt;
&lt;br /&gt;
 uptime | sed -e 's/.*p *//' -e 's/, l.*//' -e 's/  / /'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Load====&lt;br /&gt;
&lt;br /&gt;
 uptime | sed 's/.*e: //'&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'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't always work. Sometimes the value returned is wrong or constant. It needs to be tested further.&lt;br /&gt;
&lt;br /&gt;
 echo `cat /sys/devices/platform/omap34xx_temp/temp1_input` °C&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'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;
&lt;br /&gt;
===Top processes===&lt;br /&gt;
&lt;br /&gt;
This script displays top ''N'' CPU consuming processes. It excludes top itself, which is quite processor intensive so you probably don't want this updating too often. Modify ''N=3'' 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 '{OFS = &amp;quot;\t&amp;quot;} {print $7,$8}'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Scripts for buttons==&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 update DCEW to at least version 1.0, which is currently in Extras-devel.&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;
'''conn-disconn.sh'''&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 if [ `/sbin/route | awk '/au/ {print $1}'` = 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;
 rootsh /path/to/script/wifi.sh | echo &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''wifi.sh script:'''&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:'Wi-Fi disabled'&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'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(':')&lt;br /&gt;
  hw_addr = struct.pack('BBBBBB', 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 = '\xff' * 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, ('192.168.1.255', 9))&lt;br /&gt;
  s.close()&lt;br /&gt;
 # Example use&lt;br /&gt;
 WakeOnLan('00:13:21:00:62:AE')&lt;br /&gt;
Don'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;
'''2g3g.sh script:'''&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 '/b/ {print $2}'` -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'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;' '/at/ {print $2}') 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;' '/at/ {print $2}') org.bluez.Adapter.SetProperty string:Powered variant:boolean:false | echo &amp;quot;&amp;quot;&lt;br /&gt;
&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;
===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:'3' | 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;
'''email.sh script:'''&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;
 rootsh echo 600000 &amp;gt; /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq | 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'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 '{print $1/1000&amp;quot; MHz&amp;quot;}' /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;
 rootsh reboot | 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 '^state=enabled' ; echo $? ; fi) | /usr/bin/awk -F '=' '($1==&amp;quot;state&amp;quot;) {print $2}'&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;
&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;
[[Category:Software]]&lt;br /&gt;
[[Category:Power users]]&lt;/div&gt;</description>
			<pubDate>Sat, 08 May 2010 12:38:52 GMT</pubDate>			<dc:creator>82.95.81.43</dc:creator>			<comments>http://bugs.maemo.com/Talk:Desktop_Command_Execution_Widget_scripts</comments>		</item>
	</channel>
</rss>