pWidgets 2.5.8

Window managers, icon programs, widgets, etc.
Message
Author
User avatar
trio
Posts: 2076
Joined: Sun 21 Dec 2008, 15:50
Location: अनà¥￾मोदना

#316 Post by trio »

01micko wrote:Sigmund

Trio's clockfix with 'xmovewindowbyclassname' seems good. As mentioned in previous posts we seem to have it working nicely.

Here are the changes to the 'func' file

Code: Select all

			echo "xonclock --position=$POS_XONCLOCK --offset-v=$OFFSET_Y --offset-h=$OFFSET_X --no-winredirect --skin=$IMAGE &" >> $HOME/.pwidgets/tmp/pwidgets-exec
if [ "$POS_XONCLOCK" = "TOP_LEFT" ] ; then

			echo "sleep 5 ; xmovewindowbyclassname xonclock $[$X_WIDTH+$OFFSET_X+40] $OFFSET_Y" >> $HOME/.pwidgets/tmp/pwidgets-exec

else
			echo "sleep 5 ; xmovewindowbyclassname xonclock $[$X_WIDTH+$OFFSET_X] $OFFSET_Y" >> $HOME/.pwidgets/tmp/pwidgets-exec

fi
You can see the change trio has made, the only change I made was remove the 'use-background' option and add the 'no-winredirect' option.

I hope this is good and stable. It allows us to dump 'xevent'. (lots of whinging about that 'fix' :lol: ) 'xmovewindowbyclassname' is less than 4k.

Sorry for previously uploading hacked files. Next time just the code, and instructions how to edit, but testers have been few and far between, as you can see by the lack of feedback. Ah well.

Mick
Dear Micko, I am not with puppy linux right now, I am on windows, but you quoted the code not completely, there was no X_WIDHT in the original code. You must quote from the beginning...

and if you already dowloaded wmctrl and put it in usr/local/bin you change the func file to:

echo "xonclock --position=$POS_XONCLOCK --offset-v=$OFFSET_Y --offset-h=$OFFSET_X --no-winredirect --skin=$IMAGE &" >> $HOME/.pwidgets/tmp/pwidgets-exec
if [ "$POS_XONCLOCK" = "TOP_LEFT" ] ; then

echo "sleep 2 ; wmctrl -x -r xonclock 0,$[$X_WIDTH+$OFFSET_X+40],$OFFSET_Y,140,140" >> $HOME/.pwidgets/tmp/pwidgets-exec

else

echo "sleep 2 ; wmctrl -x -r xonclock 0,$[$X_WIDTH+$OFFSET_X],$OFFSET_Y,140,140" >> $HOME/.pwidgets/tmp/pwidgets-exec

it will move the window to the right position, and the sleep can be lower too. I am thinking how we can use wmctrl not to move the window, but to open at the right position, it would be good right? I haven't try it yet.

Thank you

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

#317 Post by zigbert »

trio

How does wmctrl differ from xmovewindowbyclassname?

Code: Select all

but you quoted the code not completely, there was no X_WIDHT in the original code. You must quote from the beginning... 
That's ok, I figured it out.

I have changed 'scale2pics' to 'resizepng'. We could test it on clockskins, but I don't think the resize quality it very good.


Sigmund

User avatar
trio
Posts: 2076
Joined: Sun 21 Dec 2008, 15:50
Location: अनà¥￾मोदना

#318 Post by trio »

zigbert:

wmctrl can do lots of things! You can manipulate the use of window managers with wmctrl, not only moving windows like movewindowbyclassname, it can resize windows, move widows to another desktop, almost everything a window manager does. it can be useful for puppy users for ither things not only for xonclock. the downside is the window has to be opened first, before you can do things to it.

another thing that I think is the best is devil's pie, it can manipulate exectly like wm does, set sets of rules for an appllication before it is launched. But the downside is that it is 100Kbs of size, I don't think that it is suitable for a standard puppy.

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

#319 Post by zigbert »

Mick

if you are in the mood of making a simple font, it would be great having the Puppy logo in one font.
Attachments
puppylogo_svg_.tar.gz
(1.52 KiB) Downloaded 339 times

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

#320 Post by zigbert »

trio
Thanks for the explanation.

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

#321 Post by 01micko »

Hi guys

Trio,

Not sure which 'func' file of yours I have but there are a few. Anyhow, it works!

SIgmund,
You can add back in '--use-background', I think it is ok. Then your clock will work.

Where are the rest of your 'doggy cartoons', I'm sure I can add them to 'pweather', who cares if it is not all weather, and besides, it could be a 'dog' of a day!, Or a 'dog day afternoon'! 8)

Trio again,

Tried the new fix with 'wmctrl' and not quite working, it wants to work. When it appeared (the clock) it was under the Pwidgets gui! As soon as I tried to move it it flickered at the position it was meant to be. Very close.

Cheers you blokes.

Mick
Puppy Linux Blog - contact me for access

