View Single Post
Posts: 55 | Thanked: 72 times | Joined on Nov 2009
#9
Originally Posted by quingu View Post
Hi, I'm trying to run a commandline directly from systemui.xml.

Code:
sudo gainroot
echo 2 > /sys/class/backlight/acx565akm/brightness
First of all, I highly recommend editing /etc/sudoers and adding the following line:

Code:
user ALL = (ALL) NOPASSWD: ALL
This will allow you to run any command as root using sudo, not just gainroot.

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.
 

The Following 3 Users Say Thank You to josh For This Useful Post: