Editing Phone control

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
-
{{ambox
 
-
| type = notice
 
-
| image=
 
-
| text = '''This page is about controlling your Nokia device.  For historical reasons this page is called '''phone''' control even though it really covers more than just the phone functions.'''
 
-
}}
 
-
 
-
 
{{Recommended phone usage}}
{{Recommended phone usage}}
-
==D-Bus==
+
=D-Bus=
-
These D-Bus commands can be run from terminal or as shell scripts. Useful for scheduling events with [[alarmed]] or [[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:
+
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:
  run-standalone.sh SCRIPT.sh
  run-standalone.sh SCRIPT.sh
Line 19: Line 12:
Also note that most commands don't need "--print-reply" option. Those that don't need it should be '''tested without it''' and this page should be edited.
Also note that most commands don't need "--print-reply" option. Those that don't need it should be '''tested without it''' and this page should be edited.
-
===Phone===
 
-
====Open Phone application====
+
==Phone==
 +
 
 +
===Open Phone application===
  dbus-send --type=method_call --dest=com.nokia.HildonDesktop.AppMgr /com/nokia/HildonDesktop/AppMgr com.nokia.HildonDesktop.AppMgr.LaunchApplication string:"rtcom-call-ui"
  dbus-send --type=method_call --dest=com.nokia.HildonDesktop.AppMgr /com/nokia/HildonDesktop/AppMgr com.nokia.HildonDesktop.AppMgr.LaunchApplication string:"rtcom-call-ui"
-
====Make a phone call====
+
 
 +
===Make a phone call===
  dbus-send --system --type=method_call --print-reply --dest=com.nokia.csd.Call /com/nokia/csd/call com.nokia.csd.Call.CreateWith string:"$NUMBER" uint32:0
  dbus-send --system --type=method_call --print-reply --dest=com.nokia.csd.Call /com/nokia/csd/call com.nokia.csd.Call.CreateWith string:"$NUMBER" uint32:0
Line 31: Line 26:
Change $NUMBER to phone number you want to call.
Change $NUMBER to phone number you want to call.
-
====End current phone call====
+
 
 +
===End current phone call===
  dbus-send --system --print-reply --dest=com.nokia.csd.Call /com/nokia/csd/call com.nokia.csd.Call.Release
  dbus-send --system --print-reply --dest=com.nokia.csd.Call /com/nokia/csd/call com.nokia.csd.Call.Release
Line 37: Line 33:
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.
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.
-
====Answer current phone call====
+
===Answer current phone call===
  dbus-send --system --print-reply --dest=com.nokia.csd.Call /com/nokia/csd/call/1 com.nokia.csd.Call.Instance.Answer
  dbus-send --system --print-reply --dest=com.nokia.csd.Call /com/nokia/csd/call/1 com.nokia.csd.Call.Instance.Answer
Line 43: Line 39:
This will answer/pickup the current (first) call.  
This will answer/pickup the current (first) call.  
-
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 <code>com.nokia.csd.Call.Error.NotAllowed</code> exception.
+
If you answer the call immediately as you receive the Call Coming DBUS message the phone seems to be in a specific call state where answering yields a <tt>com.nokia.csd.Call.Error.NotAllowed</tt> exception.
You need to answer the call after a delay of e.g. 1 s.
You need to answer the call after a delay of e.g. 1 s.
-
Another (probably better) approach is to register to the CallStatus D-Bus message (<code>com.nokia.csd.Call</code>, <code>/com/nokia/csd/call/1</code>, <code>com.nokia.csd.Call.Instance.CallStatus</code>) and wait for a call status >= 2 (=<code>CSD_CALL_STATUS_COMING</code>) after the "Coming" message.
+
Another (probably better) approach is to register to the CallStatus DBUS message (<tt>com.nokia.csd.Call</tt>, <tt>/com/nokia/csd/call/1</tt>, <tt>com.nokia.csd.Call.Instance.CallStatus</tt>) and wait for a call status >= 2 (=<tt>CSD_CALL_STATUS_COMING</tt>) after the "Coming" message.
-
====Call "starhash code"====
+
===Get [[:wikipedia:International_Mobile_Equipment_Identity|IMEI]]===
 +
dbus-send --system --type=method_call --print-reply --dest=com.nokia.phone.SIM /com/nokia/phone/SIM/security Phone.Sim.Security.get_imei
-
For example '''*100#'''.
 
-
dbus-send --system --type=method_call --dest=com.nokia.CallUI /com/nokia/CallUI com.nokia.CallUI.HandleMMICode string:"*100#"
 
 +
===Get [[:wikipedia:International_Mobile_Subscriber_Identity|IMSI]]===
-
====Activate call forwarding====
+
dbus-send --system --type=method_call --print-reply --dest=com.nokia.phone.SIM /com/nokia/phone/SIM Phone.Sim.get_imsi
-
+
-
Forward '''all ('unconditional') calls''' to e.g. +12223456789
 
-
dbus-send --system --type=method_call --print-reply --dest=com.nokia.csd.SS /com/nokia/csd/ss com.nokia.csd.SS.DivertActivate uint32:'''0''' string:"+12223456789" uint32:
 
-
or
 
-
dbus-send --system --type=method_call --print-reply --dest=com.nokia.csd.SS /com/nokia/csd/ss com.nokia.csd.SS.DivertActivate uint32:'''1''' string:"+12223456789" uint32:
 
-
----
+
===Get cellular signal strength===
-
 
+
-
Forward '''calls when 'busy'''' to e.g. +12223456789
+
-
dbus-send --system --type=method_call --print-reply --dest=com.nokia.csd.SS /com/nokia/csd/ss com.nokia.csd.SS.DivertActivate uint32:'''2''' string:"+12223456789" uint32:
+
-
 
+
-
----
+
-
 
+
-
Forward '''unanswered calls''' to e.g. +12223456789 (leaving the last uint32: empty will use the last stored waiting time)
+
-
dbus-send --system --type=method_call --print-reply --dest=com.nokia.csd.SS /com/nokia/csd/ss com.nokia.csd.SS.DivertActivate uint32:'''3''' string:"+12223456789" uint32:
+
-
 
+
-
Forward '''unanswered calls, when 'no answer' after 25 sec''' to e.g. +12223456789 (if you want to set this value explicitly; valid values: 5, 10, 15, 20, 25, 30)
+
-
dbus-send --system --type=method_call --print-reply --dest=com.nokia.csd.SS /com/nokia/csd/ss com.nokia.csd.SS.DivertActivate uint32:'''3''' string:"+12223456789" uint32:'''25'''
+
-
 
+
-
----
+
-
 
+
-
Forward '''calls when you are 'out of reach' (no network, shut off, ...)''' to e.g. +12223456789
+
-
dbus-send --system --type=method_call --print-reply --dest=com.nokia.csd.SS /com/nokia/csd/ss com.nokia.csd.SS.DivertActivate uint32:'''4''' string:"+12223456789" uint32:
+
-
 
+
-
----
+
-
 
+
-
Forward '''calls when 'not available' (busy, no answer, out of reach)''' to e.g. +12223456789
+
-
dbus-send --system --type=method_call --print-reply --dest=com.nokia.csd.SS /com/nokia/csd/ss com.nokia.csd.SS.DivertActivate uint32:'''5''' string:"+12223456789" uint32:
+
-
 
+
-
--[[User:peterleinchen|peterleinchen]] 23:00, 15 December 2011 (UTC)
+
-
 
+
-
many thanks to the pre-contributor (I have searched for a long time to have the possibility to switch forwarding script based)
+
-
 
+
-
====Cancel call forwarding====
+
-
dbus-send --system --type=method_call --print-reply --dest=com.nokia.csd.SS
+
-
/com/nokia/csd/ss com.nokia.csd.SS.DivertCancel uint32:'''x''' string: uint32:
+
-
Valid values for "x", pls see also above.
+
-
0 unconditional
+
-
 
+
-
1 unconditional
+
-
 
+
-
2 busy
+
-
 
+
-
3 no answer (after xx sec)
+
-
 
+
-
4 out of reach
+
-
 
+
-
5 not available (busy, no answer, out of reach)
+
-
 
+
-
--[[User:peterleinchen|peterleinchen]] 23:00, 15 December 2011 (UTC)
+
-
 
+
-
 
+
-
====Get [[:wikipedia:International_Mobile_Equipment_Identity|IMEI]]====
+
-
 
+
-
dbus-send --system --type=method_call --print-reply --dest=com.nokia.phone.SIM /com/nokia/phone/SIM/security Phone.Sim.Security.get_imei|awk -F "\"" '/g/ {print $2}'
+
-
 
+
-
====Get [[:wikipedia:International_Mobile_Subscriber_Identity|IMSI]]====
+
-
 
+
-
dbus-send --system --type=method_call --print-reply --dest=com.nokia.phone.SIM /com/nokia/phone/SIM Phone.Sim.get_imsi|awk -F "\"" '/g/ {print $2}'
+
-
 
+
-
====Get [[:wikipedia:Subscriber_identity_module#ICCID|ICCID]]====
+
-
 
+
-
dbus-send --system --type=method_call --print-reply --dest=com.nokia.phone.SSC /com/nokia/phone/SSC com.nokia.phone.SSC.get_iccid|awk -F "\"" '/g/ {print $2}'
+
-
 
+
-
====Get SIM status====
+
-
 
+
-
dbus-send --system --print-reply --dest=com.nokia.phone.SIM /com/nokia/phone/SIM Phone.Sim.get_sim_status
+
-
 
+
-
====Get cellular signal strength====
+
  dbus-send --system --print-reply --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.get_signal_strength
  dbus-send --system --print-reply --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.get_signal_strength
Line 132: Line 61:
First line is percentage, second is dBm, third unknown.
First line is percentage, second is dBm, third unknown.
-
====Get cellular registration status====
+
===Get cellular registration status===
  dbus-send --system --print-reply --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.get_registration_status
  dbus-send --system --print-reply --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.get_registration_status
-
====Turn loudspeaker on====
+
===Turn loudspeaker on===
  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
  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
-
(These loudspeaker ones don't work on my N900. If I add --print-reply I get "Error org.freedesktop.DBus.Error.ServiceUnknown: The name com.nokia.osso_hp_ls_controller was not provided by any .service files".)
+
===Turn loudspeaker off===
-
 
+
-
====Turn loudspeaker off====
+
  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
  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
-
====Turn loudspeaker on (N900)====
+
===Start vibrating===
-
 
+
-
dbus-send --type=method_call --dest=org.maemo.Playback.Manager /org/maemo/Playback/Manager org.maemo.Playback.Manager.RequestPrivacyOverride boolean:true
+
-
 
+
-
====Turn loudspeaker off (N900)====
+
-
dbus-send --type=method_call --dest=org.maemo.Playback.Manager /org/maemo/Playback/Manager org.maemo.Playback.Manager.RequestPrivacyOverride boolean:false
+
-
 
+
-
====Turn mute on (N900)====
+
-
 
+
-
dbus-send --type=method_call --dest=org.maemo.Playback.Manager /org/maemo/Playback/Manager org.maemo.Playback.Manager.RequestMute boolean:true
+
-
 
+
-
====Turn mute off (N900)====
+
-
dbus-send --type=method_call --dest=org.maemo.Playback.Manager /org/maemo/Playback/Manager org.maemo.Playback.Manager.RequestMute boolean:false
+
-
 
+
-
====Turn bluetooth override on (N900)====
+
-
 
+
-
dbus-send --type=method_call --dest=org.maemo.Playback.Manager /org/maemo/Playback/Manager org.maemo.Playback.Manager.RequestBluetoothOverride boolean:true
+
-
 
+
-
====Turn bluetooth override off (N900)====
+
-
dbus-send --type=method_call --dest=org.maemo.Playback.Manager /org/maemo/Playback/Manager org.maemo.Playback.Manager.RequestBluetoothOverride boolean:false
+
-
 
+
-
====Start Vibrating Incoming Call====
+
  dbus-send --system --print-reply --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_vibrator_pattern_activate string:PatternIncomingCall
  dbus-send --system --print-reply --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_vibrator_pattern_activate string:PatternIncomingCall
-
PatternXXX according to definition in /etc/mce/mce.ini
 
-
====Stop Vibrating Incoming Call====
+
===Stop vibrating===
  dbus-send --system --print-reply --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_vibrator_pattern_deactivate string:PatternIncomingCall
  dbus-send --system --print-reply --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_vibrator_pattern_deactivate string:PatternIncomingCall
-
====Vibration Single Shot====
+
==Profiles==
-
dbus-send --system --print-reply --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_start_manual_vibration int32:255 int32:1000
+
-
First int is power, second is duration in milliseconds
+
===Set General===
-
===Profiles===
+
dbus-send --type=method_call --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.set_profile string:"general"
-
====Set General====
 
-
 
-
dbus-send --type=method_call --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.set_profile string:"general"
 
-
====Set Silent====
+
===Set Silent===
  dbus-send --type=method_call --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.set_profile string:"silent"
  dbus-send --type=method_call --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.set_profile string:"silent"
-
 
+
===Query current profile===
-
====Query current profile====
+
  dbus-send --type=method_call --print-reply --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.get_profile
  dbus-send --type=method_call --print-reply --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.get_profile
-
====List all profiles====
 
-
dbus-send --type=method_call --print-reply --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.get_profiles|awk -F "\"" '/g/ {print $2}'
+
===List all profiles===
-
====Get all profile Values====
+
dbus-send --type=method_call --print-reply --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.get_profiles
-
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 "silent" just put "silent" at the end instead of "general".)
 
-
dbus-send --type=method_call --print-reply --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.get_values string:"general"
+
==LED==
-
The returned value is an array of struct. Each struct has 3 strings: key, value, type. Type can be eg. "INTEGER 0-2" saying that the values 0, 1 and 2 are correct values for this key.
+
===Activate LEDs===
-
 
+
-
====Set a profile value====
+
-
 
+
-
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 "general" or "silent", key is one of the keys from the above (get all profile values), value can be set to anything allowed by "type" from the above method.
+
-
 
+
-
To enable vibrating alert for the profile "general" your script would look like this:
+
-
 
+
-
dbus-send --type=method_call --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.set_value string:"general" string:"vibrating.alert.enabled" string:"On"
+
-
 
+
-
===LED===
+
-
 
+
-
====Activate LEDs====
+
  dbus-send --system --type=method_call --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_led_pattern_activate string:"PatternCommunicationIM"
  dbus-send --system --type=method_call --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_led_pattern_activate string:"PatternCommunicationIM"
-
====Deactivate LEDs====
 
-
dbus-send --system --type=method_call --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_led_pattern_deactivate string:"PatternCommunicationIM"
+
===Deactivate LEDs===
-
====Set brightness of backlight LEDs====
+
dbus-send --system --type=method_call --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_led_pattern_deactivate string:"PatternCommunicationIM"
-
dbus-send --print-reply --system --dest=org.freedesktop.Hal /org/freedesktop/Hal/devices/computer_backlight org.freedesktop.Hal.Device.LaptopPanel.SetBrightness int32:$brightness
 
-
(where $brightness is 0...255)
+
==Messaging==
-
===Messaging===
+
===New e-mail===
-
 
+
-
====New e-mail====
+
  dbus-send --type=method_call --dest=com.nokia.modest /com/nokia/modest com.nokia.modest.MailTo string:"mailto:"
  dbus-send --type=method_call --dest=com.nokia.modest /com/nokia/modest com.nokia.modest.MailTo string:"mailto:"
-
====Send and receive e-mail====
+
 
 +
===Send and receive e-mail===
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.
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.
Line 246: Line 129:
  dbus-send --type=method_call --dest=com.nokia.modest /com/nokia/modest com.nokia.modest.SendReceive
  dbus-send --type=method_call --dest=com.nokia.modest /com/nokia/modest com.nokia.modest.SendReceive
-
====Set presence====
+
===Set presence===
  dbus-send --type=method_call --print-reply --dest=org.freedesktop.Telepathy.MissionControl /org/freedesktop/Telepathy/MissionControl org.freedesktop.Telepathy.MissionControl.SetPresence uint32:2 string:"I'm here"
  dbus-send --type=method_call --print-reply --dest=org.freedesktop.Telepathy.MissionControl /org/freedesktop/Telepathy/MissionControl org.freedesktop.Telepathy.MissionControl.SetPresence uint32:2 string:"I'm here"
-
Note: This method does not work in Maemo 5. Workaround: http://talk.maemo.org/showthread.php?t=55686
+
===Change peak_schedule settings===
-
 
+
-
====Change peak_schedule settings====
+
Check:
Check:
Line 261: Line 142:
Where the last number is one of the following (as standard in GUI):
Where the last number is one of the following (as standard in GUI):
-
* '''0''' = Always on
+
'''0''' = Always on
-
* '''-1''' = Manual
+
-
* '''15''' = Every 15 minutes
+
-
* '''30''' = Every 30 minutes
+
-
* '''60''' = Every hour
+
-
* '''240''' = Every 4 hours
+
-
* '''720''' = Every 12 hours
+
-
===Media player===
+
'''-1''' = Manual
-
====Open file in media player====
+
'''15''' = Every 15 minutes
 +
 
 +
'''30''' = Every 30 minutes
 +
 
 +
'''60''' = Every hour
 +
 
 +
'''240''' = Every 4 hours
 +
 
 +
'''720''' = Every 12 hours
 +
 
 +
==Media player==
 +
 
 +
 
 +
===Open file in media player===
  dbus-send --print-reply --dest=com.nokia.mediaplayer /com/nokia/mediaplayer com.nokia.mediaplayer.mime_open string:"file:///$1"
  dbus-send --print-reply --dest=com.nokia.mediaplayer /com/nokia/mediaplayer com.nokia.mediaplayer.mime_open string:"file:///$1"
-
====Pause what's currently playing====
+
===Pause what's currently playing===
  dbus-send --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.pause
  dbus-send --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.pause
-
====Stop what's currently playing====
+
 
 +
===Stop what's currently playing===
  dbus-send --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.stop
  dbus-send --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.stop
-
====Play what's currently selected====
+
 
 +
===Play what's currently selected===
  dbus-send --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.play
  dbus-send --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.play
-
====Unpause what's currently selected====
 
-
dbus-send --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.resume
+
===Play next mediafile===
-
 
+
-
====Play next mediafile====
+
  dbus-send --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.next
  dbus-send --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.next
-
====Play previous mediafile====
+
 
 +
===Play previous mediafile===
  dbus-send --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.previous
  dbus-send --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.previous
-
===Notifications===
+
==Notifications==
-
====Send notification (orange one line popup)====
+
===Send notification (orange one line popup)===
  dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"NOTIFICATION"
  dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"NOTIFICATION"
-
====Send notification (orange multiple line popup)====
 
-
dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"NOTE line 1
+
===Send dialog notification (orange multi line popup requiring user interaction)===
-
line 2
+
-
. . .
+
-
line n"
+
-
--[[User:peterleinchen|peterleinchen]] 00:22, 4 January 2012 (UTC)
+
-
 
+
-
====Send dialog notification (orange multi line popup, requiring user interaction)====
+
  dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteDialog string:"QUESTION?" uint32:0 string:"OK"
  dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteDialog string:"QUESTION?" uint32:0 string:"OK"
Line 319: Line 200:
Not sure what string "OK" does, but it is needed and can be anything.
Not sure what string "OK" does, but it is needed and can be anything.
-
It does nothing here and is not explicitly needed, pls. see below command and also section.
 
-
dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteDialog string:"QUESTION?" uint32: string:
 
-
====Send dialog notification (black/white with floating bar and confirmation button, requiring user action)====
+
==Securing==
-
dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteDialog string:"QUESTION?" uint32:'''4''' string:"OK"
+
===Lock===
-
 
+
-
String "OK" is the text for the button.
+
-
--[[User:peterleinchen|peterleinchen]] 21:29, 3 January 2012 (UTC)
+
-
 
+
-
====Send email/SMS style notification====
+
-
see http://wiki.maemo.org/Phone_control#Make_an_.22Email_Style.22_notification_dialog
+
-
 
+
-
===Securing===
+
-
 
+
-
====Security Device Lock (with lockcode)====
+
  dbus-send --system --type=method_call --dest=com.nokia.system_ui /com/nokia/system_ui/request com.nokia.system_ui.request.devlock_open string:"com.nokia.mce" string:"/com/nokia/mce/request" string:"com.nokia.mce.request" string:"devlock_callback" uint32:'3'
  dbus-send --system --type=method_call --dest=com.nokia.system_ui /com/nokia/system_ui/request com.nokia.system_ui.request.devlock_open string:"com.nokia.mce" string:"/com/nokia/mce/request" string:"com.nokia.mce.request" string:"devlock_callback" uint32:'3'
-
The next method is a 2nd - surprisingly shorter - way to enter device lock mode. Its benefit is that it even disables the device power button menu:
 
-
 
-
dbus-send --system --type=method_call --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.devlock_callback int32:0
 
-
====Unlock (pop up lockcode requester?)====
+
===Unlock===
  dbus-send --system --type=method_call --dest=com.nokia.system_ui /com/nokia/system_ui/request com.nokia.system_ui.request.devlock_close string:"com.nokia.mce" string:"/com/nokia/mce/request" string:"com.nokia.mce.request" string:"devlock_callback" uint32:'0'
  dbus-send --system --type=method_call --dest=com.nokia.system_ui /com/nokia/system_ui/request com.nokia.system_ui.request.devlock_close string:"com.nokia.mce" string:"/com/nokia/mce/request" string:"com.nokia.mce.request" string:"devlock_callback" uint32:'0'
-
Next method is a 2nd, more direct way to stop device lock mode.
 
-
dbus-send --system --type=method_call --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.devlock_callback int32:2
+
===Lock screen and keys===
-
====Query Devlock State====
+
dbus-send --system --type=method_call --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_tklock_mode_change string:"locked"
-
  dbus-send --system --type=method_call --dest="com.nokia.mce" --print-reply "/com/nokia/mce/request" com.nokia.mce.request.get_devicelock_mode |awk -F "\"" '/g/ {print $2}'
 
-
 
-
 
-
====Lock screen and keys (slider lockswitch)====
 
-
 
-
dbus-send --system --type=method_call --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_tklock_mode_change string:"locked"
 
-
====Unlock screen and keys====
+
===Unlock screen and keys===
-
This command will unlock and illuminate the screen (useful when accessing the phone externally through [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY])
 
  dbus-send --system --type=method_call --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_tklock_mode_change string:"unlocked"
  dbus-send --system --type=method_call --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_tklock_mode_change string:"unlocked"
-
====Query lock state of screen and keys====
 
-
Will return ''locked'' or ''unlocked'' depending on lock state
+
==Networking==
-
dbus-send --system --type=method_call --dest="com.nokia.mce" --print-reply "/com/nokia/mce/request" com.nokia.mce.request.get_tklock_mode|awk -F "\"" '/g/ {print $2}'
+
-
===Networking===
+
===Connect to specific saved connection===
-
 
+
-
====Enable ICD log====
+
-
There are two methods to enable ICD logs
+
-
 
+
-
1. Print to the syslog:
+
-
  (1)Use the following cmd
+
-
  (2)$ syslogd
+
-
  (3)$ icd2 –l0
+
-
  (4)The log will print to the /var/log/syslog
+
-
2. Print to the standard output 
+
-
  (1)Get the source code of icd2
+
-
  (2)Add the begging of source code of “support/osso-log.h” "#define OSSOLOG_STDOUT"
+
-
  (3)$ icd2 –l0
+
-
  (4)The log will print to the standard output
+
-
 
+
-
====Connect to specific saved connection====
+
  dbus-send --system --type=method_call --dest=com.nokia.icd /com/nokia/icd com.nokia.icd.connect string:"IAP_ID" uint32:0
  dbus-send --system --type=method_call --dest=com.nokia.icd /com/nokia/icd com.nokia.icd.connect string:"IAP_ID" uint32:0
Line 400: Line 240:
If not, an error message will occur if you add --print-reply to the dbus-send command.
If not, an error message will occur if you add --print-reply to the dbus-send command.
-
====Connect to any saved connection====
+
===Connect to any saved connection===
  dbus-send --system --type=method_call --dest=com.nokia.icd /com/nokia/icd com.nokia.icd.connect string:"[ANY]" uint32:0
  dbus-send --system --type=method_call --dest=com.nokia.icd /com/nokia/icd com.nokia.icd.connect string:"[ANY]" uint32:0
-
====Disconnect internet====
 
-
=====ICD2=====
+
===Disconnect internet===
-
dbus-send --print-reply --system --dest=com.nokia.icd2 /com/nokia/icd2 com.nokia.icd2.disconnect_req uint32:0x8000
+
====ICD2====
-
=====ICD=====
+
dbus-send --print-reply --system --dest=com.nokia.icd2 /com/nokia/icd2 com.nokia.icd2.disconnect_req uint32:0x8000
 +
====ICD====
  dbus-send --system --dest=com.nokia.icd /com/nokia/icd_ui com.nokia.icd_ui.disconnect boolean:true
  dbus-send --system --dest=com.nokia.icd /com/nokia/icd_ui com.nokia.icd_ui.disconnect boolean:true
-
On [[Maemo 5/PR1.2|PR1.2]] :
+
On PR1.2 :
Error org.freedesktop.DBus.Error.UnknownMethod: Method "disconnect" with signature "b" on interface "com.nokia.icd_ui" doesn't exist
Error org.freedesktop.DBus.Error.UnknownMethod: Method "disconnect" with signature "b" on interface "com.nokia.icd_ui" doesn't exist
-
====Connect (show change connection UI)====
+
===Connect (show change connection UI)===
  dbus-send --system --type=method_call --dest=com.nokia.icd_ui /com/nokia/icd_ui com.nokia.icd_ui.show_conn_dlg boolean:false
  dbus-send --system --type=method_call --dest=com.nokia.icd_ui /com/nokia/icd_ui com.nokia.icd_ui.show_conn_dlg boolean:false
-
If "boolean:true" at the end, one-line notification saying "No saved connections available" 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.
+
If "boolean:true" at the end, one-line notification saying "No saved connections available" appears. Maybe affects more than that?
-
====Enable cellular radio====
+
 
 +
===Enable cellular radio===
  dbus-send --system --type=method_call --dest=com.nokia.phone.SSC /com/nokia/phone/SSC com.nokia.phone.SSC.set_radio boolean:true
  dbus-send --system --type=method_call --dest=com.nokia.phone.SSC /com/nokia/phone/SSC com.nokia.phone.SSC.set_radio boolean:true
-
====Disable cellular radio====
+
 
 +
===Disable cellular radio===
  dbus-send --system --type=method_call --dest=com.nokia.phone.SSC /com/nokia/phone/SSC com.nokia.phone.SSC.set_radio boolean:false
  dbus-send --system --type=method_call --dest=com.nokia.phone.SSC /com/nokia/phone/SSC com.nokia.phone.SSC.set_radio boolean:false
-
====Change device mode====
 
-
String possibility "offline","flight","normal"
+
==Radio mode==
-
dbus-send --system --dest=com.nokia.mce --type=method_call /com/nokia/mce/request com.nokia.mce.request.req_device_mode_change string:offline
+
===2G===
-
====Query device mode====
+
dbus-send --system --type=method_call --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.set_selected_radio_access_technology byte:1
-
dbus-send --system --dest=com.nokia.mce --type=method_call --print-reply /com/nokia/mce/request com.nokia.mce.request.get_device_mode | awk -F "\"" '/g/ {print $2}'
 
-
===Radio mode===
+
===3G===
-
====Current Mode====
+
dbus-send --system --type=method_call --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.set_selected_radio_access_technology byte:2
-
dbus-send --system --print-reply --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.get_radio_access_technology
 
-
====2G====
+
===Dual===
-
  dbus-send --system --type=method_call --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.set_selected_radio_access_technology byte:1
+
  dbus-send --system --type=method_call --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.set_selected_radio_access_technology byte:0
-
====3G====
 
-
dbus-send --system --type=method_call --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.set_selected_radio_access_technology byte:2
+
==Bluetooth==
-
====Dual====
+
===Identify adapter path===
-
 
+
-
dbus-send --system --type=method_call --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.set_selected_radio_access_technology byte:0
+
-
 
+
-
===Bluetooth===
+
-
 
+
-
====Identify adapter path====
+
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:
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:
  dbus-send --system --print-reply --dest=org.bluez / org.bluez.Manager.ListAdapters | awk -F'"' '/at/ {print $2}'
  dbus-send --system --print-reply --dest=org.bluez / org.bluez.Manager.ListAdapters | awk -F'"' '/at/ {print $2}'
-
or
 
-
dbus-send --system --print-reply --dest=org.bluez / org.bluez.Manager.DefaultAdapter | awk -F'"' '/at/ {print $2}'
 
-
 
-
====Identify Properties====
 
-
dbus-send --system --print-reply --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez / org.bluez.Manager.DefaultAdapter | awk -F'"' '/at/ {print $2}') org.bluez.Adapter.GetProperties
 
-
====Enable====
+
===Enable===
-
Using the adapter path value returned with first command, for example ''/org/bluez/906/hci0''.
+
Using the adapter path value returned with previous command, for example ''/org/bluez/906/hci0''.
  dbus-send --system --type=method_call --dest=org.bluez /org/bluez/906/hci0 org.bluez.Adapter.SetProperty string:Powered variant:boolean:true
  dbus-send --system --type=method_call --dest=org.bluez /org/bluez/906/hci0 org.bluez.Adapter.SetProperty string:Powered variant:boolean:true
Line 481: Line 308:
This one automatically inserts adapter path:
This one automatically inserts adapter path:
-
  dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez / org.bluez.Manager.DefaultAdapter | awk -F'"' '/at/ {print $2}') org.bluez.Adapter.SetProperty string:Powered variant:boolean:true
+
  dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez / org.bluez.Manager.ListAdapters | awk -F'"' '/at/ {print $2}') org.bluez.Adapter.SetProperty string:Powered variant:boolean:true
-
====Disable====
+
 
 +
===Disable===
  dbus-send --system --type=method_call --dest=org.bluez /org/bluez/906/hci0 org.bluez.Adapter.SetProperty string:Powered variant:boolean:false
  dbus-send --system --type=method_call --dest=org.bluez /org/bluez/906/hci0 org.bluez.Adapter.SetProperty string:Powered variant:boolean:false
Line 489: Line 317:
With auto-discovery of adapter path:
With auto-discovery of adapter path:
-
  dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez / org.bluez.Manager.DefaultAdapter | awk -F'"' '/at/ {print $2}') org.bluez.Adapter.SetProperty string:Powered variant:boolean:false
