maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   * The Truly Epic Maemo 5 MODs Thread * (https://talk.maemo.org/showthread.php?t=39565)

Rob1n 2010-01-16 21:23

Re: N900 MODs - share your MODs!!
 
You could probably do "echo /sbin/reboot | sudo gainroot"

les_garten 2010-01-16 21:37

Re: N900 MODs - share your MODs!!
 
Quote:

Originally Posted by Rob1n (Post 476881)
You could probably do "echo /sbin/reboot | sudo gainroot"

Hey thanx, I'll give that a try. Looks like it will work!

les_garten 2010-01-16 21:55

Re: N900 MODs - share your MODs!!
 
Quote:

Originally Posted by Rob1n (Post 476881)
You could probably do "echo /sbin/reboot | sudo gainroot"

Heh, well that one didn't work. It opens two xterms and one collapses and disappears.

qwerty12 2010-01-16 22:03

Re: N900 MODs - share your MODs!!
 
Quote:

Originally Posted by les_garten (Post 476820)
Mine did the same thing.

Might be able to cobble something together with low permissions with setuid possibly. But would not want to do that though.

sudo could probably be abused for this:

Code:

sudo gainroot
echo "user ALL = NOPASSWD: /sbin/reboot" > /etc/sudoers.d/reboot.sudoers
update-sudoers

After that, change your reboot entry to run "sudo reboot".

qwerty12 2010-01-16 22:25

Re: N900 MODs - share your MODs!!
 
OK, scratch that: that only worked once...

Do this, instead:

Do the sudoers trick outlined above;

/usr/share/dbus-1/services/reboot.service:
Quote:

[D-BUS Service]
Name=com.misc.reboot
Exec=/usr/bin/sudo reboot
/etc/systemui/systemui.xml:
Quote:

<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>

les_garten 2010-01-16 22:27

Re: N900 MODs - share your MODs!!
 
Quote:

Originally Posted by qwerty12 (Post 476970)
sudo could probably be abused for this:

Code:

sudo gainroot
echo "user ALL = NOPASSWD: /sbin/reboot" > /etc/sudoers.d/reboot.sudoers
update-sudoers

After that, change your reboot entry to run "sudo reboot".

Same thing, opens two Xterms and leaves one while the other melts away.

qwerty12 2010-01-16 22:29

Re: N900 MODs - share your MODs!!
 
Yep, I had it work once but then it started to do what you said. See my second method that abuses D-Bus - that worked more than once. :)

les_garten 2010-01-16 22:40

Re: N900 MODs - share your MODs!!
 
Quote:

Originally Posted by qwerty12 (Post 477019)
Yep, I had it work once but then it started to do what you said. See my second method that abuses D-Bus - that worked more than once. :)

That worked, interesting, thanx!

Why is the Reboot using osso-powerup-shutdown so "abrupt". Both these methods work but the osso command juist seems "Violent" in it's nature!

Schturman 2010-01-16 22:44

Re: N900 MODs - share your MODs!!
 
Maybe someone know how I can get the button or shortcut icon for a simple bluetooth ON/OFF action ?
I need this for a quickly on/off bluetooth.
Thanks

les_garten 2010-01-16 22:52

Re: N900 MODs - share your MODs!!
 
Quote:

Originally Posted by qwerty12 (Post 477019)
Yep, I had it work once but then it started to do what you said. See my second method that abuses D-Bus - that worked more than once. :)

How do you hup that menu with out a reboot?


All times are GMT. The time now is 09:15.

vBulletin® Version 3.8.8