pWidgets 2.5.8

Window managers, icon programs, widgets, etc.
Message
Author
User avatar
Evil20071
Posts: 489
Joined: Sat 07 Jun 2008, 19:50
Location: Piedmont, SC,.United States
Contact:

#181 Post by Evil20071 »

Ok. Like I said, I wasn't too sure what the extents of Conky's capabilities are, so I just thought I'd ask and find out. Thanks. :D
[url=http://totalelectronics.us]TotalElectronics.us[/url]

User avatar
tasmod
Posts: 1460
Joined: Thu 04 Dec 2008, 13:53
Location: North Lincolnshire. UK
Contact:

#182 Post by tasmod »

Regarding my original problem with the fonts.

It may be worth mentioning this as I'm sure there are others who are not aware. The fonts as loaded names, i.e the file name. is not the name of the font required in the syntax for styles.

I downloaded some other 'digital' fonts. They were files called, say digitalb.ttf etc.

Now, when I needed to specify them I needed the correct "name" . Finally i realised that in the usr/share/fonts/default/TTF folder was a text list of the fonts as fonts.dir.

In the line of description was the correct "name" to use, this was just after the location. It takes a moment or two but it can be discerned.

I printed the list and now I can look them up to use in styles.

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

#183 Post by ttuuxxx »

tasmod wrote:Regarding my original problem with the fonts.

It may be worth mentioning this as I'm sure there are others who are not aware. The fonts as loaded names, i.e the file name. is not the name of the font required in the syntax for styles.

I downloaded some other 'digital' fonts. They were files called, say digitalb.ttf etc.

Now, when I needed to specify them I needed the correct "name" . Finally i realised that in the usr/share/fonts/default/TTF folder was a text list of the fonts as fonts.dir.

In the line of description was the correct "name" to use, this was just after the location. It takes a moment or two but it can be discerned.

I printed the list and now I can look them up to use in styles.
I did mention that a few pages back about the weather fonts. :)
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:

#184 Post by 01micko »

From time to time zigbert lets a small (tiny, as in maybe a word or character) piece of code slip. I think he is testing us. He is the 'teacher' {:wink: ( :lol: )} after all!
Puppy Linux Blog - contact me for access

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

Xonclock-appear problem

#185 Post by trio »

Micko & Zigbert!!!!!

Eureka!

I got the answer for xonclock-appear problem! This is in icewm, for jwm I think there should be a similar answer:

1. in xonclockrc:
no-winredirect = true

2. put in icewm/winoption:

#xonclock
xonclock.layer: normal
xonclock.allWorkspaces: 1
xonclock.dBorder: 0
xonclock.dTitleBar: 0
xonclock.ignoreTaskBar: 1
xonclock.dMaximize: 0
xonclock.dMinimize: 0
xonclock.dRollup: 0
xonclock.dResize: 0
xonclock.dClose: 0
xonclock.geometry: =140x140+869+5

:D

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

#186 Post by 01micko »

trio

There is a problem with geometry. It is no good in the 'winoptions', it must be in the 'func' executable. I'll do some work and see if I can get it to work.


Sigmund, could this be something similar to the slideshow position? methinks so!

Mick
Puppy Linux Blog - contact me for access

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

#187 Post by trio »

Micko:

No, geometry works, when you change the value, you must restart icewm to get it to work.....

But, somebody have to polish my solution, that is to put automatic geometry value that is related directly to pwidget.......I don't know how....

I know what you mean, pwidgets can create geometry value in the pwidget-exec file, I don't know if it can change the value in icewm winoptions....I already tried to put geometry command in pwidget-exec file, but when you put no-winredirect = true, then the xonclock window is not controlled whatsoever by itself, but by the window manager only...I tried....

but the clock shows up properly doesn't it?

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

#188 Post by 01micko »

Trio
The clock does show up, no clicking, no banging, no xevent! However, we need to find a solution to different screensizes and resolutions, not easy, especially if designing for different WMs. We solved the slideshow problem and I'm sure we can solve this.
For the moment, zigbert has asked us to hone the xevent workaround (NOT a solution, but at least it works in all WMs).
Your work is great, do not give up. The ultimate goal is to dump xevent. Believe me, I've tried many ways, even other clocks, but xonclock is the best looking and most configurable, especially for it's size, however it is unsupported. I think you could be on the right track.
Good luck!

Cheers,

Mick
Puppy Linux Blog - contact me for access

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

xevent workaround

#189 Post by trio »

@01micko:

As you know I have zero knowledge of scripting, so please modify as you like to make it work. The logic is to click on the minddle of the xonclock surface (which I assume is the safest place to click that will not open anything).


#!/bin/bash
#xevent_pwidgets
#Trio Tjandradjaja