+
  dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez / org.bluez.Manager.ListAdapters | awk -F'"' '/at/ {print $2}') org.bluez.Adapter.SetProperty string:Powered variant:boolean:false
-
====Connect to specific device====
+
 
 +
===Connect to specific device===
  devmac=00:11:22:33:44:55
  devmac=00:11:22:33:44:55
  service=AudioSink
  service=AudioSink
   
   
-
  adapter=$(dbus-send --system --print-reply --dest=org.bluez / org.bluez.Manager.DefaultAdapter | awk -F'"' '/at/ {print $2}')
+
  adapter=$(dbus-send --system --print-reply --dest=org.bluez / org.bluez.Manager.ListAdapters | awk -F'"' '/at/ {print $2}')
-
  device=$(dbus-send --system --print-reply --dest=org.bluez ${adapter} org.bluez.Adapter.FindDevice string:${devmac} | awk -F'"' '/at/ {print $2}')
+
  device=$(dbus-send --system --print-reply --dest=org.bluez ${adapter} org.bluez.Adapter.FindDevice string:${devmac} | sed -ne 's/^.*object path //p' -e 's/"//g')
  dbus-send --system --type=method_call --print-reply --dest=org.bluez ${device} org.bluez.${service}.Connect
  dbus-send --system --type=method_call --print-reply --dest=org.bluez ${device} org.bluez.${service}.Connect
