View Single Post
Posts: 152 | Thanked: 41 times | Joined on Dec 2009 @ Sydney
#90
Oh good one.

Well what I did was 3 things:

1. Become root, run visudo. In that text file [be careful] add line:
user ALL = NOPASSWD: /usr/local/bin/118
ie type
O
user ALL = NOPASSWD: /usr/local/bin/118
[ESC]
:x

2. Make a file "/usr/local/bin/118"
with contents:
Code:
#!/bin/sh
/bin/echo 118 > /sys/class/i2c-adapter/i2c-2/2-0063/power_level
exit 0
Then type:
Code:
chmod 755 /usr/local/bin/118
3. Add file:
/usr/share/applications/hildon/118.desktop
With contents:

Code:
[Desktop Entry]
Version=0.1
Type=Application
Name=118
Exec= /usr/bin/sudo /usr/local/bin/118
Icon=
X-Windows-Icon=
X-HildonDesk-ShowInToolbar=false
X-Osso-Type=application/x-executable
And now you have an app called 118 that does what you want.
I am not an expert on hildon *.desktop files and running this command waits for some sort of X feedback, so you need to multi-task out and it disappears.

Please someone tidy up that part of it.
 

The Following 9 Users Say Thank You to DaveQB For This Useful Post: