Difference between revisions of "Luna Send"

From WebOS Internals
Jump to navigation Jump to search
m (add backup and WiFi stuff)
m (edited backup luna-send to make so entire Palm backup from only the command line (my screen is bust0r3d won't sense touch anymore...))
Line 1: Line 1:
 
NOTE: You have to run with root perms.
 
NOTE: You have to run with root perms.
  
Kick off a manual Palm Backup:
+
 
 +
Kick off a manual Palm Backup [u]entirely[/u] from the command line:
 
<pre><nowiki>
 
<pre><nowiki>
 +
luna-send -n 1 palm://com.palm.applicationManager/launch '{"id":"com.palm.app.backup"}'
 
luna-send -n 1 palm://com.palm.backup/startBackup '{}'
 
luna-send -n 1 palm://com.palm.backup/startBackup '{}'
 +
luna-send -n 1 palm://com.palm.applicationManager/running '{}'
 +
luna-send -n 1 palm://com.palm.applicationManager/close '{"processId":"(GET ID NUMBER FROM /RUNNING)"}'
 
</nowiki></pre>
 
</nowiki></pre>
  
Connect to any (known) WAP:
+
 
 +
Connect to any (known) WAP in range (or simply turn on WiFi):
 
<pre><nowiki>
 
<pre><nowiki>
 
luna-send -n 1 palm://com.palm.wifi/setstate '{"state":"enabled"}'
 
luna-send -n 1 palm://com.palm.wifi/setstate '{"state":"enabled"}'
 
luna-send -n 1 palm://com.palm.wifi/findnetworks '{""}'
 
luna-send -n 1 palm://com.palm.wifi/findnetworks '{""}'
 
</nowiki></pre>
 
</nowiki></pre>
 +
  
 
Disconnect from WiFi:
 
Disconnect from WiFi:
Line 16: Line 22:
 
luna-send -n 1 palm://com.palm.wifi/setstate '{"state":"disabled"}'
 
luna-send -n 1 palm://com.palm.wifi/setstate '{"state":"disabled"}'
 
</nowiki></pre>
 
</nowiki></pre>
 +
  
 
Using luna-send to refresh the Launcher panel.
 
Using luna-send to refresh the Launcher panel.
Line 21: Line 28:
 
luna-send -n 1 palm://com.palm.applicationManager/rescan {}
 
luna-send -n 1 palm://com.palm.applicationManager/rescan {}
 
</nowiki></pre>
 
</nowiki></pre>
 +
  
 
Get a list of all installed apps:
 
Get a list of all installed apps:
Line 26: Line 34:
 
luna-send -n 1 "palm://com.palm.applicationManager/listLaunchPoints" "{}"
 
luna-send -n 1 "palm://com.palm.applicationManager/listLaunchPoints" "{}"
 
</nowiki></pre>
 
</nowiki></pre>
 +
  
 
Using luna-send to launch an application:
 
Using luna-send to launch an application:
Line 32: Line 41:
 
luna-send -n 1 palm://com.palm.applicationManager/launch {\"id\":\"com.palm.app.browser\",\"params\":{\"scene\":\"page\",\"target\":\"http://www.google.com\"}}
 
luna-send -n 1 palm://com.palm.applicationManager/launch {\"id\":\"com.palm.app.browser\",\"params\":{\"scene\":\"page\",\"target\":\"http://www.google.com\"}}
 
</nowiki></pre>
 
</nowiki></pre>
 +
  
 
The second command shows how to open www.google.com when the browser is launched.
 
The second command shows how to open www.google.com when the browser is launched.
Line 41: Line 51:
  
 
Replace www.google.com/index.html with whatever file you want downloaded.
 
Replace www.google.com/index.html with whatever file you want downloaded.
 +
  
 
Using luna-send to first import and then set the wallpaper image:
 
Using luna-send to first import and then set the wallpaper image:
Line 50: Line 61:
  
 
Replace your_file.jpg with whatever file in the wallpapers folder you want for your next wallpaper.
 
Replace your_file.jpg with whatever file in the wallpapers folder you want for your next wallpaper.
 +
  
 
Using luna-send to control the palm progress animation (The pulsing "palm" logo seen at boot):
 
Using luna-send to control the palm progress animation (The pulsing "palm" logo seen at boot):
Line 59: Line 71:
  
 
TODO: These should probably be plugged into the Tracker app.
 
TODO: These should probably be plugged into the Tracker app.
 +
  
 
<pre><nowiki>
 
<pre><nowiki>
Line 65: Line 78:
 
luna-send -n 1 palm://com.palm.location/getCurrentPosition {}
 
luna-send -n 1 palm://com.palm.location/getCurrentPosition {}
 
</nowiki></pre>
 
</nowiki></pre>
 +
  
 
List all of the processes which are running:
 
List all of the processes which are running:
Line 73: Line 87:
 
Interesting note:
 
Interesting note:
 
Seems everything with a processid below 1008 are static.  As seen above, open camera app has pid 1014 and startup app is pid 1003
 
Seems everything with a processid below 1008 are static.  As seen above, open camera app has pid 1014 and startup app is pid 1003
 +
  
 
Close a process:
 
Close a process:
Line 79: Line 94:
 
luna-send -n 1 "palm://com.palm.applicationManager/close" "{\"processId\":\"1058\"}"
 
luna-send -n 1 "palm://com.palm.applicationManager/close" "{\"processId\":\"1058\"}"
 
</nowiki></pre>
 
</nowiki></pre>
 +
  
 
Activate the vibrator:
 
Activate the vibrator:
Line 86: Line 102:
 
</nowiki></pre>
 
</nowiki></pre>
 
The duration value is in milliseconds and can be adjusted as desired.
 
The duration value is in milliseconds and can be adjusted as desired.
 +
  
 
Photos Info - list album and image from mediadb.db3:
 
Photos Info - list album and image from mediadb.db3:
Line 96: Line 113:
 
luna-send -n 1 luna://com.palm.mediadb/image/listimages {}
 
luna-send -n 1 luna://com.palm.mediadb/image/listimages {}
 
</nowiki></pre>
 
</nowiki></pre>
 +
  
 
Set system volume - "volume" range is 0-100
 
Set system volume - "volume" range is 0-100
Line 102: Line 120:
 
luna-send -n 1 palm://com.palm.audio/system/setVolume '{"volume":80}'
 
luna-send -n 1 palm://com.palm.audio/system/setVolume '{"volume":80}'
 
</nowiki></pre>
 
</nowiki></pre>
 +
  
 
Set ringtone volume - "volume" range is 0-100
 
Set ringtone volume - "volume" range is 0-100
Line 108: Line 127:
 
luna-send -n 1 palm://com.palm.audio/ringtone/setVolume '{"volume":100}'
 
luna-send -n 1 palm://com.palm.audio/ringtone/setVolume '{"volume":100}'
 
</nowiki></pre>
 
</nowiki></pre>
 +
  
 
Dial a number - this actually calls the number, not just setup
 
Dial a number - this actually calls the number, not just setup
Line 114: Line 134:
 
luna-send -n 1 palm://com.palm.telephony/dial '{"number":"8001234567"}'
 
luna-send -n 1 palm://com.palm.telephony/dial '{"number":"8001234567"}'
 
</nowiki></pre>
 
</nowiki></pre>
 +
  
 
Hang up a phone call :-) There are ways to end specific types of calls but I think this is good enough for now. Let me know if you want the other methods.
 
Hang up a phone call :-) There are ways to end specific types of calls but I think this is good enough for now. Let me know if you want the other methods.
Line 120: Line 141:
 