-
Change the AudioSink to any service and the devmac to the MAC of bluetooth device.
+
Change the AudoSink to any service and the devmac to the MAC of bluetooth device.
-
===Check for updates===
+
 
 +
==Check for updates==
  dbus-send --type=method_call --dest=com.nokia.hildon_application_manager /com/nokia/hildon_application_manager com.nokia.hildon_application_manager.check_for_updates
  dbus-send --type=method_call --dest=com.nokia.hildon_application_manager /com/nokia/hildon_application_manager com.nokia.hildon_application_manager.check_for_updates
-
===Open link in browser===
+
 
 +
==Open link in browser==
  dbus-send --system --type=method_call --dest=com.nokia.osso_browser /com/nokia/osso_browser/request com.nokia.osso_browser.load_url string:"google.com"
  dbus-send --system --type=method_call --dest=com.nokia.osso_browser /com/nokia/osso_browser/request com.nokia.osso_browser.load_url string:"google.com"
-
===Open a pdf file with the default pdf reader application===
 
-
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
+
==Set volume==
-
 
+
-
===Open a file with the default notes application===
+
-
 
+
-
dbus-send --print-reply --dest=com.nokia.osso_notes /com/nokia/osso_notes com.nokia.osso_notes.mime_open string:/home/user/MyDocs/.documents/file_name
+
-
 
