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)

jakiman 2010-03-08 10:18

Re: Desktop Command Execution Widget scripts
 
I'm trying to create a "switch" using this widget to lower the LCD brightness instantly just by clicking on the widget.

Using following command:
Code:

echo 2 > /sys/class/backlight/acx565akm/brightness
But it does nothing when used with the widget. Can I make it work?

noobmonkey 2010-03-08 10:41

Re: Desktop Command Execution Widget scripts
 
wouldn't you need root rights for that? so probably adding
'| sudo gainroot'
to the end? just a guess though. and would need rootsh installed.

jakiman 2010-03-08 11:45

Re: Desktop Command Execution Widget scripts
 
I tried that but it didn't make any difference.... =(

noobmonkey 2010-03-08 12:28

Re: Desktop Command Execution Widget scripts
 
Quote:

Originally Posted by jakiman (Post 559724)
I tried that but it didn't make any difference.... =(

meh was just a guess .... i'm no expert on linux though :( - hopefully some clever bod will look into it for you :D

Alan_Peery 2010-03-08 12:35

Re: Desktop Command Execution Widget scripts
 
Quote:

Originally Posted by jakiman (Post 559637)
Code:

echo 2 > /sys/class/backlight/acx565akm/brightness

Quote:

Originally Posted by noobmonkey (Post 559662)
wouldn't you need root rights for that? so probably adding
'| sudo gainroot'
to the end? just a guess though. and would need rootsh installed.

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.

x-lette 2010-03-08 12:54

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.

And me I guess you should then put the 'sudo' to the beginning of the line (or even call 'su' instead). Piping the empty output of a not allowed command to 'sudo gainroot' seems quite useless to me.

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

rooted 2010-03-08 13:39

Re: Desktop Command Execution Widget scripts
 
What you really need is rootsh in front of command - it executes it with root priv. if you have rootsh installed. So:

rootsh echo 2 > ...

cpscotti 2010-03-09 00:32

Re: Desktop Command Execution Widget scripts
 
Quote:

Originally Posted by rooted (Post 559064)
Wow, what a bug. So obvious, but unnoticed till now. Anyway, when DCE widget resized to bigger height (with no. of lines) the widget itself is bigger, but the tapping area stays the same. This means that if you tap the widget in the lower area, it doesn't register it. Please fix this, because I'm using it for buttons: disconnect/connect/lock screen (via dbus) and I need some bigger buttons.

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.

kd_alex 2010-03-09 04:59

Re: Desktop Command Execution Widget scripts
 
I use the LIRC program which has a socket issue whenever the phone is restarted. The issue is resolved by running the following command lines:

sudo gainroot
/etc/init.d/lirc start

Is there anyway to use this widget to run these so I do not have to open a terminal when I want to use LIRC?? Maybe two widgets using an echo command for both?

x-lette 2010-03-09 12:27

Re: Desktop Command Execution Widget scripts
 
Similary to #177 you might want to use
rootsh /etc/init.d/lirc start
as commandline. Obviously you will need to have rootsh installed.


All times are GMT. The time now is 06:38.

vBulletin® Version 3.8.8