User avatar
trio
Posts: 2076
Joined: Sun 21 Dec 2008, 15:50
Location: अनà¥￾मोदना

#322 Post by trio »

Micko,

Yup, it does pops up like that, might be anywhere on the screen then go to the designated position. just like xmovewindowbyclassname, but it has much more features that can be useful for other things, pls see the man page.
Also there is actually, a more advance wmctrl that's called xctrl (which I cannot find to download) that can redirect the xonclock window even if it is in a nowin-redirect=false state, with -O command option. so, we can add this line to pwidgets-exec like:

xctrl -x -O -r xonclock -b remove,below

that should make xonclock appears by itself without moving around first

Anybody has the compiled xctrl? pls upload.....

Anyway..I will try the -O option to take over the window control with wmctrl when I get back home...but I think it won't work

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

#323 Post by zigbert »

Mick

The dog font is at http://www.dafont.com/doggon.font
This font is rather big, so either we can pick a few cartoons an put together with the Puppy logo, or we build a pet with the dogon (cartoons) font. You already got the 'Pet' widgets in your list. This will work when you install the doggon.ttf.


Sigmund

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

#324 Post by 01micko »

wmctrl - interact with a EWMH/NetWM compatible X Window Manager.
from the man page

Icewm is compliant, is JWM? This is where I have a problem....
Puppy Linux Blog - contact me for access

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

#325 Post by zigbert »

micko01 wrote:SIgmund,
You can add back in '--use-background', I think it is ok. Then your clock will work.
Yes i can, but then I have to ClickClock :)

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

#326 Post by 01micko »

No you don't. :wink:

Code: Select all

if [ "$WIDGETS_POSITION" = "left" ]; then
POS_XONCLOCK=TOP-LEFT
POS_CONKY=top_left
X_WIDTH=0
else
POS_XONCLOCK=TOP-RIGHT
POS_CONKY=top_right
X_WIDTH=$[$X_PIXELS-140]
fi
#build exec-file
echo -e "\c" > $HOME/.pwidgets/tmp/pwidgets-exec
while read TREE_WIDGET; do

HEIGHT="`grep HEIGHT= $HOME/.pwidgets/configs/$TREE_WIDGET | cut -d '=' -f 2`"
case "$TREE_WIDGET" in
			"Clock-analog")
			OFFSET_X=`grep OFFSET_X= $HOME/.pwidgets/configs/$TREE_WIDGET | cut -d '=' -f 2`
			IMAGE="`grep IMAGE= $HOME/.pwidgets/configs/$TREE_WIDGET | cut -d '=' -f 2`"
			echo "xonclock --position=$POS_XONCLOCK --offset-v=$OFFSET_Y --offset-h=$OFFSET_X --no-winredirect --use-background --skin=$IMAGE &" >> $HOME/.pwidgets/tmp/pwidgets-exec
if [ "$POS_XONCLOCK" = "TOP_LEFT" ] ; then

			echo "sleep 5 ; xmovewindowbyclassname xonclock $[$X_WIDTH+$OFFSET_X+40] $OFFSET_Y" >> $HOME/.pwidgets/tmp/pwidgets-exec

else
			echo "sleep 5 ; xmovewindowbyclassname xonclock $[$X_WIDTH+$OFFSET_X] $OFFSET_Y" >> $HOME/.pwidgets/tmp/pwidgets-exec

fi
Works ok for me, must be 140x140 though, but I can live with that. :)