+
-
===Open the default notes application===
+
-
 
+
-
dbus-send --print-reply --dest=com.nokia.osso_notes /com/nokia/osso_notes com.nokia.osso_notes.top_application
+
-
 
+
-
=== Open folder ===
+
-
 
+
-
dbus-send --print-reply --dest=com.nokia.osso_filemanager /com/nokia/osso_filemanager com.nokia.osso_filemanager.open_folder string:/home/user/MyDocs/
+
-
 
+
-
===Set volume===
+
  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
  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
Line 532: Line 348:
The value can be between 0 and 100.
The value can be between 0 and 100.
-
===Get volume===
+
==Reboot==
-
 
+
-
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|awk '/nt/ {print $3}'
+
-
 
+
-
===Reboot===
+
  dbus-send --system --type=method_call --print-reply --dest=com.nokia.mce "/com/nokia/mce/request" com.nokia.mce.request.req_reboot
  dbus-send --system --type=method_call --print-reply --dest=com.nokia.mce "/com/nokia/mce/request" com.nokia.mce.request.req_reboot
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 "reboot" in root terminal.
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 "reboot" in root terminal.
-
Yet another method: dsmetool -b
 
-
===Shutdown===
+
==Shutdown==
  dbus-send --system --type=method_call --print-reply --dest=com.nokia.mce "/com/nokia/mce/request" com.nokia.mce.request.req_shutdown
  dbus-send --system --type=method_call --print-reply --dest=com.nokia.mce "/com/nokia/mce/request" com.nokia.mce.request.req_shutdown