luna-send -n 1 palm://com.palm.telephony/hangupAll {}
 
luna-send -n 1 palm://com.palm.telephony/hangupAll {}
 
</nowiki></pre>
 
</nowiki></pre>
 +
  
 
Send a text message - only need to change phone "value" and "messageText"
 
Send a text message - only need to change phone "value" and "messageText"
Line 126: Line 148:
 
luna-send -n 1 palm://com.palm.messaging/sendMessageFromCompose '{"recipientJSONArray": [{"lastName": "", "pictureLoc": "", "contactCount": 1, "displayText": "", "firstName": "", "pictureLocBig": "", "imAvailability": 6, "pictureLocSquare": "", "contactDisplay": "", "Person_id": "", "personId": "", "type": "phone", "value": "8165551234", "alreadyValidated": true, "prefix": "to$A", "identifier": ""}], "messageText": "Content of message here"}'
 
luna-send -n 1 palm://com.palm.messaging/sendMessageFromCompose '{"recipientJSONArray": [{"lastName": "", "pictureLoc": "", "contactCount": 1, "displayText": "", "firstName": "", "pictureLocBig": "", "imAvailability": 6, "pictureLocSquare": "", "contactDisplay": "", "Person_id": "", "personId": "", "type": "phone", "value": "8165551234", "alreadyValidated": true, "prefix": "to$A", "identifier": ""}], "messageText": "Content of message here"}'
 
