Warning: mysql_query(): Access denied for user 'root'@'localhost' (using password: NO) in /home/nokin900/public_html/wp-content/plugins/maxblogpress-ninja-affiliate/ninja-affiliate-library/include/mbp-ninja-affiliate.cls.php on line 184

Warning: mysql_query(): A link to the server could not be established in /home/nokin900/public_html/wp-content/plugins/maxblogpress-ninja-affiliate/ninja-affiliate-library/include/mbp-ninja-affiliate.cls.php on line 184

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/nokin900/public_html/wp-content/plugins/maxblogpress-ninja-affiliate/ninja-affiliate-library/include/mbp-ninja-affiliate.cls.php on line 185

Warning: mysql_query(): Access denied for user 'root'@'localhost' (using password: NO) in /home/nokin900/public_html/wp-content/plugins/maxblogpress-ninja-affiliate/ninja-affiliate-library/include/mbp-ninja-affiliate.cls.php on line 198

Warning: mysql_query(): A link to the server could not be established in /home/nokin900/public_html/wp-content/plugins/maxblogpress-ninja-affiliate/ninja-affiliate-library/include/mbp-ninja-affiliate.cls.php on line 198

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/nokin900/public_html/wp-content/plugins/maxblogpress-ninja-affiliate/ninja-affiliate-library/include/mbp-ninja-affiliate.cls.php on line 199

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/nokin900/public_html/wp-content/plugins/maxblogpress-ninja-affiliate/ninja-affiliate-library/include/mbp-ninja-affiliate.cls.php:184) in /home/nokin900/public_html/wp-content/plugins/wp-google-plus-connect/functions.php on line 84

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/nokin900/public_html/wp-content/plugins/maxblogpress-ninja-affiliate/ninja-affiliate-library/include/mbp-ninja-affiliate.cls.php:184) in /home/nokin900/public_html/wp-content/plugins/wp-google-plus-connect/functions.php on line 84

Warning: mysql_query(): Access denied for user 'root'@'localhost' (using password: NO) in /home/nokin900/public_html/wp-content/plugins/maxblogpress-ninja-affiliate/ninja-affiliate-library/include/mbp-ninja-affiliate.cls.php on line 184

Warning: mysql_query(): A link to the server could not be established in /home/nokin900/public_html/wp-content/plugins/maxblogpress-ninja-affiliate/ninja-affiliate-library/include/mbp-ninja-affiliate.cls.php on line 184

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/nokin900/public_html/wp-content/plugins/maxblogpress-ninja-affiliate/ninja-affiliate-library/include/mbp-ninja-affiliate.cls.php on line 185

Warning: mysql_query(): Access denied for user 'root'@'localhost' (using password: NO) in /home/nokin900/public_html/wp-content/plugins/maxblogpress-ninja-affiliate/ninja-affiliate-library/include/mbp-ninja-affiliate.cls.php on line 974

Warning: mysql_query(): A link to the server could not be established in /home/nokin900/public_html/wp-content/plugins/maxblogpress-ninja-affiliate/ninja-affiliate-library/include/mbp-ninja-affiliate.cls.php on line 974

Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /home/nokin900/public_html/wp-content/plugins/maxblogpress-ninja-affiliate/ninja-affiliate-library/include/mbp-ninja-affiliate.cls.php on line 975

Warning: mysql_query(): Access denied for user 'root'@'localhost' (using password: NO) in /home/nokin900/public_html/wp-content/plugins/maxblogpress-ninja-affiliate/ninja-affiliate-library/include/mbp-ninja-affiliate.cls.php on line 990

Warning: mysql_query(): A link to the server could not be established in /home/nokin900/public_html/wp-content/plugins/maxblogpress-ninja-affiliate/ninja-affiliate-library/include/mbp-ninja-affiliate.cls.php on line 990

Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /home/nokin900/public_html/wp-content/plugins/maxblogpress-ninja-affiliate/ninja-affiliate-library/include/mbp-ninja-affiliate.cls.php on line 991
[How-To] Adding a "Reboot" button to your powerkey menu | Nokia N900 Blog | Apps | Games | Themes | Wallpapers | Hacks

Home » Featured, Hacks

[How-To] Adding a “Reboot” button to your powerkey menu

12 January 2012Entry by

Ever wanted to have a graphical button to reboot your beloved device? Well, today I’ll show you how to add one to your powerkey menu!

Note: the tips we go through involve editing a low-level system file and imply that readers know what they are doing.

Adding the Reboot button:

First, we would want to go root:

  sudo gainroot

Next, let’s modify the sudoers file to allow us running reboot:

echo “user ALL = NOPASSWD: /sbin/reboot” > /etc/sudoers.d/reboot.sudoers

Update sudoers:

update-sudoers

Now, we would want to create a d-bus service.

[editor] /usr/share/dbus-1/services/reboot.service

Replace [editor] with whatever editor you prefer, for example, leafpad.

Paste the following into the file:

  [D-BUS Service]
  Name=com.misc.reboot
  Exec=/usr/bin/sudo reboot

Save the file and exit the editor. Change current directory:

cd /etc/systemui

Open up systemui.xml file in your preferred editor:

[editor] systemui.xml

Paste the following anywhere between the <powerkeymenu> and </powerkeymenu> tags:

<menuitem priority=”750″ name=”Reboot”>
   <icon>general_refresh</icon>
   <callback service=”com.misc.reboot” path=”/com/misc/reboot” interface=”com.misc.reboot” method=”reboot” bus=”session”   autostart=”true”>
   <argument type=”boolean”>true</argument>
  </callback>
</menuitem>

Note: some of you may notice that a reboot entry is already defined in systemui.xml. However, it utilizes osso-powerup-shutdown and preforms a very brutal shutdown. Rebooting with sudo reboot will gently shutdown all software and sync your filesystems, which is safer. Let’s just say that there  was probably a reason that the default entry was commented out.

Save the file, exit the editor and reboot your N900.

reboot

Enjoy your newly added Reboot button which will perform a safe reboot once pressed!

 

Source: Talk Maemo

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.

Invalid code.