The Following 4 Users Say Thank You to Estel For This Useful Post: | ||
|
2011-08-24
, 21:58
|
|
Posts: 2,473 |
Thanked: 12,265 times |
Joined on Oct 2009
@ Jerusalem, PS/IL
|
#2
|
run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteDialog string:"Voltage: $VOLT
|
2011-08-24
, 22:34
|
Posts: 856 |
Thanked: 1,681 times |
Joined on Apr 2010
@ Aleppo ,Syria
|
#3
|
sudo run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications
echo "user ALL=(ALL) NOPASSWD: ALL" >> everybody.sudoers echo "root ALL=(ALL) NOPASSWD: ALL" >> everybody.sudoers mv everybody.sudoers /etc/sudoers.d update-sudoers
|
2011-08-25
, 00:00
|
|
Posts: 2,473 |
Thanked: 12,265 times |
Joined on Oct 2009
@ Jerusalem, PS/IL
|
#4
|
that is true you need
run-standalone.sh
before the script
cause when you type
root
it runs that script [standalone] with anything
also in user
but not with sudo gainroot
you can also :
but you need to do this firstCode:sudo run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications
this will let you run sudo #anything as rootCode:echo "user ALL=(ALL) NOPASSWD: ALL" >> everybody.sudoers echo "root ALL=(ALL) NOPASSWD: ALL" >> everybody.sudoers mv everybody.sudoers /etc/sudoers.d update-sudoers
also double root is possible
|
2011-08-25
, 00:13
|
|
Posts: 5,028 |
Thanked: 8,613 times |
Joined on Mar 2011
|
#5
|
Exec=/usr/bin/osso-xterm 'sudo bnf'
The Following User Says Thank You to Estel For This Useful Post: | ||
|
2011-08-25
, 00:46
|
|
Posts: 2,473 |
Thanked: 12,265 times |
Joined on Oct 2009
@ Jerusalem, PS/IL
|
#6
|
X-App-Loading-Image=none
|
2011-08-25
, 01:17
|
|
Posts: 5,028 |
Thanked: 8,613 times |
Joined on Mar 2011
|
#7
|
|
2011-08-25
, 02:34
|
Posts: 856 |
Thanked: 1,681 times |
Joined on Apr 2010
@ Aleppo ,Syria
|
#8
|
No, neither user nor "root" use run-standalone.sh, it has to do with environment variables being set in one and not the other.
That would also allow a sudo rm -rf /path/to/root, keeping some security on the system is saner.
|
2011-08-25
, 07:18
|
|
Posts: 5,028 |
Thanked: 8,613 times |
Joined on Mar 2011
|
#9
|
The Following User Says Thank You to Estel For This Useful Post: | ||
|
2011-09-11
, 03:13
|
|
Posts: 5,028 |
Thanked: 8,613 times |
Joined on Mar 2011
|
#10
|
Thanks for answer, ho ever, using Exec=sudo script.sh does nothing. Literally nothing, just nothing happens. That was the first thing I've tried after creating entry in sudoers.d I also got X-App-Loading-Image=none set.
When I execute "sudo script.sh" from terminal, it works as it should, so, probably, sudoers entry is ok.
// Edit
I've also tried to save terminal output from running desktop file, by:
Exec=sudo script.sh > /home/user/MyDocs/scriptlog.txt
(I've found it, while searching for solution - I don't know if it's right command)
...and scriptlog.txt was created, ho ever, contained nothing inside.
sudo bnf.sh
Exec=sudo bnf.sh
Exec='sudo bnf.sh' Exec="sudo bnf.sh" Exec=sudo 'bnf.sh' Exec=sudo "bnf.sh"
Exec=osso-xterm -e "sudo bnf.sh"
sudo bnf.sh
The Following User Says Thank You to Estel For This Useful Post: | ||
I develop some simple script (showing certain "glance" info derived from i2cget, based on shadowjk's bq27200 script), which put output to screen as maemo native notify. Basically, script contains 2 part - one for gathering and calculating info - based (mostly) on work by shadowjk - and second, forwarding output to screen.
For printing output, I use:
Side note: I was using this method before to show notification info, derived from bq27x00 module (cat sys/class/power_supply/bq27200 etc.), and it worked like a charm - thanks to Nicolai, who helped me to understand calling upon notifications.
Gathering data from i2cget require root privileges - and here, the problem begin. For unknown reason, script works as it should when called from terminal, after "root" command (via rootsh package), but refuse to work when privileges were gained by "sudo gainroot". Furthermore, adding script as .sudoers result in same output, as when called after "sudo gainroot" - it prove that sudoers file is created properly (I think), but doesn't solve problem.
When called after "root", no errors, and notification info pop-out with correct data. When called after "sudo gainroot", or with "sudo" after .sudoers created, output in terminal is:
What even more strange, bq27200.sh (script by shadowjk, that I used as base) works flawlessly with "sudo" after creating .sudoer for it. Also, using notification pop-up method (dbus-send etc), inside script that doesn't contain parts requiring root access (so, in my case, particularly parts from bq27200.sh, that works stand-alone) also result in no-problem. So, I got troubles only, when using script that contain *BOTH* gathering data requiring root, and displaying via aforementioned dbus-send method.
As result, I can't use this script from any kind of shortcut (desktop, hardware, whatever) - only from terminal, after "root". I've searched solid few days for possible solution - hence the "discovery" about it performing well with "root", but failing after "sudo gainroot" - but I'm still scratching my head clueless.
I'm attaching current version of script here (renamed to .sh.txt, to upload via forum mechanism), in case anyone want to try on her/his device (it may be little messy, it's developing version :P ). Any help/clues *really* much appreciated.
N900's aluminum backcover / body replacement
-
N900's HDMI-Out
-
Camera cover MOD
-
Measure battery's real capacity on-device
-
TrueCrypt 7.1 | ereswap | bnf
-
Hardware's mods research is costly. To support my work, please consider donating. Thank You!
Last edited by Estel; 2011-09-11 at 16:00.