Subject: Re: FVWM: FvwmButtons: swallowed clock applet with xft capabilities?

From: Ruslan Kosolapov <[email-masked]>
Date: Sun, 01 Feb 2004 12:42:36 +0600

AF> Hello to everyone.
 AF> I wonder if there is any clock applet available to use it with
 AF> FvwmButtons. It should be capable of xft as fvwm 2.5.8 does.

  I use FvwmScript for it (you can see screenshot on
  http://www.grundik.gribok.net/?theme=myclock.php, in Russian only,
  sorry):

---8<---------------------------------------------------------
WindowTitle {FvwmDate}
WindowSize 270 20
WindowPosition -0 0
Font		"Shadow=1:xft:Verdana:bold:pixelsize=16:minspace=true"

Init
 Begin
  Set $NHour=(GetOutput {date '+%d.%m.%Y %H:%M'} 1 2)
  ChangeTitle 1 $NHour
  Set $AHour=(GetOutput {date '+%A, %d %B/%m'} 1 -1)
  ChangeTitle 3 $AHour
 End

PeriodicTasks
 Begin
  If (RemainderOfDiv (GetTime) 60)==0 Then
   Begin
	Set $NHour=(GetOutput {date '+%d.%m.%Y %H:%M'} 1 2)
	ChangeTitle 1 $NHour
    Set $AHour=(GetOutput {date '+%A, %d %B/%m'} 1 -1)
    ChangeTitle 3 $AHour
   End
 End 

Widget 1
Property
 Size 100 18
 Position 170 -5
 Colorset 17
 Font		"Shadow=1:xft:Verdana:bold:pixelsize=20:minspace=true"
 Flags Right
 Type ItemDraw
 Title {OK}
Main
 Case message of
  SingleClic :
  Begin
   Do {Exec sudo ntpdate ntp0.zenon.net}
  End
End

Widget 3
Property
 Size 180 18
 Position 20 0
 Colorset 17
 Font		"Shadow=1:xft:Verdana:pixelsize=11:minspace=true"
 Flags Right
 Type ItemDraw
 Title {OK}
Main
 Case message of
  SingleClic :
  Begin
   Do {Next (*Calendar*) focus}
  End
End
----8<----------------------------------------------------

  Some time ago I use shell-script and FvwmButtons:

---8<-----------------------------------------------------
*FvwmButtons: (Id clock, Title "clock", \
font xft:"Verdana":pixelsize=19:bold:minspace=true)
*FvwmButtons: (Id date, Title "date", \
font xft:"Verdana":pixelsize=19:bold:minspace=true)
----------------------------------------------------->8---
---8<-----------------------------------------------------
#!/bin/bash

while true; do
  TIME=`date +'%R'`
  DATE=`date +'%a, %d %b/%m'`
  if [ "x$OLD_TIME" != "x$TIME" ]; then
	OLD_TIME=$TIME
    FvwmCommand "SendToModule FvwmButtons ChangeButton clock Title \"$TIME\""
  fi
  if [ "x$OLD_DATE" != "x$DATE" ]; then
	OLD_DATE=$DATE
    FvwmCommand "SendToModule FvwmButtons ChangeButton date Title \" $DATE\""
  fi
  sleep 60
done
----------------------------------------------------->8---

 AF> Xft works fine with my configuration, but so far the clock (I use
 AF> a swallowed xclock) does get displayed the old style.  Of course
 AF> it should be a digital clock, much same way as one could see in
 AF> MS Windows taskbars.  Any hints?

  You can use two ways described above (FvwmScript or any script and
  FvwmCommand), instead of swallowing applications into FvwmButtons.

PS: sorry for bad English.

-- 
=[ только сядешь поработать обязательно кто-нибудь разбудит... 
=[ 							  -- Sokrat, 2003
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: [email-masked] (Alexander Fitterling)
Date: Sun, 1 Feb 2004 07:55:54 +0100

>   http://www.grundik.gribok.net/?theme=myclock.php, in Russian only,

Hey, this is cool! I'll check if I have suficient free time. In
meanwhile could you send me a snapshot, i'd like to know what it looks
like?

CU

---

From: Alex Fitterling <[email-masked]>
Date: Sun, 1 Feb 2004 17:22:21 +0100

Am Sonntag, 1. Februar 2004 07:55 schrieb Alexander Fitterling:

Excuse me. I was answering too quick. Of course I've seen the screenshot. This 
is looking nice. I was trying to use it as swallowed applet like this:

*FvwmButtons-Panel: (35x1, Swallow "FvwmClock" `FvwmScript $[HOME]/.fvwm/bin/F
\vwmScript-Date`, ActionOnPress, Action `Exec exec tkremind`)

I already changed size, after restarting fvwm the Panel growth the size the 
applet should be, but the applet is showing up somewhere different. Could 
this be handled by a geometry setting? Or must any parameter given be 
relative to the swallowed Panel-applet?

Thanks, this applet is pretty nice!
Alex