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)

Pavol 2010-04-05 14:24

Re: Desktop Command Execution Widget scripts
 
http://i43.tinypic.com/r1fxi0.png
http://i42.tinypic.com/2m81d85.png

orac 2010-04-05 17:48

Re: Desktop Command Execution Widget scripts
 
The output of the free command separates out buffers and cache, which is also technically free memory for applications.

cpscotti 2010-04-05 17:58

Re: Desktop Command Execution Widget scripts
 
Quote:

Originally Posted by lubabula (Post 594632)
anyone can help?
i can only open 3 widgets on desktop, fourth only shows as "result" and all desktop widgets and shortcuts freeze. then hildon-home crashes.

Probably the command you set up for the fourth widget is broken and locks. Try Removing the ".desktop_cmd_exec" file in your home directory, this will force default values.

lubabula 2010-04-05 19:17

Re: Desktop Command Execution Widget scripts
 
Quote:

Originally Posted by cpscotti (Post 596577)
Probably the command you set up for the fourth widget is broken and locks. Try Removing the ".desktop_cmd_exec" file in your home directory, this will force default values.

excellent. its working now. thanks.

rooted 2010-04-05 20:15

Re: Desktop Command Execution Widget scripts
 
Yes, about the cache/buffer memory, it is true. I'll redesign scripts to use /proc/meminfo and extract information from there, this'll fix readings.

afaq 2010-04-06 13:48

Re: Desktop Command Execution Widget scripts
 
I'm trying to use the world time command -
http://wiki.maemo.org/Desktop_Comman...pts#World_time

But i think i need to store the shell script somewhere for me to use it.
Any one used this?

rooted 2010-04-07 12:13

Re: Desktop Command Execution Widget scripts
 
Whoever wrote previous scripts made some big mistakes, because the first one wasn't working and the second one was too complicated. I've rewritten scripts and whole wiki part.

afaq: Go and get the right ones and post feedback if they don't work.

rooted 2010-04-07 22:21

Re: Desktop Command Execution Widget scripts
 
Pavol & others: the wiki page has been updated with working scripts for memory usage. The readings should be fine now. Please retest them...

matristain 2010-04-07 23:06

Re: Desktop Command Execution Widget scripts
 
I am not sure if this is posible by this app , or if there's any other that can do what I am looking for (I have a plan with free 5 minutes call to one number)
I am looking for a shortcut that execute the call to this number and end it afer 4:50 minutes, It will be great if it is ended by the script (command) execute it self again, *unless the call its ended manually.

rooted 2010-04-08 06:39

Re: Desktop Command Execution Widget scripts
 
go to Phone control wiki page ang get the two commands for calling and ending the call. then write the script.

#!/bin/sh
-dial command-
sleep 290
-end call command-

290 = time in seconds.

then execute this script with dcew:

sh /path/script.sh | echo ""

remember that script has to be executable and cannot be in mydocs.

x-lette 2010-04-08 08:29

Re: Desktop Command Execution Widget scripts
 
Quote:

Originally Posted by rooted (Post 600585)
#!/bin/sh
-dial command-
sleep 290
-end call command-


then execute this script with dcew:

sh /path/script.sh | echo ""

Doesn't this make problems with a time-out? I think DCEW might not wait that long for a script to be ending.
Maybe this could work around:
sh /path/script.sh & ; echo ""
This way, the script would run in background and DCEW would receive the 'output' immediately. I didn't test it, just an idea.

matristain 2010-04-09 16:41

Re: Desktop Command Execution Widget scripts
 
I just can now make the call and end it the problem y have is when I end the call manually the script make the call again be cause it keeps running.
I try this

if dbus-send --system --dest=com.nokia.csd.Call --print-reply /com/nokia/csd/call com.nokia.csd.Call.Instance.GetStatus = "8" (this is call active, AFAIK)
then
"End call"
else
exit
fi


And get this error
"Data item "=" is badly formed"

Any advice?

rooted 2010-04-09 19:20

Re: Desktop Command Execution Widget scripts
 
Yeah, it's not THAT easy...

1. forgot #!/bin/sh

2. here:

if [ `dbus-send --system --dest=com.nokia.csd.Call --print-reply /com/nokia/csd/call com.nokia.csd.Call.Instance.GetStatus` = 8 ]

cpscotti 2010-04-11 22:10

Re: Desktop Command Execution Widget scripts
 
I just uploaded a new version do -devel that addresses many of the bugs described here (including for example the execution at boot, the settings dialog glitches..).

I'll leave it on -devel for some days and then start the promotion process.

Note that I didn't address any feature requests yet.

Enjoy..

andy_con 2010-04-11 22:16

Re: Desktop Command Execution Widget scripts
 
ive had to uninstall this app as my fone really dont like it. every few hours my n900 freezes, but now its uninstalled its working fine

anapospastos 2010-04-11 22:46

Re: Desktop Command Execution Widget scripts
 
I ve set a custom command named temperature with the command "cat /sys/devices/platform/omap34xx_temp/temp1_input" and every time I m doing a reboot it resets to uptime. Is this a known bug?

