[How-To] Adding a “Reboot” button to your powerkey menu
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:
Next, let’s modify the sudoers file to allow us running reboot:
echo “user ALL = NOPASSWD: /sbin/reboot” > /etc/sudoers.d/reboot.sudoers
Now, we would want to create a d-bus service.
Replace [editor] with whatever editor you prefer, for example, leafpad.
Paste the following into the file:
Save the file and exit the editor. Change current directory:
Open up systemui.xml file in your preferred editor:
Paste the following anywhere between the <powerkeymenu> and </powerkeymenu> tags:
<menuitem priority=”750″ name=”Reboot”>
<callback service=”com.misc.reboot” path=”/com/misc/reboot” interface=”com.misc.reboot” method=”reboot” bus=”session” autostart=”true”>
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.
Enjoy your newly added Reboot button which will perform a safe reboot once pressed!
Source: Talk Maemo