pWidgets 2.5.8

Window managers, icon programs, widgets, etc.
Message
Author
User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#61 Post by zigbert »

I have already made the fix for the wallpaper setter, but I made the 'apply' button re-render the widgets. To me it feels more logical to 'apply' the changes rather than 'close' the window.
I'll make a note in the main post.

code start from line 238 in /usr/local/apps/wallpaper/AppRun. I have added the 2 lines in the middle.

Code: Select all

     <button>
      <label>$LOC_APPLY</label>
      <input file stock=\"gtk-apply\"></input>
      <action>$APPDIR/slideshow -stop</action>
      <action>$APPDIR/set_bg \"\$IMAGE\"</action>
      <action>echo \"\$IMAGE\" > \$HOME/.config/wallpaper/bg_img</action>

<action>fixwidgets</action>
<action>cat /root/.config/tmp/bg_img</action>

      <action type=\"refresh\">TEXT</action>
     </button>

User avatar
ttuuxxx
Posts: 11171
Joined: Sat 05 May 2007, 10:00
Location: Ontario Canada,Sydney Australia
Contact:

#62 Post by ttuuxxx »

If you look back at my post, I made 2 versions
version 1 you click the "close" button and it restarts Pwidgets.
Version I added a button "Pwidgets Restart", you click that button and it restarts Pwidgets, Basically I think its the same way you did it :)
ttuuxxx
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#63 Post by 01micko »

Zigbert
01micko wrote
What I did was write a script (WOW! my first script! Please point out to me what I could have done better, but it works Rolling Eyes ) that sleeps for 5 seconds to allow the window manager to load then moves the cursor a few pixels and left clicks the mouse. I edited /usr/sbin/fixwidgets to point it to the script and viola!
Yes, clock appears like magic.....
Hmmmmm, this fix is buggy if you move the cursor directly after hitting 'apply'. Problem is that if the fake mouse click happens over the open window near the edge next time you move the cursor the window resizes! :( Or, the cursor may end up over an icon and initiate that process! :evil:
Ok, what I need to do is find a vacant piece of real estate on the desktop and make sure the mouse click is generated there and nowhere else.
I cand send the cursor to an extreme edge or corner (I'm thinking top left) and make the click there. To make it look professional though I should send the cursor back to the centre of the screen. Will work on this and reupload a new script.
After I get this fix right I'll take a closer look at xonclock to find the bug and make a permanent fix.
Puppy Linux Blog - contact me for access

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#64 Post by zigbert »

I will (when sparetime comes my way) rework the Pwidgets infrastructure to be more flexible to user-created mods and created widgets. Your fix is VERY welcome.

There is no hurry! If we could make a Pwidgets upgrade during Christmas it would be great.

Sigmund

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#65 Post by 01micko »

zigbert wrote:I will (when sparetime comes my way) rework the Pwidgets infrastructure to be more flexible to user-created mods and created widgets. Your fix is VERY welcome.

There is no hurry! If we could make a Pwidgets upgrade during Christmas it would be great.

Sigmund
No worries, I'll try to fine tune my fix, no pressure is good! I have plenty of time over Christmas and may even find time for a slide show widget. That would be cool, but I fear it will be too large to include as default. That is where the work you are doing on the infrastructure comes in.
Looking forward to it! :wink:
Puppy Linux Blog - contact me for access

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#66 Post by zigbert »

A slideshow would be very cool !!! :)

Why do you think it would be so huge? Have you looked at 'xli' (already installed with the conky package). I think it can crop/scale and place any image on the desktop.


Sigmund

User avatar
WhoDo
Posts: 4428
Joined: Wed 12 Jul 2006, 01:58
Location: Lake Macquarie NSW Australia

#67 Post by WhoDo »

zigbert wrote:I will (when sparetime comes my way) rework the Pwidgets infrastructure to be more flexible to user-created mods and created widgets. Your fix is VERY welcome.

There is no hurry! If we could make a Pwidgets upgrade during Christmas it would be great.
I plan to release a Puppy 4.2alpha by Christmas using the existing Pwidgets, but it would be great to have the revised version available for when we go to beta.

I am on holiday from 19 December until 12 January and somewhere in there I'll be building a few Puppy's, if my wife doesn't object too loudly. :P
[i]Actions speak louder than words ... and they usually work when words don't![/i]
SIP:whodo@proxy01.sipphone.com; whodo@realsip.com

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#68 Post by 01micko »

@zigbert
Really don't have much clue, do I? :oops: :lol: Anyway, have found the xloadimage man page and am hoping most if not all the options have not been lost in the translation (from xloadimage to xli). Some seem to work fine. I think I will be able to do something with the slide show, will be a good project for me I think and I have a whole Puppy Community to draw from! When I make some advancements I may make a thread about it but that will be a week or two away yet.
Cheers,
Micko

PS,@WhoDo, woo her with flowers :wink:

UPDATE: have a name for slideshow widget, 'xlideshow'. Did a google-linux and it doesn't exsist. 8)
Last edited by 01micko on Sat 13 Dec 2008, 06:32, edited 1 time in total.
Puppy Linux Blog - contact me for access

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#69 Post by 01micko »

Now have a new 'wakeclock.sh' file for xonclock. It creates the mouseclick in the extreme topleft corner, then returns the cursor somewhere near the centre of screen. Only finds perfect centre on 1024x768. If you want perfect centre for a differrent resolution you must open the file as text and edit the third line.

Code: Select all

sleep 0.1 ; xevent -a 512 384
Change "512 384" with half of the dimensions of your screen resolution.
eg: if your res is 800x600 substitute "512 384" with "400 300".
This will snap the cursor to the centre of the screen on boot or restarting Pwidgets if you use the analog clock.
Micko

Update: File 'wakeclock.sh.gz' removed. Still available further back in this thread however is not needed because it is included in the latest Pwidgets version.
Now if you want to return the cursor to centre and you have a different screen resolution to 1024x768, you must edit the last line in /usr/sbin/fixwidgets. Refer to code and instructions above.
Last edited by 01micko on Sat 20 Dec 2008, 03:54, edited 3 times in total.
Puppy Linux Blog - contact me for access

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#70 Post by HairyWill »

barry uses the following in pup_event_frontend_d to calculate screensize

Code: Select all

SCRNXY="`xwininfo -root | grep -o '\-geometry .*' | tr -s ' ' | cut -f 2 -d ' ' | cut -f 1 -d '+'`"
SCRN_X="`echo -n "$SCRNXY" | cut -f 1 -d 'x'`"
SCRN_Y="`echo -n "$SCRNXY" | cut -f 2 -d 'x'`"
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#71 Post by MU »

To get width and height of your screen:

Code: Select all

SCREENX=`xscreensize | sed "s/ .*//"` 
SCREENY=`xscreensize | sed "s/^[^ ]* //"`
You will need xscreensize, extract it in /usr/X11R7/bin/:
http://www.murga-linux.com/puppy/viewto ... ch&id=7845

Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#72 Post by 01micko »

Thanks Will and Mark.
Don't really understand too much about code yet, still a 'puppy' when it comes to that! lol, but I'll try to use your suggestions to save any newbies uncomfortable with editing, getting their paws dirty!
Cheers,
Micko
Puppy Linux Blog - contact me for access

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#73 Post by zigbert »

The /usr/sbin/iconswitcher should update widgets when restarting rox. End of file will look like this:

Code: Select all

 rox -p=/root/Choices/ROX-Filer/PuppyPin
 fixwidgets &
 jwm -restart
fi


###END###

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#74 Post by 01micko »

Hi zigbert,
I have made small progress on 'xlideshow'.
What I need to know is the size of the widget. I'm guessing 140x140 like the clock. Not too sure if a transparent background will work, see what develops. Sqare is the go I think because some images are landscape and some portrait. I think 5 seconds is a good delay time.
Puppy Linux Blog - contact me for access

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#75 Post by zigbert »

01micko
progress on 'xlideshow'. This is good news :)