rooted 2010-04-11 23:26

Re: Desktop Command Execution Widget scripts
 
Quote:

Originally Posted by cpscotti (Post 606046)
I just uploaded a new version do -devel that addresses many of the bugs described here (including for example the execution at boot, the settings dialog glitches..).

I'll leave it on -devel for some days and then start the promotion process.

Note that I didn't address any feature requests yet.

Enjoy..


Does it address the bug associated with hildon-home/desktop freezing?

cpscotti 2010-04-12 03:48

Re: Desktop Command Execution Widget scripts
 
Quote:

Originally Posted by anapospastos (Post 606079)
I ve set a custom command named temperature with the command "cat /sys/devices/platform/omap34xx_temp/temp1_input" and every time I m doing a reboot it resets to uptime. Is this a known bug?

Very weird! Which version are you using?! things got way better lately... and I don't know why that would happen..
Try removing "/home/user/.desktop_cmd_exec" to clean your settings file and see if that happens again..

cpscotti 2010-04-12 03:49

Re: Desktop Command Execution Widget scripts
 
Quote:

Originally Posted by rooted (Post 606109)
Does it address the bug associated with hildon-home/desktop freezing?

So, if you mean the times that the user command locks, no it does not and since it only occurs with "malicious" commands... one could get around it.
But some older versions had different lock ups that no longer exists.
(as far as I know).

rooted 2010-04-12 07:14

Re: Desktop Command Execution Widget scripts
 
What are the malicious commands?

fpp 2010-04-12 09:31

Re: Desktop Command Execution Widget scripts
 
Quote:

Originally Posted by cpscotti (Post 606046)
I just uploaded a new version to -devel that addresses many of the bugs described here (including for example the execution at boot, the settings dialog glitches..).
I'll leave it on -devel for some days and then start the promotion process.
Note that I didn't address any feature requests yet.
Enjoy..

Has anyone succeeded in upgrading this ? I see it in app manager but it has missing dependencies, just like most other updates since the extras-devel autobuilder was "promoted" to the PR1.2 SDK :-(

This situation is getting *really* old...

sygys 2010-04-12 14:19

Re: Desktop Command Execution Widget scripts
 
This is garbage! please post usefull info!!!!!!! Like codes we can use!!

Rob1n 2010-04-12 14:23

Re: Desktop Command Execution Widget scripts
 
Quote:

Originally Posted by sygys (Post 606951)
This is garbage! please post usefull info!!!!!!! Like codes we can use!!

Erm - perhaps you could post some useful info. Like a reference to what you think is garbage, what codes you want, and what you want to use them for. Your message makes absolutely zero sense otherwise.

Robb 2010-04-12 20:43

Re: Desktop Command Execution Widget scripts
 
I am currently using 0.9 (very buggy).
Cannot upgrade to 1.10 because of missing dependency libhildon1.

noobmonkey 2010-04-12 20:45

Re: Desktop Command Execution Widget scripts
 
Quote:

Originally Posted by Robb (Post 607532)
I am currently using 0.9 (very buggy).
Cannot upgrade to 1.10 because of missing dependency libhildon1.

will resolve itself with PR1.2, just means the latest version got built recently on the autobuilder - which is using the new version ;)

Hopefully not long now :D

andy_con 2010-04-12 20:55

Re: Desktop Command Execution Widget scripts
 
Quote:

Originally Posted by Robb (Post 607532)
I am currently using 0.9 (very buggy).
Cannot upgrade to 1.10 because of missing dependency libhildon1.

same .

Robb 2010-04-12 21:39

Re: Desktop Command Execution Widget scripts
 
Changed Load: definition http://wiki.maemo.org/Desktop_Comman...t_scripts#Load
from:
Code:

uptime | sed 's/min/:/' | awk -F "[: ]" '{print $12,$13,$14}'

to:
Code:

uptime | sed 's/.*load.*: *//'

It eliminates the awk execution, therefore is much quicker.

rooted 2010-04-12 22:09

Re: Desktop Command Execution Widget scripts
 
Cool, I also improved "uptime" script based on your example.

timperi 2010-04-13 19:21

Re: Desktop Command Execution Widget scripts
 
Hi,

I have a script that freezes hildon when booting.
I resolved it with a little wrapper script that prevents it from running when uptime is less that 120 seconds.

Code:

#!/bin/sh

SAFELIMIT=120

if [ `cat /proc/uptime | awk '{ print int($1) }'` -gt $SAFELIMIT ] ; then
        genplaylists.sh /home/user/MyDocs/.sounds
else
        cat /proc/uptime | awk -v limit="$SAFELIMIT" '{print "T-",limit-int($1)}'
fi

Using this the desktop doesn't freeze when booting, just change your own script instead of the "genplaylists.sh ..." -line.
And you can decrease the safe limit also, 120 seconds is a bit overkill.

bng 2010-04-15 11:42

Re: Desktop Command Execution Widget scripts
 