See warning at reboot D-Bus call (needs testing).
See warning at reboot D-Bus call (needs testing).
-
===Show dashboard===
+
 
 +
==Show dashboard==
  dbus-send /com/nokia/hildon_desktop com.nokia.hildon_desktop.exit_app_view
  dbus-send /com/nokia/hildon_desktop com.nokia.hildon_desktop.exit_app_view
-
===Other===
 
-
====D-Bus Scripts====
+
==Other==
 +
 
 +
===D-Bus Scripts===
You can also use [[DbusScripts|dbus-scripts]] to execute any command when various actions are triggered on D-Bus.
You can also use [[DbusScripts|dbus-scripts]] to execute any command when various actions are triggered on D-Bus.
-
====Panucci (pause)====
+
 
 +
===Panucci (pause)===
  dbus-send --type=method_call --dest=org.panucci.panucciInterface /panucciInterface org.panucci.panucciInterface.playPause
  dbus-send --type=method_call --dest=org.panucci.panucciInterface /panucciInterface org.panucci.panucciInterface.playPause
-
====Device Orientation====
 
-
dbus-send --system --print-reply --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.get_device_orientation
+
=GConf=
-
==GConf==
+
==Reset GPRS data counter==
-
 
+
-
===Reset GPRS data counter===
+
The commands are PR1.2 compliant and do not work on previous versions.
The commands are PR1.2 compliant and do not work on previous versions.
Line 576: Line 387:
  gconftool-2 -s /system/osso/connectivity/network_type/GPRS/gprs_home_reset_time --type=string $(date +%s)
  gconftool-2 -s /system/osso/connectivity/network_type/GPRS/gprs_home_reset_time --type=string $(date +%s)