X_PIXELS=`xrandr -q | grep '*' | egrep "[0-9]+[ ]*x[ ]*[0-9]+" -o | cut -d "x" -f 1`

CLOCK_H_OFFSET=`cat ~/.pwidgets/pwidgets-exec | grep "--offset-h=" | cut -d "=" -f 3`
CLOCK_Y_OFFSET=`cat ~/.pwidgets/pwidgets-exec | grep "--offset-v=" | cut -d "=" -f 3`


#read config
. $HOME/.pwidgets/pwidgetsrc
if [ "$WIDGETS_POSITION" = "left" ]; then
CLOCK_X_CENTER="`[$CLOCK_H_OFFSET+70]`"
else
CLOCK_X_CENTER="`[$X_PIXELS+$CLOCK_H_OFFSET-70]`"
fi

CLOCK_Y_CENTER="`[$CLOCK_Y_OFFSET+70]`"

#the actual xevent
xevent -a "$CLOCK_X_CENTER" "$CLOCK_Y_CENTER"
sleep 0.2 ; xevent -b 1 2 #simulated left mouse click
sleep 0.1 ; xevent -a 500 385

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

#190 Post by 01micko »

I think this is the correct action trio. Clicking on the clock is certainly the safest way with different configurations. I'm sure zigbert will agree. However I couldn't get it to work, I will try some more. Did you get it to work?
Puppy Linux Blog - contact me for access

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

#191 Post by trio »

unfortunately somebody has to modify this script to work. I cannot make it work, just try to make it with zero knowledge of coding....only the logic applies...... :(

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

#192 Post by trio »

more logical, but still cannot make it to work

#!/bin/bash
#xevent_pwidgets
#Trio Tjandradjaja


X_PIXELS=`xrandr -q | grep '*' | egrep "[0-9]+[ ]*x[ ]*[0-9]+" -o | cut -d "x" -f 1`

CLOCK_H_OFFSET=`cat ~/.pwidgets/pwidgets-exec | grep "*" | egrep "--offset-h*=[ ]*" -o | cut -d "=" -f 1`
CLOCK_Y_OFFSET=`cat ~/.pwidgets/pwidgets-exec | grep "*" | egrep "--offset-v*=[ ]*" -o | cut -d "=" -f 1`


#read config
WIDGETS_POSITION=`cat ~/.pwidgets/pwidgetsrc | grep "*" | egrep "WIDGETS_POSITION*=[ ]*" -o | cut -d "=" -f 1`

if [ "$WIDGETS_POSITION"= "left" ]; then
CLOCK_X_CENTER="`[$CLOCK_H_OFFSET+70]`"
else
CLOCK_X_CENTER="`[$X_PIXELS+$CLOCK_H_OFFSET-70]`"
fi

CLOCK_Y_CENTER=`[$CLOCK_Y_OFFSET+70]`

#the actual xevent
xevent -a "$CLOCK_X_CENTER" "$CLOCK_Y_CENTER"
sleep 0.2 ; xevent -b 1 2 #simulated left mouse click
sleep 0.1 ; xevent -a 500 385
killall xevent

Somebody help, please

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

#193 Post by 01micko »

trio
I am in the same boat! I have no clue! I've said it before...... SOS! :lol: (it's the only code I know!)
Puppy Linux Blog - contact me for access

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

#194 Post by trio »

I almost got it:

#!/bin/bash
#xevent_pwidgets
#Trio Tjandradjaja

X_PIXELS=`xrandr -q | grep '*' | egrep "[0-9]+[ ]*x[ ]*[0-9]+" -o | cut -d "x" -f 1`

CLOCK_H_OFFSET=`grep offset-h= ~/.pwidgets/pwidgets-exec | sed 's/^.*offset-h= //' | awk '{print $4}' | cut -d "=" -f 2 `

CLOCK_Y_OFFSET=`grep offset-v= ~/.pwidgets/pwidgets-exec | sed 's/^.*offset-v= //' | awk '{print $3}' | cut -d "=" -f 2 `

WIDGETS_POSITION=`grep position= ~/.pwidgets/pwidgets-exec | sed 's/^.*position= //' | awk '{print $2}' | cut -d "=" -f 2`

if [ "$WIDGETS_POSITION"= "TOP-LEFT" ]; then
CLOCK_X_CENTER="`[$CLOCK_H_OFFSET+70]`"
else
CLOCK_X_CENTER=[$X_PIXELS+$CLOCK_H_OFFSET-70]
fi

CLOCK_Y_CENTER=[$CLOCK_Y_OFFSET+70]

#the actual xevent
xevent -a $CLOCK_X_CENTER $CLOCK_Y_CENTER
sleep 0.2 ; xevent -b 1 2 #simulated left mouse click
sleep 0.1 ; xevent -a 500 385

