pWidgets 2.5.8
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.
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.
- ttuuxxx
- Posts: 11171
- Joined: Sat 05 May 2007, 10:00
- Location: Ontario Canada,Sydney Australia
- Contact:
I did mention that a few pages back about the weather fonts.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.
ttuuxxx
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)
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' { ( )} after all!
Puppy Linux Blog - contact me for access
Xonclock-appear problem
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
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
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
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
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?
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?
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
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
xevent workaround
@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
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
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
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
#!/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
trio
I am in the same boat! I have no clue! I've said it before...... SOS! (it's the only code I know!)
I am in the same boat! I have no clue! I've said it before...... SOS! (it's the only code I know!)
Puppy Linux Blog - contact me for access
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
#!/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
GOT IT
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
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
Last edited by trio on Mon 19 Jan 2009, 10:10, edited 1 time in total.
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
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
Now, that's easy... 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
#!/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
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
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