-
==Command line==
 
-
===Enable FM Transmitter===
+
=Command line=
 +
 
 +
==Enable FM Transmitter==
  /usr/bin/fmtx_client -p 1
  /usr/bin/fmtx_client -p 1
-
===Disable FM Transmitter===
+
 
 +
==Disable FM Transmitter==
  /usr/bin/fmtx_client -p 0
  /usr/bin/fmtx_client -p 0
-
==GStreamer==
 
-
===Take a picture with front camera===
+
=GStreamer=
 +
 
 +
==Take a picture with front camera==
  gst-launch v4l2src device=/dev/video1 num-buffers=1 ! ffmpegcolorspace ! jpegenc ! filesink location=frontcam.jpg
  gst-launch v4l2src device=/dev/video1 num-buffers=1 ! ffmpegcolorspace ! jpegenc ! filesink location=frontcam.jpg
-
===Shoot photo after 10 seconds===
+
==Shoot photo after 10 seconds==
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)
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)
Line 606: Line 420:
  /bin/sleep 10; /usr/bin/gst-launch v4l2camsrc ! ffmpegcolorspace ! jpegenc ! identity error-after=1 ! filesink location=/home/user/MyDocs/DCIM/photo.jpg
  /bin/sleep 10; /usr/bin/gst-launch v4l2camsrc ! ffmpegcolorspace ! jpegenc ! identity error-after=1 ! filesink location=/home/user/MyDocs/DCIM/photo.jpg