</nowiki></pre>
 
</nowiki></pre>
 +
  
 
set phone to no roam (home network only)
 
set phone to no roam (home network only)
Line 131: Line 154:
 
luna-send -n 1 palm://com.palm.telephony//roamModeSet '{"mode":"homeonly"}'
 
luna-send -n 1 palm://com.palm.telephony//roamModeSet '{"mode":"homeonly"}'
 
</nowiki></pre>
 
</nowiki></pre>
 +
  
 
set phone to auto roam
 
set phone to auto roam
Line 136: Line 160:
 
luna-send -n 1 palm://com.palm.telephony//roamModeSet '{"mode":"any"}'
 
luna-send -n 1 palm://com.palm.telephony//roamModeSet '{"mode":"any"}'
 
</nowiki></pre>
 
</nowiki></pre>
 +
  
 
set phone to roam only
 
set phone to roam only
Line 141: Line 166:
 
luna-send -n 1 palm://com.palm.telephony//roamModeSet '{"mode":"roamonly"}'
 
luna-send -n 1 palm://com.palm.telephony//roamModeSet '{"mode":"roamonly"}'
 
</nowiki></pre>
 
</nowiki></pre>
 +
  
 
==Applications==
 
==Applications==
Line 148: Line 174:
 
luna-send -n 1 palm://com.palm.notes/getNotes {}
 
luna-send -n 1 palm://com.palm.notes/getNotes {}
 
</nowiki></pre>
 
</nowiki></pre>
 +
  
 
==Storage==
 
==Storage==
Line 155: Line 182:
 
luna-send -n 1 palm://com.palm.storage/diskmode/enterMSM {\"user-confirmed\":true,\"enterIMasq\":false}
 
luna-send -n 1 palm://com.palm.storage/diskmode/enterMSM {\"user-confirmed\":true,\"enterIMasq\":false}
 
</nowiki></pre>
 
</nowiki></pre>
 +
  
 
Exit usb storage mode (toggle):
 
Exit usb storage mode (toggle):
Line 162: Line 190:
  
 
--WOOT--
 
--WOOT--
 +
  
 
==Airplane Mode==
 
==Airplane Mode==
Line 169: Line 198:
 
luna-send -n 1 palm://com.palm.systemservice/setPreferences '{"airplaneMode":true}'
 
luna-send -n 1 palm://com.palm.systemservice/setPreferences '{"airplaneMode":true}'
 
</nowiki></pre>
 
</nowiki></pre>
 +
  
 
Disable Airplane Mode:
 
Disable Airplane Mode:

Revision as of 04:13, 28 November 2010

NOTE: You have to run with root perms.


Kick off a manual Palm Backup [u]entirely[/u] from the command line:

