maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   Desktop Command Execution Widget scripts (https://talk.maemo.org/showthread.php?t=39177)

mrmoosehead 2010-03-09 12:38

Re: Desktop Command Execution Widget scripts
 
Did anyone ever get as far as compiling a list of useful scripts? A wiki or the like?

kd_alex 2010-03-10 01:25

Re: Desktop Command Execution Widget scripts
 
Quote:

Originally Posted by x-lette (Post 561115)
Similary to #177 you might want to use
rootsh /etc/init.d/lirc start
as commandline. Obviously you will need to have rootsh installed.

I tried this. On the widget i get invalid command. I tried this command in the X-terminal to get this response:

'rootsh is now deprecated for it poses too much of a security risk. However, you can still obtain a root shell by running the commands root or sudo root.'

What if I make a script file to perform the task in two steps (I.e. gain root, execute lirc start) and then have the widget run the script file? I'll try that.

Thanks for the idea!

Addison 2010-03-11 02:38

Re: Desktop Command Execution Widget scripts
 
Is this something that might also work under Diablo?

kd_alex 2010-03-12 01:56

Re: Desktop Command Execution Widget scripts
 
If by Diablo you mean Maemo 4.X, I have no idea. I am using Maemo 5.

mjec 2010-03-12 07:34

Re: Desktop Command Execution Widget scripts
 
Quote:

Originally Posted by Alan_Peery (Post 559795)
You want edit /etc/sudoers, and add an appropriate line. Be careful, this is the file that makes "sudo gainroot" and a lot of other things work.

Always use sudo visudo for this.

Update: see Rob1n's post for a better way to do this using /etc/sudoers.d

Just going right ahead and editing it can be extremely dangerous; messing up the file on a limited permissions system like the N900 can cause brickage.

You probably want to add the command to the sudoers file and then have

echo "" && sudo echo 2 > /sys/class/backlight/acx565akm/brightness

as your DCE script. We begin with echo "" as DCEW doesn't like getting no output.

mjec 2010-03-12 07:54

Re: Desktop Command Execution Widget scripts
 
Apologies for the double post

Quote:

Originally Posted by thesnake505 (Post 550111)
hay guys, i was wondering if there is a list, like a wiki page of comands that will work with dsew widget?
also is it possible to get "top" working, iv had a qucik go, including following some advice to try

top -b

however all i get is invalid command

cheers snake

To get the top two applications I use top -bn 1 | grep -v top | head -n 5 | tail -n 2. This will always exclude top itself. You should also give due consideration to having a .toprc file (see the top man page for details). Beware though: having this widget uses a surprising amount of CPU, so only refresh occasionally (i.e. probably not on switch and every minute).

To get more you have to change n for both head and tail (i.e. for top three apps it's head -n 6 | tail -n 3, for top one is head -n 4 | tail -n 1).

x-lette 2010-03-12 11:36

Re: Desktop Command Execution Widget scripts
 
Quote:

Originally Posted by mjec (Post 564721)
You probably want to add the command to the sudoers file and then have

echo "" && sudo echo 2 > /sys/class/backlight/acx565akm/brightness

as your DCE script. We begin with echo "" as DCEW doesn't like getting no output.

Might be more useful having the empty echo as a result of the actual command. This way you get noticed in case something goes wrong:

sudo echo 2 > /sys/class/backlight/acx565akm/brightness && echo "" || echo "Error!"

In case everything was OK the output is empty, if there was any error, the output will be "Errror!".

Rob1n 2010-03-12 11:58

Re: Desktop Command Execution Widget scripts
 
Quote:

Originally Posted by mjec (Post 564721)
Always use sudo visudo for this.

Just going right ahead and editing it can be extremely dangerous; messing up the file on a limited permissions system like the N900 can cause brickage.

You don't actually want to be editing sudoers directly at all on the N900. You should add a new config file into the /etc/sudoers.d directory and call update-sudoers instead.

fpp 2010-03-12 12:11

Re: Desktop Command Execution Widget scripts
 
Quote:

Originally Posted by cpscotti (Post 560655)
Yeah... it is a "known buggy". Will be fixed on the next version. (together with the overwritting on =])

PS: I'm very busy and so the next version is expected to some time in the end of march when I'll have more time.

Good news... and what do you think of my request (and a couple of others) to allow icons as well as text for the widget caption ? :-)

rooted 2010-03-14 14:20

Re: Desktop Command Execution Widget scripts
 
http://wiki.maemo.org/Desktop_Comman...Widget_scripts

You're welcome. :) It needs only to be put in appropriate categories and missing and/or new scripts must be added!


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

vBulletin® Version 3.8.8