-
==Python==
+
=Python=
-
===Make a phone call via the cellular network===
+
==Make a phone call==
<source lang="python">
<source lang="python">
Line 620: Line 434:
</source>
</source>
-
=== Make a phone call via SIP ===
+
==Send SMS==
-
<source lang="python">
+
-
#!/usr/bin/python
+
-
 
+
-
import dbus
+
-
import sys
+
-
 
+
-
# Get the target phone number (or SIP address) from the command line
+
-
TARGET = sys.argv[1];
+
-
 
+
-
# Configure the telepathy path to the SofiaSIP account that we wish to use.
+
-
# Use "mc-tool list" (from the libmissioncontrol-utils package) to see your accounts.
+
-
SIP_ACCOUNT = 'sofiasip/sip/_31234567_40sipgate_2eco_2euk0'
+
-
 
+
-
# This gets us a connnection to the session bus
+
-
bus = dbus.SessionBus()
+
-
 
+
-
# This sets up a path to the SIP account within telepathy.
+
-
PATH = '/org/freedesktop/Telepathy/Account/'
+
-
PATH += SIP_ACCOUNT
+
-
 
+
-
# This sets up a proxy object as a "handle" to the AccountManager of our target account
+
-
account = bus.get_object('org.freedesktop.Telepathy.AccountManager', PATH)
+
-
 
+
-
# This launches the actual SIP call with a method call to EnsureChannel on that object
+
-
account.EnsureChannel( \
+
-
        dbus.Dictionary({
+
-
                dbus.String(u'org.freedesktop.Telepathy.Channel.TargetHandleType'): dbus.UInt32(1),
+
-
                dbus.String(u'org.freedesktop.Telepathy.Channel.ChannelType'): dbus.String(u'org.freedesktop.Telepathy.Channel.Type.StreamedMedia'),
+
-
                dbus.String(u'org.freedesktop.Telepathy.Channel.TargetID'): dbus.String(TARGET),
+
-
        }, signature='sv'),
+
-
        dbus.UInt64(0),
+
-
        dbus.String(''),
+
-
        dbus_interface='com.nokia.Account.Interface.ChannelRequests')
+
-
 
+
-
sys.exit(0)
+
-
 