luna-send -n 1 palm://com.palm.applicationManager/launch '{"id":"com.palm.app.backup"}'
luna-send -n 1 palm://com.palm.backup/startBackup '{}'
luna-send -n 1 palm://com.palm.applicationManager/running '{}'
luna-send -n 1 palm://com.palm.applicationManager/close '{"processId":"(GET ID NUMBER FROM /RUNNING)"}'


Connect to any (known) WAP in range (or simply turn on WiFi):

luna-send -n 1 palm://com.palm.wifi/setstate '{"state":"enabled"}'
luna-send -n 1 palm://com.palm.wifi/findnetworks '{""}'


Disconnect from WiFi:

luna-send -n 1 palm://com.palm.wifi/setstate '{"state":"disabled"}'


Using luna-send to refresh the Launcher panel.

luna-send -n 1 palm://com.palm.applicationManager/rescan {}


Get a list of all installed apps:

luna-send -n 1 "palm://com.palm.applicationManager/listLaunchPoints" "{}"


Using luna-send to launch an application:

luna-send -n 1 palm://com.palm.applicationManager/launch {\"id\":\"com.palm.app.browser\"}
luna-send -n 1 palm://com.palm.applicationManager/launch {\"id\":\"com.palm.app.browser\",\"params\":{\"scene\":\"page\",\"target\":\"http://www.google.com\"}}


The second command shows how to open www.google.com when the browser is launched.

Using luna-send to download a file to /media/internal/downloads/:

luna-send -n 1 palm://com.palm.downloadmanager/download {\"target\":\"http://www.google.com/index.html\"}  

Replace www.google.com/index.html with whatever file you want downloaded.


Using luna-send to first import and then set the wallpaper image:

luna-send -n 1 palm://com.palm.systemservice/wallpaper/importWallpaper {"target": "/media/internal/wallpapers/your_file.jpg" }
luna-send -n 1 palm://com.palm.systemservice/setPreferences {"wallpaper": {"wallpaperName": "your_file.jpg", "wallpaperFile": "/media/internal/wallpapers/your_file.jpg"}}

Replace your_file.jpg with whatever file in the wallpapers folder you want for your next wallpaper.


Using luna-send to control the palm progress animation (The pulsing "palm" logo seen at boot):

luna-send -n 1 palm://com.palm.systemmanager/runProgressAnimation {\"state\":\"start\"}
luna-send -n 1 palm://com.palm.systemmanager/runProgressAnimation {\"state\":\"stop\"}

TODO: These should probably be plugged into the Tracker app.


luna-send -n 1 palm://com.palm.location/setUseGps {\"useGps\":\"true\"}
luna-send -n 1 palm://com.palm.location/setAutoLocate {\"autoLocate\":\"true\"}
luna-send -n 1 palm://com.palm.location/getCurrentPosition {}


List all of the processes which are running:

sudo luna-send -n 1 palm://com.palm.applicationManager/running {}
** Message: serviceResponse Handling: 2, { "running": [ { "id": "com.palm.launcher", "processid": "1006" }, { "id": "com.palm.systemui", "processid": "1007" }, { "id": "com.palm.app.email", "processid": "1000" }, { "id": "com.palm.app.phone", "processid": "1001" }, { "id": "com.palm.app.contacts", "processid": "1002" }, { "id": "com.palm.app.camera", "processid": "1003" }, { "id": "com.palm.app.messaging", "processid": "1004" }, { "id": "com.palm.app.calendar", "processid": "1005" }, { "id": "com.palm.app.phone", "processid": "1008" }, { "id": "com.palm.app.camera", "processid": "1014" } ] }

Interesting note: Seems everything with a processid below 1008 are static. As seen above, open camera app has pid 1014 and startup app is pid 1003


Close a process:

luna-send -n 1 "palm://com.palm.applicationManager/close" "{\"processId\":\"1058\"}"


Activate the vibrator:

luna-send -n 1 palm://com.palm.vibrate/vibrate {\"period\":1,\"duration\":1000\}