All (before the "if") prints right, but don't know how to put it in the xevent

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

#195 Post by zigbert »

Thank you for fixing this issue. I will take a look when I come back after my 2 weeks off.

Enjoy coding! :D
Sigmund

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

#196 Post by trio »

Thank you......teacher :wink:

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

GOT IT

#197 Post by trio »

Micko & Zigbert:

I attached the exec file that will click only on the clock surface (whereever it is on the screen)!

#!/bin/sh
#Trio Tjandradjaja

X_PIXELS=`xrandr -q | grep '*' | egrep "[0-9]+[ ]*x[ ]*[0-9]+" -o | cut -d "x" -f 1`

CLOCK_H_OFFSET=`grep offset-h= ~/.pwidgets/pwidgets-exec | sed 's/^.*offset-h= //' | awk '{print $4}' | cut -d "=" -f 2 `

CLOCK_Y_OFFSET=`grep offset-v= ~/.pwidgets/pwidgets-exec | sed 's/^.*offset-v= //' | awk '{print $3}' | cut -d "=" -f 2 `

WIDGETS_POSITION=`grep position= ~/.pwidgets/pwidgets-exec | sed 's/^.*position= //' | awk '{print $2}' | cut -d "=" -f 2`

if [ "$WIDGETS_POSITION" = "TOP-RIGHT" ] ; then
CLOCK_X_CENTER=$[$X_PIXELS+$CLOCK_H_OFFSET-65]
else
CLOCK_X_CENTER=$[$CLOCK_H_OFFSET+65]
fi

CLOCK_Y_CENTER=$[$CLOCK_Y_OFFSET+65]

#echo "$CLOCK_X_CENTER"

#the actual xevent
sleep 0.1 ; xevent -a $CLOCK_X_CENTER $CLOCK_Y_CENTER
sleep 0.2 ; xevent -b 1 2 #simulated left mouse click
sleep 0.1 ; xevent -a 500 385

:D
Last edited by trio on Mon 19 Jan 2009, 10:10, edited 1 time in total.

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

#198 Post by 01micko »

Excellent trio!
Now all we have to do is automatically find screen centre for the mouseclick. HairyWill suggested Barry's code further back in the thread. I'm busy making a new font for Pwidgets at the moment but heres a tip. It will have to be a separate script for xevent and that can be called from your script. Your script will end up in 'fixwidgets'.

Cheers

Mick
Puppy Linux Blog - contact me for access

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

#199 Post by trio »

Now, that's easy... :D here you go Micko:

#!/bin/sh
#Trio Tjandradjaja

sleep 2

X_PIXELS=`xrandr -q | grep '*' | egrep "[0-9]+[ ]*x[ ]*[0-9]+" -o | cut -d "x" -f 1`

Y_PIXELS=`xrandr -q | grep '*' | egrep "[0-9]+[ ]*x[ ]*[0-9]+" -o | cut -d "x" -f 2`

CLOCK_H_OFFSET=`grep offset-h= ~/.pwidgets/pwidgets-exec | sed 's/^.*offset-h= //' | awk '{print $4}' | cut -d "=" -f 2 `

CLOCK_Y_OFFSET=`grep offset-v= ~/.pwidgets/pwidgets-exec | sed 's/^.*offset-v= //' | awk '{print $3}' | cut -d "=" -f 2 `

WIDGETS_POSITION=`grep position= ~/.pwidgets/pwidgets-exec | sed 's/^.*position= //' | awk '{print $2}' | cut -d "=" -f 2`

if [ "$WIDGETS_POSITION" = "TOP-LEFT" ] ; then

CLOCK_X_CENTER=$[$CLOCK_H_OFFSET+65]

else
CLOCK_X_CENTER=$[$X_PIXELS+$CLOCK_H_OFFSET-65]


fi

CLOCK_Y_CENTER=$[$CLOCK_Y_OFFSET+65]

SCREEN_X_CENTER=$[X_PIXELS/2]
SCREEN_Y_CENTER=$[Y_PIXELS/2]


#the actual xevent
sleep 0.1 ; xevent -a $CLOCK_X_CENTER $CLOCK_Y_CENTER
sleep 0.2 ; xevent -b 1 2 #simulated left mouse click
sleep 0.1 ; xevent -a $SCREEN_X_CENTER $SCREEN_Y_CENTER

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

#200 Post by 01micko »

Trio', <----- excellent!!!!

After some testing I'll pack up a new 'fixwidgets' file and send it to Warren, (Whodo) so he can include in the next puppy 4.2 alpha2. I might even make a .pet and upload here if it's ok with you, or you can make if you want. Do you know how? I'm sure Sigmund won't mind.

Mick
Puppy Linux Blog - contact me for access

Post Reply