Could you set up 4 variables in the beginning of the script (height, width, delay, image_directory). This way I could easily rebuild it to fit the new structure, and user could easily configure it.


Sigmund

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#76 Post by 01micko »

Still plugging away trying to get a slideshow with 'xlideshow'. The problem is scaling. The 'iscale' option in xli only scales by factor. So I searched, thought and searched. First I thought maybe to use Rox thumbnails. There are also lots of thumbnail executables on the web, many way too bloated or need libs or other dependancies. :(
You know where I I found the most probable solution? Yes, you guessed it, right here on this forum! :wink:
Mid this year Mark, aka MU, created a small script called 'scale2pic'. Very useful and preserves aspect ratio. It is 13K compressed, installed without a hitch. :mrgreen:
Anyway, after a couple of weeks I may be able to come up with a pre-alpha. Wait and see...
Puppy Linux Blog - contact me for access

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#77 Post by zigbert »

Version 0.2 is uploaded.
See main post.


Sigmund

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#78 Post by HairyWill »

works for me

It highlighted a problem with the interaction between jwm, xli and the X server (possibly just xvesa).

If my jwm config contains a desktop definition such as

Code: Select all

<!-- Number of virtual desktops -->
<Desktops count="3">
  <Desktop>
    <Background type="gradient">#3A6EA5:#0F58A5</Background>
  </Desktop>
  <Desktop>
    <Background type="gradient">#000000:#FFFFFF</Background>
  </Desktop>
  <Desktop>
    <Background type="gradient">#FF0000:#FFFFFF</Background>
  </Desktop>
</Desktops>
then xli -onroot .......... crashes X (that is xvesa because xorg doesn't work on this machine at all)

It is a marginal problem because I think that the only way to get a jwm config like this in puppy at the moment is to hand code it.
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#79 Post by 01micko »

Installed Pwidgets 0.2.
Bug in "Battery"
The first line under "TEXT" in ~/.pwidgets/configs/battery is wrong, one too many "$" at start of line. (BTW I guessed, literally :? )

Code: Select all

${font DejaVu:bold:size=13}
is I think how it should be; it works.

Also I had the same issue as when I installed pwidgets0.1 with the fonts. Something went wild with my install and I had to replace /usr/share/fonts/default/TTF/MONOFONT.TTF with a fresh copy from the package. :?

PS,updated analog clock HOWTO

PPS, weather widget works great!
Attachments
batterymeter.jpg
(15.74 KiB) Downloaded 1602 times
Last edited by 01micko on Fri 19 Dec 2008, 15:04, edited 1 time in total.
Puppy Linux Blog - contact me for access

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#80 Post by zigbert »

Thanks for bugreport. I have fixed the Pwigdets-0.2 package and uploaded the fresh one.

Post Reply