Home » Applications, Featured, Firmware

How to add extra commands in your power key menu?

31 March 2011Entry by

Today I’m going to show you how to add extra commands in the power key menu on the N900 itself. This would be a shortcut to alot of people using the X-Terminal with the common commands every time they launch the X-Terminal.

One good example would be starting the X-Terminal automatically in “sudo gainroot” mode without having to type sudo gainroot.

So first type this in your X-Terminal in sequence

  1. sudo gainroot
  2. cd /etc/systemui
  3. cp systemui.xml systemui.xml.bak (THIS IS TO CREATE A BACKUP INCASE YOU EDITED SOMETHING WRONGLY)
  4. vi systemui.xml

You would see lines of codes. Don’t be afraid if you’re not familiar with any of these codes. Just remember not to mess any with the existing ones.

Go down until you have a empty space one line before </powerkeymenu>. The following is a template to get you started

<menuitem priority=” any number you prefer as this determines position of button” name= “any name you want here“>

<callback service=”com.nokia.xterm” path=”/com/nokia/xterm” interface=”com.nokia.xterm” method=”run_command” bus=”session” autostart=”true”>

<argument type=”string”> Type any command you want here but only one command</argument>

</callback>

</menuitem>

This would create a shortcut to directly launch the X-Terminal with a custom command given to it. For example if the above command were “sudo gainroot”, clicking on the shortcut in the power key menu would launch X-Terminal and directly type “sudo gainroot” for you without you typing it. It could be useful to alot of people who are using the “sudo gainroot” command everyday day in day out.

Till next and stay tune for more tips and tricks for the N900

Comments:


Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.