1)
hi all, I would love to have a script that would send a predefined SMS to specific number, perhaps something similar to what matristain wanted. I only found this article: http://wiki.maemo.org/Phone_control#Send_SMS
thanks for any help

2)
also, increase power of FM transmitter script in the wiki does not work
Code:

rootsh echo 118 > /sys/class/i2c-adapter/i2c-2/2-0063/power_level | echo ""
from reading comments above, would this help?
Code:

echo "echo 118 > /sys/class/i2c-adapter/i2c-2/2-0063/power_level" | sudo gainroot

rooted 2010-04-15 18:08

Re: Desktop Command Execution Widget scripts
 
Please try the new FM transmitter script which you can found in wiki.

bng 2010-04-15 23:13

Re: Desktop Command Execution Widget scripts
 
So I updated my script, but it does not work (unlike fmboost application)
I check the power level using this command
Code:

cat /sys/class/i2c-adapter/i2c-2/2-0063/power_level

rooted 2010-04-15 23:19

Re: Desktop Command Execution Widget scripts
 
Please retry with brand new one. Btw: you do have "rootsh" installed, right?

bng 2010-04-16 00:06

Re: Desktop Command Execution Widget scripts
 
success, it works now! thank you

matristain 2010-04-16 00:21

Re: Desktop Command Execution Widget scripts
 
Hi again , I have already done my last request (make a call , wait 4:30minutes and if call is till active hang up and dial again).

I dont want to be off topic but now this is my question.

Is there a wey to get this done?
1.- Remove the WEB icon (launch microB browser) from the menu.
2.- Use the "Desktop Command Execution Widget" or a desktop shortcut to a little app.(.sh or .py) that ask for a password before Launching the Browser.

If there's no master password for the browser maybe we can prevent simple users to use It.

this may also be useful for other apps like Email client.

Jinux 2010-04-18 23:59

Re: Desktop Command Execution Widget scripts
 
Hi, not sure if this has been asked already but please please please could you build in a text wrapping feature. I have a command and the output is super long so I need it to automatically wrap on to the next line.

Awesome Widget otherwise =D

mjec 2010-04-19 04:35

Re: Desktop Command Execution Widget scripts
 
Quote:

Originally Posted by Jinux (Post 616901)
Hi, not sure if this has been asked already but please please please could you build in a text wrapping feature. I have a command and the output is super long so I need it to automatically wrap on to the next line.

Piping your command through fold might do what you need. For example:

command | fold -s -w 60

Note that I haven't tested this. More info on fold is available from http://unixhelp.ed.ac.uk/CGI/man-cgi?fold. Specifically the -w width may be of interest, depending on the width of your widget.

Not quite automatic word wrap, but this should work on a command-by-command basis.

Davey101 2010-04-19 19:50

Re: Desktop Command Execution Widget scripts
 
Quote:

Originally Posted by timperi (Post 609164)
Hi,

I have a script that freezes hildon when booting.
I resolved it with a little wrapper script that prevents it from running when uptime is less that 120 seconds.

Code:

#!/bin/sh

SAFELIMIT=120

if [ `cat /proc/uptime | awk '{ print int($1) }'` -gt $SAFELIMIT ] ; then
        genplaylists.sh /home/user/MyDocs/.sounds
else
        cat /proc/uptime | awk -v limit="$SAFELIMIT" '{print "T-",limit-int($1)}'
fi

Using this the desktop doesn't freeze when booting, just change your own script instead of the "genplaylists.sh ..." -line.
And you can decrease the safe limit also, 120 seconds is a bit overkill.

This is very useful thanks, at least until the new version comes along. :)

I have a couple of commands to wake and hibernate my (Windows XP) desktop PC over my wifi or vpn, so I don't want them both to be executed on every boot of the N900.

However, my hibernate script (using psshutdown and freesshd) is hanging every time it is successfully executed. I'm not yet sure whether that is fixable but it was causing the N900 desktop to hang, so I implemented a timeout to kill the script after a few seconds.

This page led me to this script which does the job perfectly.

Here is my problem script, if anyone can suggest improvements:
Code:

# ssh to Dave (local or VPN) and hibernate
ssh 192.168.69.50 'psshutdown -h -t 00 -accepteula'


Jinux 2010-04-19 19:56

Re: Desktop Command Execution Widget scripts
 
Quote:

Originally Posted by mjec (Post 617069)
Piping your command through fold might do what you need. For example:

command | fold -s -w 60

Note that I haven't tested this. More info on fold is available from http://unixhelp.ed.ac.uk/CGI/man-cgi?fold. Specifically the -w width may be of interest, depending on the width of your widget.

Not quite automatic word wrap, but this should work on a command-by-command basis.

I'll check that out :)

stayloa 2010-04-23 12:41

Re: Desktop Command Execution Widget scripts
 
This app seems to kill my hildon-home and after reboot I get blank desktops... Anyone got anything similar or workarounds?

N900 is still usable so I just uninstall and reboot... apps come back... Annoying though as I want to use this to activate the handwriting recognition script.


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

vBulletin® Version 3.8.8