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)

rolan900d 2010-04-23 12:52

Re: Desktop Command Execution Widget scripts
 
I had these issues as well but these were mainly due to trying to ad sudo gainroot to the script...

Example:

I want homunculus to start from root...
I couldn't make a script that worked so all hell broke loose and I got errors about hildon-desktop closing down

stayloa 2010-04-23 13:16

Re: Desktop Command Execution Widget scripts
 
Ahh, this actually ties in with something I was doing.

The first time I installed it was working perfectly, until I tried to start cuteexplorer as root... Think I used:

sudo gainroot; cuteexplorer - had no idea if that was right but it didn't like it! I've since uninstalled and reinstalled and now I can't get it to load up even once which is a shame. Any solution?

rooted 2010-04-23 13:43

Re: Desktop Command Execution Widget scripts
 
To both of you:

echo "command" | sudo gainroot

stayloa 2010-04-23 14:57

Re: Desktop Command Execution Widget scripts
 
Quote:

Originally Posted by rooted (Post 624444)
To both of you:

echo "command" | sudo gainroot

Ahh I wish I'd known that before I killed the app...!! It doesn't let me do anything with it if I reinstall now...This is why linux n00bs shouldn't play with these things. *points finger at himself*

Any idea what the app could have done to hildon-desktop though? Seemingly everytime I reinstall it, something has been leftover from the previous install...

I will be flashing when/if 1.2 comes out but would prefer to not before that.

rooted 2010-04-23 17:31

Re: Desktop Command Execution Widget scripts
 
Try purging the app first (package mgmt link in my sig).

Jinux 2010-04-23 17:40

Re: Desktop Command Execution Widget scripts
 
Here's a little python script I use to get the verse of the day from BibleGateway

Code:

import feedparser
try:
        feed_in = feedparser.parse('http://www.biblegateway.com/votd/get/?format=atom')
        try:
                feed = str(feed_in.entries[0].title)
                print feed
        except:
                print 'No Content'
except:
        print 'Not Connected'

You need the feedparser module which can be gotten from Here

nokian-series 2010-04-25 00:34

Re: Desktop Command Execution Widget scripts
 
Hi all,
Please i'll apreciate a little help with QBW scripting.

Yes, i know if i do echo "command" | sudo gainroot, it will work.
But..and if it is not a "command" ?

Just like this..I want to make 2 profiles with my personalized OC settings (day\night profile). I'll put here the code for one of them:

/usr/sbin/kernel-load /usr/share/kernel-power-settings/ideal
rm -f /etc/default/kernel-power
ln -s /usr/share/kernel-power-settings/ideal /etc/default/kernel-power
echo 125000 250000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/avoid_frequencies
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/ignore_nice_load
/usr/sbin/kernel-load

How can i make it run with QBW?
If i run it at Xterm, with root, it works.
If i try it with QBW, it doesent work.

I've tried this too, but..nothing..

/usr/sbin/kernel-load /usr/share/kernel-power-settings/ideal
rm -f /etc/default/kernel-power | sudo gainroot
ln -s /usr/share/kernel-power-settings/ideal /etc/default/kernel-power | sudo gainroot
echo "echo 125000 250000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/avoid_frequencies" | sudo gainroot
echo "echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/ignore_nice_load" | sudo gainroot
/usr/sbin/kernel-load |sudo gainroot

Can please anyone help me? it works like i want on Xterminal.but cant 'export' it to Queen Beecon Widget..help please... (actualy, it acept the code, with no errors but it doesent change any values.

No!No!No!Yes! 2010-04-25 00:48

Re: Desktop Command Execution Widget scripts
 
Quote:

Originally Posted by nokian-series (Post 626511)
Hi all,
Please i'll apreciate a little help with QBW scripting.

Yes, i know if i do echo "command" | sudo gainroot, it will work.
But..and if it is not a "command" ?

Just like this..I want to make 2 profiles with my personalized OC settings (day\night profile). I'll put here the code for one of them:

/usr/sbin/kernel-load /usr/share/kernel-power-settings/ideal
rm -f /etc/default/kernel-power
ln -s /usr/share/kernel-power-settings/ideal /etc/default/kernel-power
echo 125000 250000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/avoid_frequencies
echo 0 > /sys/devices/system/cpu/cpufreq/ondemand/ignore_nice_load
/usr/sbin/kernel-load

How can i make it run with QBW?
If i run it at Xterm, with root, it works.
If i try it with QBW, it doesent work.

I've tried this too, but..nothing..

/usr/sbin/kernel-load /usr/share/kernel-power-settings/ideal
rm -f /etc/default/kernel-power | sudo gainroot
ln -s /usr/share/kernel-power-settings/ideal /etc/default/kernel-power | sudo gainroot
echo "echo 125000 250000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/avoid_frequencies" | sudo gainroot
echo "echo 0 > /sys/devices/system/cpu/cpufreq/ondemand/ignore_nice_load" | sudo gainroot
/usr/sbin/kernel-load |sudo gainroot

Can please anyone help me? it works like i want on Xterminal.but cant 'export' it to Queen Beecon Widget..help please... (actualy, it acept the code, with no errors but it doesent change any values.

You cannot paste it directly into QBW.
You need to connect to X-Terminal for that and then...:
Code:

~ $
cd /home/user
cat > myscript.sh
<here you paste the script>
#!/bin/sh
/usr/sbin/kernel-load /usr/share/kernel-power-settings/ideal
rm -f /etc/default/kernel-power
ln -s /usr/share/kernel-power-settings/ideal /etc/default/kernel-power
echo 125000 250000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/avoid_frequencies
echo 0 > /sys/devices/system/cpu/cpufreq/ondemand/ignore_nice_load
/usr/sbin/kernel-load

<then you press CTRL-D and you get the prompt again>

~ $ chmod 755 myscript.sh

Now you can "AddCmd": echo "/home/user/myscript.sh" | sudo gainroot

... and see what happens.

nokian-series 2010-04-25 01:11

Re: Desktop Command Execution Widget scripts
 
It dont have the result i've expected.
(if i do it from xterminal, line by line, it works ... )


Quote:

Originally Posted by No!No!No!Yes! (Post 626517)
You cannot paste it directly into QBW.
You need to connect to X-Terminal for that and then...:
Code:

~ $
cd /home/user
cat > myscript.sh
<here you paste the script>
#!/bin/sh
/usr/sbin/kernel-load /usr/share/kernel-power-settings/ideal
rm -f /etc/default/kernel-power
ln -s /usr/share/kernel-power-settings/ideal /etc/default/kernel-power
echo 125000 250000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/avoid_frequencies
echo 0 > /sys/devices/system/cpu/cpufreq/ondemand/ignore_nice_load
/usr/sbin/kernel-load

<then you press CTRL-D and you get the prompt again>

~ $ chmod 755 myscript.sh

Now you can "AddCmd": echo "/home/user/myscript.sh" | sudo gainroot

... and see what happens.


nokian-series 2010-04-25 10:13

Re: Desktop Command Execution Widget scripts
 
Is there another way to execute that commands with 'root' ?! Or i'm doing anything wrong with that method of script.sh ?


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

vBulletin® Version 3.8.8