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)

fred123 2010-01-27 03:33

Re: Desktop Command Execution Widget scripts
 
Yes its 0.6.

I updated it through app manager a couple of hours ago. Just tried uninstalling and reinstalling, but it still behaves the same.

I'm running usa pr1.1 firmware.

cpscotti 2010-01-27 08:07

Re: Desktop Command Execution Widget scripts
 
Quote:

Originally Posted by fred123 (Post 496754)
Yes its 0.6.

I updated it through app manager a couple of hours ago. Just tried uninstalling and reinstalling, but it still behaves the same.

I'm running usa pr1.1 firmware.

So... this is weird but try rebooting. Or first try removing the app, the go back to the desktops... wander around a little bit and theeen install again...
What might be happening is that maemo is still using the old .desktop file.

No!No!No!Yes! 2010-01-27 10:17

Re: Desktop Command Execution Widget scripts
 
Quote:

Originally Posted by cpscotti (Post 496678)
Hi!
I just read most of the brainstorm and it really IS close to my widget! =]
Some observations: instead of multiple lines, we opted for multiple widgets with user-defined width. The idea is to output short info there.

About an editor with syntax highlight .. well.. I believe you can simply use whatever editor you like to create your script (e.g. script.sh) and then just call that script from the widget (e.g. /path2script/script.sh).

By text size you mean font? Well.. anyway.. this app is VERY young.. not even in extras yet.. maybe with some more time.. ;)

Hi,
I joggled a bit with the source code from release 0.6 and I ended up with this (commands are just examples to show feasibility)

http://i45.tinypic.com/313skyp.png
http://i50.tinypic.com/nc1gsh.png
http://i50.tinypic.com/2z8uef4.png

I hope developer could integrate this in next release if not already brewing.

Modified code desktop-cmd-exec.0.601.c is commented at end of line with
PHP Code:

//AP 

Like this:
PHP Code:

        gdouble widthRatio;
        
gdouble heightRatio;//AP 


cpscotti 2010-01-27 10:22

Re: Desktop Command Execution Widget scripts
 
Quote:

Originally Posted by No!No!No!Yes! (Post 497114)
Hi,
I joggled a bit with the source code from release 0.6 and I ended up with this (commands are just examples to show feasibility)

http://i45.tinypic.com/313skyp.png
http://i50.tinypic.com/nc1gsh.png
http://i50.tinypic.com/2z8uef4.png

I hope developer could integrate this in next release if not already brewing.

Modified code desktop-cmd-exec.0.601.c is commented at end of line with
PHP Code:

//AP 

PHP Code:

        gdouble widthRatio;
        
gdouble heightRatio;//AP 


=]]
I'll sure add it to the main source tonight!! (with proper credits)
Seems my code is not THAAT bad then.. lol!


Thanks!
Like this:

No!No!No!Yes! 2010-01-27 11:00

Re: Desktop Command Execution Widget scripts
 
Quote:

Originally Posted by cpscotti (Post 497121)
=]]
I'll sure add it to the main source tonight!! (with proper credits)
Seems my code is not THAAT bad then.. lol!


Thanks!
Like this:

I confess I liked the timer Beard-Trick ("Barbatrucco")!!!
And learnt a lot by your coding!!!
:cool:

PHP Code:

.........snip.........
    
gtk_window_resize (GTK_WINDOW (self), (int)(SIZE_WIDTH_ALL*0.118), SIZE_HEIGHT_LINE);

    
g_timeout_add (500, (GSourceFunc)desktop_cmd_exec_resize_hackself);
........
snip.........

gboolean desktop_cmd_exec_resize_hack(DesktopCmdExec *self)
{
//     g_warning("HACK");
    
if(self->priv->widgetID != NULL)
    {
        
desktop_cmd_exec_read_settings (self);
        
desktop_cmd_exec_update_content (self);

//g_warning("W %d H %d",(int)(SIZE_WIDTH_ALL*self->priv->widthRatio),(int)(SIZE_HEIGHT_LINE*self->priv->heightRatio));//AP
//        gtk_widget_set_size_request (GTK_WIDGET (self), (int)(SIZE_WIDTH_ALL*self->priv->widthRatio), SIZE_HEIGHT_LINE);//AP
//        gtk_window_resize (GTK_WINDOW (self), (int)(SIZE_WIDTH_ALL*self->priv->widthRatio), SIZE_HEIGHT_LINE);//AP
        
gtk_widget_set_size_request (GTK_WIDGET (self), (int)(SIZE_WIDTH_ALL*self->priv->widthRatio), (int)(SIZE_HEIGHT_LINE*self->priv->heightRatio));//AP
        
gtk_window_resize (GTK_WINDOW (self), (int)(SIZE_WIDTH_ALL*self->priv->widthRatio), (int)(SIZE_HEIGHT_LINE*self->priv->heightRatio));//AP
    
}
//     else
//     {
//         g_warning("HACK unsuccessful");
//     }

    
return FALSE;
}
.........
snip......... 