Incidentally, song playing in Pmusic is 'Victim of Changes', Judas Priest, circa 1976, I saw them live in September, classic old school British heavy metal. I was raised on it! (Ooh, now I'm giving away some numbers :wink: )
Attachments
noyoudont.jpg
(21.56 KiB) Downloaded 841 times
Puppy Linux Blog - contact me for access

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

#327 Post by 01micko »

Dafont is offline atm. :cry: Ok, I'll wait, might be a day, might be a week.
I gather it is GPL? Or at least opensource licence?

Thx
Puppy Linux Blog - contact me for access

User avatar
trio
Posts: 2076
Joined: Sun 21 Dec 2008, 15:50
Location: अनà¥￾मोदना

#328 Post by trio »

Micko,

I am sure wmctrl is JWM compliant...but anyway, the file itself is 65K, so it is big. Only showing you guys that there might be other ways to do it..including using devil's pie (setting window rules before an application is executed like a WM but from a command line).....for now we stick to xmovewindowbyclssname i think.

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

#329 Post by 01micko »

Yes trio

xmovewimdowbyclassname is only <4kb, that suits our small footprint :wink:

Is it possible to set more options in winoptions? Say 'layer: desktop=1' :?: :?
Puppy Linux Blog - contact me for access

User avatar
trio
Posts: 2076
Joined: Sun 21 Dec 2008, 15:50
Location: अनà¥￾मोदना

#330 Post by trio »

yes offcourse, but you would have to change winoptions manually to set geometry, that was our problem, remember? because with no-winredirect=true, xonclock is dependant to the window manager fully

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

#331 Post by zigbert »

I thought everything was ok, but then I restarted X and it crashed because of the --no-winredirect parameter of xonclock. I use jwm. Can you please test if it works for you. Below is the content of /root/.pwidgets/pwidgets-exec

Code: Select all

xonclock --position=TOP-RIGHT --offset-v=30 --offset-h=-40 --no-winredirect --use-background --skin=/root/.pwidgets/misc/Clock-analog.png &
sleep 5 ; xmovewindowbyclassname xonclock 1100 30

Thanks
Sigmund

User avatar
trio
Posts: 2076
Joined: Sun 21 Dec 2008, 15:50
Location: अनà¥￾मोदना

#332 Post by trio »

Zigbert

It didn't happen to me, but anyway maybe it's safer to put that parameter in the /root/.xonclockrc (no-winredirect = true) only, and delete the that parameter in func file.

Thx

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

#333 Post by 01micko »

Hi guys,

I'm extremely sad :cry: to report it is the 'xmovewindowbyclassname' crashing X in JWM, not 'no-winredirect'. It doesn't matter if you have it in the script or in .xonclockrc. I was playing around with 'no-winredirect long before I came up with the 'xevent' fix. No crashes, just clock in a window, left of screen. Maybe it is because it is executing before JWM is fully loaded, suppose I'll investigate, the fix is too good to dump, there could be a simple workaround.

On the subject of '.xonclockrc', maybe all options could be there and we could make it more 'Pwidgets' compliant, that is, clean up the code to reflect where pwidgets options are stored, for example the skin path. Maybe then we could write smaller scripts, just a thought. :wink:

Mick
Puppy Linux Blog - contact me for access

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

#334 Post by 01micko »

Ok, cleaning up ',xonclockrc'

Code: Select all

#
# --- xonclock configuration file example ---
#
# 1) any comments are followed by '#' symbol
# 2) if there is no value after '=' then xonclock ignore it and uses
#    default internal value
# 3) to get full description of parameter may be set see xonclock manual page
# 4) to set any parameter use syntax: "param = value"
#

#
# path to clock skin
skin = /root/.pwidgets/misc/Clock-analog.png

#
# base clock position:
# (TOP-LEFT | TOP-CENTER | TOP-RIGHT | MIDDLE-LEFT |
# MIDDLE-CENTER | MIDDLE-RIGHT | BOTTOM-LEFT |
# BOTTOM-CENTER | BOTTOM-RIGHT)
#position = TOP-CENTER

#
# vertical and gorizontal offset (pixels)
offset-v = 
offset-h = 

#
# length and width of hours hand (pixels)
hour-length =
hour-width =

#
# length and width of minutes hand (pixels)
minute-length = 50
minute-width =

#
# length and width of seconds hand (pixels)
second-length =
second-width =

# colors of clock hands
color-hour = 70/70/70/255     # color in form R/G/B/A
color-minute = 70/70/70/255   # color in form R/G/B/A
color-second = 240/136/15/255  # color in form R/G/B/A

#
# seconds rendering flag
show-seconds = true

#
# how many seconds sleep before render the clock at startup
sleep = 3

#
# date rendering flag
show-date = false              # (true | false)

#
# date string params
date-font =                   # font name
date-color =                  # color in form R/G/B/A
date-format = %G-%m-%d        # date-render format
date-position =               # format the same as for
                              # position parameter (see above)
date-offset-v =               # pixels
date-offset-h =               # pixels
date-clip-format = %G-%m-%d   # how represent date string when
                              # copying to clipboard

#
# turn off override-redirect flag
no-winredirect = true        # (true | false)

#
# where the center of clock hands should be
hands-rotation-axis =         # X/Y pixels

#
# keep clock on top
top = false                   # (true | false)

#
# clock hands overlapping size
overlap =                     # pixels

#
# make clock movable
movable = true                # (true | false)

#
# use background (for skins with aplpha channel)
use-background = true        # (true | false)

#
# microsecond interval to wait until obscured
# windows have been refreshed (useful only if
# use-background = true) while retrieving new
# background
remerge-sleep = 5000

#
# to customize time zone
tz-hour = 0
tz-min = 0

#
# alpha channel threshold value
alpha-threshold = 127
So far all I did was delete all options for xonclock in a standard unhacked Pwidgets-0.4 /usr/local/pwidgets/func file. It works as expected. Clock appears on left of screen and manually move it to it's correct position.
Now maybe I'll add xmovewindowbyclassname to func with 10 seconds sleep. See what happens.
Puppy Linux Blog - contact me for access

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

#335 Post by 01micko »

Seems more sleep does not work. Any more sleep and I will fall asleep waiting for clock to appear or X server to crash. How else can we do it?
Puppy Linux Blog - contact me for access

Post Reply