|
#1
|
|||
|
|||
|
Hi!
Noticed this topic has been handled in some threads but to keep it readable, decided to start a new one dedicated to this. Good tips, ideas and more information about using systemui and d-bus welcome! These might also work with N770/8x0, haven't tried yet. While playing with the power button menu configuration files at /etc/systemui/, I noticed there's an entry for "Top in XTerm" that starts XTerm with top running. If that is possible then starting any command should be possible, let's add some frequently used tools there. Also noticed some of the entries had icons so those could be added as well. I'm biking a lot and my biggest gripe for the N900 has been awkward access to anything unless you have two hands available, stable environment and full concentration. The power button menu allows starting, or focusing, anything with just a press of the power button and one touch of the large power menu items, easy even when biking. ![]() Seems that all the *.xml files under /etc/systemui folder are loaded when systemui is restarted (see below). The basic structure of these files is: Code:
<powerkeymenu path="/">
<menuitem
priority="[Sort order, lowest first]"
name="[Name shown in the menu]">
<icon>[Icon name, same as in *.desktop]</icon>
[Actions]
</menuitem>
<menuitem priority="9" name="Another entry">
..
</menuitem>
</powerkeymenu>
Don't worry about the priorities at first, just create the buttons and plan on paper how would you like them arranged, then assign priority numbers from lower to higher numbers starting from top left. I have disabled the shutdown and screen lock entries as those can be accessed by long press and double press anyway. Reboot I might disable too as that's easy enough to do in XTerm, considering that's not needed even every day. In landscape mode, 14 entries fit the menu nicely, more than that will leave some outside the screen and it doesn't scroll. In portrait mode, 13 entries would (almost) fit, but even with 12 it's difficult to leave the menu without selecting something so a dummy entry might be handy. My entries: End task, just icon added: Code:
<menuitem priority="600"
name="powerup_memain_endcurrenttask">
<icon>general_close</icon>
<return>10</return>
<po>osso-powerup-shutdown</po>
</menuitem>
Code:
<menuitem priority="500" name="Reboot">
<icon>reboot</icon>
<return>6</return>
<po>osso-powerup-shutdown</po>
</menuitem>
Code:
<menuitem priority="4" name="Top">
<icon>dashboard</icon>
<callback service="com.nokia.xterm"
path="/com/nokia/xterm" interface="com.nokia.xterm"
method="run_command" bus="session" autostart="true">
<argument type="string">/usr/bin/top</argument>
</callback>
</menuitem>
Code:
<menuitem priority="6" name="Nethack">
<icon>nethack</icon>
<callback service="com.nokia.xterm"
path="/com/nokia/xterm"
interface="com.nokia.xterm" method="run_command"
bus="session" autostart="true">
<argument type="string">/usr/games/nethack</argument>
</callback>
</menuitem>
Code:
<menuitem priority="5" name="Server">
<icon>im-icq</icon>
<callback service="com.nokia.xterm"
path="/com/nokia/xterm"
interface="com.nokia.xterm" method="run_command"
bus="session" autostart="true">
<argument type="string">ssh user@server</argument>
</callback>
</menuitem>
Plain XTerm (could be root as well but thought this is more general): Code:
<menuitem priority="3" name="X-Term">
<icon>terminal</icon>
<callback service="com.nokia.xterm"
path="/com/nokia/xterm"
interface="com.nokia.xterm" method="run_command"
bus="session" autostart="true">
<argument type="string">sh</argument>
</callback>
</menuitem>
Code:
<menuitem priority="3" name="Panucci">
<icon>panucci</icon>
<callback service="com.nokia.HildonDesktop.AppMgr"
path="/com/nokia/HildonDesktop/AppMgr"
interface="com.nokia.HildonDesktop.AppMgr"
method="LaunchApplication" bus="session"
autostart="true">
<argument type="string">panucci</argument>
</callback>
</menuitem>
Calendar: Code:
<menuitem priority="2" name="Calendar">
<po>rtcom-calendar</po>
<icon>general_calendar</icon>
<callback service="com.nokia.calendar"
path="/com/nokia/calendar"
interface="com.nokia.calendar" method="top_application"
bus="session" autostart="true">
<argument type="boolean">true</argument>
</callback>
</menuitem>
Code:
<menuitem priority="1" name="PhoneHome">
<po>rtcom-call-ui</po>
<icon>general_application_call</icon>
<callback service="com.nokia.csd.Call"
path="/com/nokia/csd/call"
interface="com.nokia.csd.Call" method="CreateWith"
bus="system" autostart="true">
<argument type="string">+xxxyyyzzzzzz</argument>
<argument type="uint32">0</argument>
</callback>
</menuitem>
Editing instructions: - Enable root access. If you don't know what is that, please do some homework or wait for someone write a nice tool for editing the power menu. You might brick your device by editing these files as they are loaded in the startup sequence. - cd /etc/systemui - cp systemui.xml systemui.xml_backup - vi systemui.xml (or whatever editor you like) or - cp callui.xml mypowermenu.xml; - vi mypowermenu.xml Existing icons can be found in /usr/share/icons/hicolor/48x48/hildon (or other folders below 48x48). Own 48x48 icons can be put there as well. Here's my icon for Nethack: ![]() The new menu can be taken in use by rebooting but a quick way is to restart systemui. Here is a script for that, save somewhere and run when the menu needs to be refreshed: Code:
systemui_restart.sh #!/bin/sh /usr/sbin/dsmetool -k /usr/bin/systemui sleep 1 /usr/sbin/dsmetool -n -l -t /usr/bin/systemui Some questions waiting for answers: - Are those <title> and <po> in the beginning of systemui.xml (but not callui.xml) used for something? - What's the <po> tag anyway? - How exactly does this <callback> work, what do the parameters mean? I have used Linux for >15 years but am a complete newbie in Maemo, trying to learn quick:) Edit 2010-06-11:Added systemui restart instructions/script, info about number of entries, how to start apps without xterm. Edit 2010-06-11:Added info about portrait mode power menu. Edit 2010-06-17: Added phone shortcut entry. Last edited by x-rated; 2010-06-17 at 13:33. Reason: Added phone shortcut entry. |
| The Following 45 Users Say Thank You to x-rated For This Useful Post: | ||
alienhead, amin007110, bakuur, bingomion, bman, bunanson, cardiff-blues, ceevee, D4rKlar, dana.s, etuoyo, fw190, gordonshowers, gregoranderson, gttnnn, ivgalvez, jackburton, jedi, JimKnopf, jvl1, Magik, mannakiosk, michaaa62, misiak, mrsellout, nkirk, patrickl, pelago, phedders, saponga, SavageD, sirloon, sixwheeledbeast, skalogre, StefanL, Tiboric, torpedo48, totalentropy, vi_, vkv.raju, Wikiwide, xman, yablacky, YoDude, zimon | ||
|
#2
|
|||
|
|||
|
Awesome! But somehow X-term is opened twice and I have no idea how to fix this..
|
|
#3
|
|||
|
|||
|
Quote:
However, if you have a command line app like "sh" as the argument of X-Term, or use com.nokia.HildonDesktop.AppMgr->LaunchApplication to run commands, there should be only one window. |
| The Following User Says Thank You to x-rated For This Useful Post: | ||
|
#4
|
|||
|
|||
|
yeah, when I run it with com.nokia.HildonDesktop.AppMgr->LaunchApplication it works just great. I've noticed that every program, installed on the N900 can run with this algorithm, which makes using the device much more easier. You did a really great job! Once again, thank you very much
|
|
#5
|
|||
|
|
|||
|
Hi! How do I can add Task Switcher to this menu? Thanks in advance! So long.
|
|
#6
|
||||
|
||||
|
any chance you can give me an example entry with the above code to only open the one window. not sure where to put it.
__________________
my home on the net is symbian-freak/maemo-freak dot com. come and visit
|
|
#7
|
||||
|
||||
|
right ignore my earlier question, com.nokia.HildonDesktop.AppMgr->LaunchApplication works great but doesnt work for python apps
can someone show me how an example entry for starting one? also is there a way of using com.nokia.HildonDesktop.AppMgr->LaunchApplication to launch settings other than com.nokia.controlpanel
__________________
my home on the net is symbian-freak/maemo-freak dot com. come and visit
|
|
#8
|
||||
|
||||
|
Hi, I'm trying to run a commandline directly from systemui.xml.
Code:
sudo gainroot echo 2 > /sys/class/backlight/acx565akm/brightness Code:
echo "echo 2 > /sys/class/backlight/acx565akm/brightness" | sudo gainroot Code:
<menuitem priority="3" name="Brightness">
<icon>terminal</icon>
<callback service="com.nokia.xterm"
path="/com/nokia/xterm"
interface="com.nokia.xterm" method="run_command"
bus="session" autostart="true">
<argument type="string">echo "echo 2 > /sys/class/backlight/acx565akm/brightness" | sudo gainroot</argument>
</callback>
</menuitem>
What to do?
__________________
Handcrafted Ambient / Chillout Music, free to download: nomoton |
| The Following User Says Thank You to quingu For This Useful Post: | ||
|
#9
|
|||
|
|||
|
Quote:
Code:
user ALL = (ALL) NOPASSWD: ALL Now, because you want to redirect into a file, you need the shell itself to run as root, so you can run the command you want like this: sudo sh -c 'echo 2 > /sys/class/backlight/acx565akm/brightness' In any case, wrapping that up in a script seems like a good idea. You really don't want to run that by way of xterm, though, because then you'll end up with an xterm. ![]() You might try making a .desktop file for it in /usr/share/applications/hildon/ , with NoDisplay=true so that it doesn't actually show up in the menu. You can then add a power-button menu entry similar to the sample one for panucci given in the original post. |
|
#10
|
|||
|
|||
|
The <po> tag specifies a gettext translation domain. Software that provides support for multiple languages needs some way to look up the correct strings to use for specific messages in the current language. gettext represents one of the most popular such systems (by far the most popular in the Linux and FOSS world, and on other UNIX systems). gettext can take a string like "powerup_memainmenu_poweroff" (which appears in the "name" attribute of one of the default menuitem entries) and turn it into "Switch off!" in English. <po>osso-powerup-shutdown</po> tells systemui to go look in the osso-powerup-shutdown translation files, such as /usr/share/locale/en_US/LC_MESSAGES/osso-powerup-shutdown.mo . The abbreviation "po" comes from the file extension .po used as the source of the translation files; the .mo files represent a compressed format used to minimize storage space and make string lookups fast. For an example of a .po file, you can look at the osso-powerup-shutdown.po file that the systemui strings come from. For more information on gettext, check out the gettext manual.
Quote:
Quote:
For another example of <callback>, and a worked example of creating a menu item that uses most of the systemui features, take a look at my thread about adding an "End call" item. I'll probably end up creating a wiki page documenting the systemui XML format, unless someone points out some existing documentation that we've both failed to find (on display in the bottom of a locked filing cabinet stuck in a disused lavatory with a sign on the door saying "Beware of The Leopard" ).
|
| The Following 5 Users Say Thank You to josh For This Useful Post: | ||
![]() |
|
|