cpscotti 2010-01-27 11:09

Re: Desktop Command Execution Widget scripts
 
Quote:

Originally Posted by No!No!No!Yes! (Post 497174)
I confess I liked the timer Beard-Trick ("Barbatrucco")!!!
And learnt a lot by your coding!!!
:cool:

PHP Code:

.........snip.........
    
gtk_window_resize (GTK_WINDOW (self), (int)(SIZE_WIDTH_ALL*0.118), SIZE_HEIGHT_LINE);

    
g_timeout_add (500, (GSourceFunc)desktop_cmd_exec_resize_hackself);
........
snip.........

gboolean desktop_cmd_exec_resize_hack(DesktopCmdExec *self)
{
//     g_warning("HACK");
    
if(self->priv->widgetID != NULL)
    {
        
desktop_cmd_exec_read_settings (self);
        
desktop_cmd_exec_update_content (self);

//g_warning("W %d H %d",(int)(SIZE_WIDTH_ALL*self->priv->widthRatio),(int)(SIZE_HEIGHT_LINE*self->priv->heightRatio));//AP
//        gtk_widget_set_size_request (GTK_WIDGET (self), (int)(SIZE_WIDTH_ALL*self->priv->widthRatio), SIZE_HEIGHT_LINE);//AP
//        gtk_window_resize (GTK_WINDOW (self), (int)(SIZE_WIDTH_ALL*self->priv->widthRatio), SIZE_HEIGHT_LINE);//AP
        
gtk_widget_set_size_request (GTK_WIDGET (self), (int)(SIZE_WIDTH_ALL*self->priv->widthRatio), (int)(SIZE_HEIGHT_LINE*self->priv->heightRatio));//AP
        
gtk_window_resize (GTK_WINDOW (self), (int)(SIZE_WIDTH_ALL*self->priv->widthRatio), (int)(SIZE_HEIGHT_LINE*self->priv->heightRatio));//AP
    
}
//     else
//     {
//         g_warning("HACK unsuccessful");
//     }

    
return FALSE;
}
.........
snip......... 


Good that it helped someone!
That hack was necessary when I started with custom width. Without it, the "X" (close) bt for the widget would go to the top-right corner when the widget is loaded but it would continue there forever...
I you shrank the widget you would get a flying "X" in the middle of nothing =0. The hack is to always load the widget with the small size (to put the X bt beside the Conf one) and then resize it some time later..
:D

No!No!No!Yes! 2010-01-27 11:28

Re: Desktop Command Execution Widget scripts
 
Quote:

Originally Posted by cpscotti (Post 497187)
Good that it helped someone!
That hack was necessary when I started with custom width. Without it, the "X" (close) bt for the widget would go to the top-right corner when the widget is loaded but it would continue there forever...
I you shrank the widget you would get a flying "X" in the middle of nothing =0. The hack is to always load the widget with the small size (to put the X bt beside the Conf one) and then resize it some time later..
:D

I believe there is still something to be investigated with respect to positioning of "service" icons (settings/close)... this is also quite weird:
http://i46.tinypic.com/o0cthd.png

There is also an other issue with the positioning of newly instantiated DCE widgets. They get created on different desktop than the one you are working on.

I tested the code in X86 scratchbox only, so far.

cpscotti 2010-01-27 11:32

Re: Desktop Command Execution Widget scripts
 
Quote:

Originally Posted by No!No!No!Yes! (Post 497220)
I believe there is still something to be investigated with respect to positioning of "service" icons (settings/close)... this is also quite weird:
http://i46.tinypic.com/o0cthd.png

There is also an other issue with the positioning of newly instantiated DCE widgets. They get created on different desktop than the one you are working on.

I tested the code in X86 scratchbox only, so far.

Well.. I'll just "extend" the "hack" to height. I believe that what happened there is due to the lower widget being "saved" as big and the re-loaded. The others were loaded from a single line one and then extended. Try restarting the GUI and you'll see the service icons "going around".

vldcnst 2010-01-27 12:00

Re: Desktop Command Execution Widget scripts
 
Code:

wget -q -O - api.myiptest.com | awk -F"\"" '{ print "ext        " $4 " (" toupper($28) ")" }'
Getting external IP address and country code.

Code:

wget -q -O - api.myiptest.com | awk -F"\"" '{ print "ext        " $4 " (" $12 " " toupper($28) ")" }'
Getting external IP address, ISP name and country code.

naabi 2010-01-27 12:10

Re: Desktop Command Execution Widget scripts
 
Do I feel stupid after reading the previous example.Tried to give wget switch -O /dev/stdout, and it worked only randomly, so I decided to use a temp file. Well, you learn...


All times are GMT. The time now is 09:55.

vBulletin® Version 3.8.8