The duration value is in milliseconds and can be adjusted as desired.


Photos Info - list album and image from mediadb.db3:

luna-send -n 1 luna://com.palm.mediadb/image/listalbums {}
luna-send -n 1 luna://com.palm.mediadb/image/listimages {}


Set system volume - "volume" range is 0-100

luna-send -n 1 palm://com.palm.audio/system/setVolume '{"volume":80}'


Set ringtone volume - "volume" range is 0-100

luna-send -n 1 palm://com.palm.audio/ringtone/setVolume '{"volume":100}'


Dial a number - this actually calls the number, not just setup

luna-send -n 1 palm://com.palm.telephony/dial '{"number":"8001234567"}'


Hang up a phone call :-) There are ways to end specific types of calls but I think this is good enough for now. Let me know if you want the other methods.

luna-send -n 1 palm://com.palm.telephony/hangupAll {}


Send a text message - only need to change phone "value" and "messageText"

luna-send -n 1 palm://com.palm.messaging/sendMessageFromCompose '{"recipientJSONArray": [{"lastName": "", "pictureLoc": "", "contactCount": 1, "displayText": "", "firstName": "", "pictureLocBig": "", "imAvailability": 6, "pictureLocSquare": "", "contactDisplay": "", "Person_id": "", "personId": "", "type": "phone", "value": "8165551234", "alreadyValidated": true, "prefix": "to$A", "identifier": ""}], "messageText": "Content of message here"}'


set phone to no roam (home network only)

luna-send -n 1 palm://com.palm.telephony//roamModeSet '{"mode":"homeonly"}'


set phone to auto roam

luna-send -n 1 palm://com.palm.telephony//roamModeSet '{"mode":"any"}'


set phone to roam only

luna-send -n 1 palm://com.palm.telephony//roamModeSet '{"mode":"roamonly"}'


Applications

Notes (view notes):

luna-send -n 1 palm://com.palm.notes/getNotes {}


Storage

Enter usb storage mode:

luna-send -n 1 palm://com.palm.storage/diskmode/enterMSM {\"user-confirmed\":true,\"enterIMasq\":false}


Exit usb storage mode (toggle):

luna-send -n 1 palm://com.palm.storage/diskmode/enterMSM {\"user-confirmed\":true,\"enterIMasq\":false}

--WOOT--


Airplane Mode

Enable Airplane Mode:

luna-send -n 1 palm://com.palm.systemservice/setPreferences '{"airplaneMode":true}'


Disable Airplane Mode:

luna-send -n 1 palm://com.palm.systemservice/setPreferences '{"airplaneMode":false}'


Finding luna-send Command

These commands come from inside given applications. The best way to find luna-send commands is to do a search for the term "method:" in the Applications code. Once you find method: you might see parameters: which is also used by luna-send here is an example.

searched for "method:" in the com.app.palm.AppYouAreTesting

found

"method: test"

luna-send command based on example:

luna-send -n 1 palm://com.palm.AppYouAreTesting/test {}

General luna-send command:

luna-send -n 1 palm://ApplicationName/MethodValue {ParameterValues}

Searching for services with dbus

Run dbus-util capture and search for services/methods/parameters. - xorg

# dbus-util --capture 2>&1 |tee /tmp/dbus.dump

Perform functions on device that you want to trap, such as setting phone to automatic roaming.
Ctrl-c from dbus.

Searches to try...
# grep // /tmp/dbus.dump
# grep com.palm /tmp/dbus.dump
# grep palm:// tmp/dbus.dump
# grep roam /tmp/dbus.dump

This is found in the dump...
  com.palm.luna2  com.palm.telephony      //roamModeSet   «string=â{"mode": "homeonly"}

com.palm.telophony is the service
//roamModeSet is the method
"mode":"homeonly" is the parameter

Translate to luna-send...

luna-send -n 1 palm://com.palm.telephony/roamModeSet '{"mode":"homeonly"}'