Page 10 of 162

Posted: Tue 06 Jan 2009, 19:43
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

Posted: Tue 06 Jan 2009, 21:04
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.

Posted: Tue 06 Jan 2009, 21:13
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

Posted: Wed 07 Jan 2009, 08:22
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!

Xonclock-appear problem

Posted: Sun 11 Jan 2009, 12:14
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

Posted: Sun 11 Jan 2009, 13:21
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

Posted: Sun 11 Jan 2009, 14:39
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?

Posted: Mon 12 Jan 2009, 06:35
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

xevent workaround

Posted: Fri 16 Jan 2009, 05:38
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

Posted: Fri 16 Jan 2009, 05:46
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?

Posted: Fri 16 Jan 2009, 06:54
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...... :(

Posted: Fri 16 Jan 2009, 08:48
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

Posted: Fri 16 Jan 2009, 08:55
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!)

Posted: Sat 17 Jan 2009, 03:13
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

Posted: Sat 17 Jan 2009, 04:48
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

Posted: Sat 17 Jan 2009, 06:15
by trio
Thank you......teacher :wink:

GOT IT

Posted: Mon 19 Jan 2009, 09:26
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

Posted: Mon 19 Jan 2009, 09:58
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

Posted: Mon 19 Jan 2009, 10:25
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

Posted: Mon 19 Jan 2009, 10:58
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