+
-
</source>
+
-
 
+
-
===Send SMS===
+
-
 
+
-
ssms.py using new QtMobility bindings by ossipena:
+
-
 
+
-
<source lang="python">
+
-
#!/usr/bin/env python
+
-
# -*- coding: utf-8 -*-
+
-
 
+
-
#ssms Ossipena/TimoP
+
-
#send smses from command line
+
-
#licence : Do whatever you want
+
-
#deps:
+
-
#pyside-qt4
+
-
#pyside-mobility
+
-
 
+
-
'''imports'''
+
-
from QtMobility.Messaging import *
+
-
from PySide.QtCore import *
+
-
import sys
+
-
from PyQt4 import QtCore
+
-
 
+
-
 
+
-
app = QCoreApplication(sys.argv)
+
-
 
+
-
'''get number and name'''
+
-
stringit = sys.argv
+
-
numpertemp = str(stringit[1:2])
+
-
mesits = str(stringit[2:])[2:-2]
+
-
 
+
-
num = str(numpertemp[2:-2])
+
-
 
+
-
if (mesits == ""):
+
-
  print "Usage:"
+
-
  print "python ssms.py 01234567 'message text here'"
+
-
  sys.exit(69)
+
-
else:
+
-
  print "number is " + str(num)
+
-
  print "message is " + str(mesits)
+
-
 
+
-
'''define message to be sent'''
+
-
numperi = QtCore.QString(num)
+
-
 
+
-
numper = QMessageAddress(QMessageAddress.Phone, numperi)
+
-
mesitsi = QMessage()
+
-
mesitsi.setType(QMessage.Sms)
+
-
mesitsi.setTo(numper)
+
-
mesitsi.setBody(mesits)
+
-
 
+
-
'''send message'''
+
-
sender = QMessageService()
+
-
if (sender.send(mesitsi)):
+
-
  print "success"
+
-
else:
+
-
  print "fail"
+
-
</source>
+
From:
From:
Line 737: Line 458:
</source>
</source>
-
There's also a python script that uses D-Bus instead from http://talk.maemo.org/showpost.php?p=558430&postcount=57:
+
There's also a python script that uses DBUS instead from http://talk.maemo.org/showpost.php?p=558430&postcount=57:
<source lang="python">
<source lang="python">
Line 931: Line 652:
</source>
</source>
-
===Send dialog notification (orange multi line popup requiring user interaction)===
+
==Send dialog notification (orange multi line popup requiring user interaction)==
<source lang="python">
<source lang="python">
Line 946: Line 667:
</source>
</source>
-
This function allows you to show notification either with multiline (on Maemo pre-5 it will show a dialog with an "Ok" button) or single line (tiny notifications hiding automatically).
+
This function allows you to show notification either with multiline (on maemo pre-5 it will show a dialog with an "Ok" button) or single line (tiny notifications hiding automatically).
-
===Take a screenshot===
+
==Take a screenshot==
<source lang="python">
<source lang="python">
-
import gtk.gdk
+
import gtk.gdk
-
 
+
-
w = gtk.gdk.get_default_root_window()
+
w = gtk.gdk.get_default_root_window()
-
sz = w.get_size()
+
sz = w.get_size()
-
print "The size of the window is %d x %d" % sz
+
print "The size of the window is %d x %d" % sz
-
pb = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB,False,8,sz[0],sz[1])
+
pb = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB,False,8,sz[0],sz[1])
-
pb = pb.get_from_drawable(w,w.get_colormap(),0,0,0,0,sz[0],sz[1])
+
pb = pb.get_from_drawable(w,w.get_colormap(),0,0,0,0,sz[0],sz[1])
-
if (pb != None):
+
if (pb != None):
-
  pb.save("screenshot.png","png")
+
  pb.save("screenshot.png","png")
-
  print "Screenshot saved to screenshot.png."
+
  print "Screenshot saved to screenshot.png."
-
else:
+
else:
-
  print "Unable to get the screenshot."
+
  print "Unable to get the screenshot."
</source>
</source>
-
Credits: took code from [http://stackoverflow.com/questions/69645/take-a-screenshot-via-a-python-script-linux here].
+
Credits: took code from [http://stackoverflow.com/questions/69645/take-a-screenshot-via-a-python-script-linux here], where there is also a Qt way to do it.
-
 
+
-
 
+
-
There is also a way using PyQt:
+
-
<source lang="python">
+
-
import sys
+
-
import time
+
-
from PyQt4.QtGui import QPixmap, QApplication
+
-
app = QApplication(sys.argv)
+
-
file = "/home/user/MyDocs/.images/Screenshots/Screenshot-"+time.strftime("%Y%m%d")+"-"+time.strftime("%H%M%S")+".png"
+
-
QPixmap.grabWindow(QApplication.desktop().winId()).save(file, 'png')
+
-
</source>
+
-
 
+
-
===Make an "Email Style" notification dialog===
+
-
 
+
-
<source lang="python">
+
-
import dbus
+
-
 
+
-
bus = dbus.SessionBus()
+
-
proxy = bus.get_object('org.freedesktop.Notifications', '/org/freedesktop/Notifications')
+
-
interface = dbus.Interface(proxy,dbus_interface='org.freedesktop.Notifications')
+
-
interface.Notify('Notification', 0, 'control_bluetooth_paired', 'Testing 123', 'Hello World', [], {}, 0)
+
-
</source>
+
-
 
+
-
Credits: MohammadAG (on irc).
+
-
 
+
-
Additional note by Linkandzelda (on irc):
+
-
The type "control_bluetooth_paired" is the name of the icon used, picked from this folder
+
-
 
+
-
<source lang="bash">
+
-
/usr/share/icons/hicolor/48x48/hildon
+
-
</source>
+
[[Category:Power users]]
[[Category:Power users]]
[[Category:Development]]
[[Category:Development]]

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)

Templates used on this page: