ofclock - patched

Window managers, icon programs, widgets, etc.
Post Reply
Message
Author
goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

ofclock - patched

#1 Post by goingnuts »

ofclock - patched to:
* work with swallow in jwm
* spawn user command with left mouse click
* shift between clock & date by mouse wheel
* mid mouse click toggle seconds on/off
* right mouse click toggle 12/24h
* added user selected background color
* added user selected digits color

Attached patch used & pet package with static linked bin.

Code: Select all

Usage: ofclock [option]

  -1, --12                   Display 12 hour time.
  -2, --24                   Display 24 hour time.
  -n, --nosecond             Don't display 'second'.
  -p, --position x,y         Position to display clock.
  -d, --display displayname  The X server to contact.
  -t, --title name           The name of the window.
  -b, --background color     The background color. Defaults "black"
  -f, --foreground color     The foreground color. Defaults "yellow"
  -e, --exec command         Mouse click command to run. Defaults "xcal"
  -s, --shift +/- hour       shift to another timezone.
  -h, --help                 Display this help.
Attachments
ofclock_patched.png
(4.46 KiB) Downloaded 330 times
ofclock-1.0.pet
(55.87 KiB) Downloaded 255 times
ofclock-1.0_various.diff.gz
(8.55 KiB) Downloaded 257 times

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#2 Post by musher0 »

Hello, goingnuts.

ofclock is a digital clock only, right?

When the doc says it can launch "xcal" by default, do they mean "xcalc" or
"cal"? I don't have "xcal" on my Puppy.

Regards.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#3 Post by goingnuts »

I hard coded it as xcal (short for x-calendar). If you do not have xcal you could symlink whatever program you want ofclock to start on click to xcal (ln -s osmo xcal). But you could just call ofclock with "-e osmo" to get same result.
For me xcal is a script:

Code: Select all

#!/bin/sh

case $1 in nm) m=$(date +%m | sed -e 's/0//g')
               y=$(date +%Y) 
               let m=m+1
               [ $m = 13 ] && m=1 && let y=y+1
               export m=$m 
               export y=$y
               rxvt -g 21x8 +sb -T "" -bg SteelBlue -cr SteelBlue -fg white -e sh -c 'cal $m $y|grep [S123];read r'
               ;;
            y) rxvt -g 66x38 +sb -T "" -bg SteelBlue -cr SteelBlue -fg white -e sh -c 'cal -y;read r'
               ;; 
           ny) y=$(date +%Y)
               let y=y+1
               export y=$y
               rxvt -g 66x38 +sb -T "" -bg SteelBlue -cr SteelBlue -fg white -e sh -c 'cal -y $y;read r'
               ;;
            *) rxvt -g 21x8 +sb -T "" -bg SteelBlue -cr SteelBlue -fg white -e sh -c 'cal|grep [S123]|sed "2,9s/`date +%e`$/`setterm -reverse``date +%e``setterm -default`/"|sed "2,9s/`date +%e` /`setterm -reverse``date +%e``setterm -default` /";read r'
esac
And it looks like below called without additional flags:
Attachments
xcal.png
(2.24 KiB) Downloaded 229 times

Post Reply