Old laptop as Digital Clock [SOLVED][and SOLVED even more]
Old laptop as Digital Clock [SOLVED][and SOLVED even more]
G'day,
I'm looking to use an old lap top as a digital finishing clock at some night orienteering events where the runners coming in need to see if they can beat the clock. That is, the laptop screen displays the hours, minutes and seconds in maximum font.
Windows used to have a screen saver that sort of did this but a screen saver will disappear if the keyboard is hit - I think I want a wall-paper or fixed display.
Probably would like to be able to set the numeral colour and the back-ground as well for best readability.
Any Pets or ideas?
Additionally, sounding a beep at the .00 seconds (ie on the whole minute) would be handy.
Thanks,
David S.
I'm looking to use an old lap top as a digital finishing clock at some night orienteering events where the runners coming in need to see if they can beat the clock. That is, the laptop screen displays the hours, minutes and seconds in maximum font.
Windows used to have a screen saver that sort of did this but a screen saver will disappear if the keyboard is hit - I think I want a wall-paper or fixed display.
Probably would like to be able to set the numeral colour and the back-ground as well for best readability.
Any Pets or ideas?
Additionally, sounding a beep at the .00 seconds (ie on the whole minute) would be handy.
Thanks,
David S.
Last edited by davids45 on Sat 01 May 2010, 23:09, edited 2 times in total.
Hi David
Try running this in a terminal
it can be tweaked of course
Cheers
Try running this in a terminal
Code: Select all
yaf-splash -font "-misc-dejavu sans-bold-r-normal--240-0-0-0-p-0-iso10646-1" -bg black -fg white -outline 0 -clock
it can be tweaked of course
Cheers
Puppy Linux Blog - contact me for access
- abushcrafter
- Posts: 1418
- Joined: Fri 30 Oct 2009, 16:57
- Location: England
- Contact:
G'day 01micko,
Yes, that's pretty much exactly what I wanted in terms of a maximal screen-filling display including seconds. I've made a small executable file of your script.
I just need to set up a Puppy on a usb thumb drive which auto-runs the clock and doesn't hide or stop it when a screen-saver kicks in - DPup looks good for this so far on the old lap-top.
Thanks again,
David S.
Yes, that's pretty much exactly what I wanted in terms of a maximal screen-filling display including seconds. I've made a small executable file of your script.
I just need to set up a Puppy on a usb thumb drive which auto-runs the clock and doesn't hide or stop it when a screen-saver kicks in - DPup looks good for this so far on the old lap-top.
Thanks again,
David S.
Would you like a config gui with that? Perhaps sound choice, colour choice?
Oh yeah, clicking anywhere will stop the big yaf-splash as you probably discovered, but the the script won't finish without the killswitch.
EDIT:tweaking the values for a normal screen, I have a widey , on a standard screen the background will not cover the screen, so you can remove icons, hide the JWM taskbar and use a solid colour wallpaper the same colour as the yaf-splash background
Code: Select all
#!/bin/sh -a
rm -f /tmp/killclock
SCREEN=`xwininfo -root | grep ' \-geometry ' | tr -s ' ' | cut -f 3 -d ' ' | cut -f 1 -d '+' | tr 'x' ' '`
HEIGHT=`echo -n "$SCREEN" | cut -f 2 -d ' '`
WIDTH=`echo -n "$SCREEN" | cut -f 1 -d ' '`
RATIO=`dc $WIDTH $HEIGHT div 100 mul p | cut -f 1 -d '.'`
if [ $RATIO -gt 140 ]; then MF=3
else MF=60
fi
SIZE=`expr $HEIGHT / 4`
MARGINGET=`expr $HEIGHT \* 1`
MARGIN=`expr $MARGINGET / $MF`
function YAF (){
yaf-splash -font "-misc-dejavu sans-bold-r-normal--$SIZE-0-0-0-p-0-iso10646-1" -margin $MARGIN -bg $BG -fg $FG -outline 0 -clock
}
function BELL (){
#ZEROTIME=`date +%T|cut -d ':' -f3`
until [ -f /tmp/killclock ]
do
if [ "`date +%T|cut -d ':' -f3`" = "00" ];then aplay $NOISE ;fi
sleep 0.5
done
}
function KILLSWITCH (){
kill `ps|grep "clockgui"|awk '{print $1}'`
export killswitch='
<window decorated="false">
<vbox>
<hbox>
<button>
<label>KILLSWITCH</label>
<input file>/usr/share/doc/puppylogo96.png</input>
<action>echo "" > /tmp/killclock &</action>
<action>exit:Exit</action>
</button>
</hbox>
</vbox>
</window>'
gtkdialog3 -p killswitch
unset killswitch
}
clockgui="
<vbox>
<hbox>
<text><label>Enter a colour for background</label></text>
<entry>
<variable>BG</variable>
</entry>
</hbox>
<hbox>
<text><label>Enter a colour for foreground</label></text>
<entry>
<variable>FG</variable>
</entry>
</hbox>
<hbox>
<text><label>Enter the path to a sound</label></text>
<entry>
<variable>NOISE</variable>
</entry>
</hbox>
<hbox>
<button>
<label>Sound</label>
<input file stock=\"gtk-directory\"></input>
<action>exec rox /usr/share/audio &</action>
</button>
<button>
<label>Colour</label>
<input file stock=\"gtk-select-color\"></input>
<action>exec gcolor2 &</action>
</button>
<button>
<label>Go!</label>
<input file stock=\"gtk-yes\"></input>
<action>YAF &</action>
<action>BELL &</action>
<action>KILLSWITCH &</action>
</button>
</hbox>
</vbox>"
gtkdialog3 -p clockgui
unset clockgui
EDIT:tweaking the values for a normal screen, I have a widey , on a standard screen the background will not cover the screen, so you can remove icons, hide the JWM taskbar and use a solid colour wallpaper the same colour as the yaf-splash background
Puppy Linux Blog - contact me for access
G'day 01micko,
Thanks muchly for the extras, including the beeper.
The time itself sits only partly on-screen on my 19inch desktop display (it's off at the bottom right, showing the hour and some of the minutes). I'll try to change the variables to see how it works later (I've got to go to the Zoo this morning ("her indoors" has some free tickets)).
But the beeper works when I see the minute numeral change.
Can the config be saved? I thought I may have just been being fooled by the blank dialog box asking for colour and sound inputs when I re-started the clock, but I just got a blank screen <GO>-ing from the empty boxes.
David S.
Thanks muchly for the extras, including the beeper.
The time itself sits only partly on-screen on my 19inch desktop display (it's off at the bottom right, showing the hour and some of the minutes). I'll try to change the variables to see how it works later (I've got to go to the Zoo this morning ("her indoors" has some free tickets)).
But the beeper works when I see the minute numeral change.
Can the config be saved? I thought I may have just been being fooled by the blank dialog box asking for colour and sound inputs when I re-started the clock, but I just got a blank screen <GO>-ing from the empty boxes.
David S.
don't know if you saw the edit, but there are new variables as of about 20 minutes ago.
Cheers
a bit later, saves config
Ok, I tested this out at 800x600 and 1024x768 and it's good, but of course it can't fill the screen, so we don't even try hence the "fixed" variable for margin. Widescreen is perfect at 1360x768, the script detects widescreen.
Cheers
a bit later, saves config
Code: Select all
#!/bin/sh -a
rm -f /tmp/killclock
if [ -f $HOME/.bigclockrc ];then . $HOME/.bigclockrc
fi
SCREEN=`xwininfo -root | grep ' \-geometry ' | tr -s ' ' | cut -f 3 -d ' ' | cut -f 1 -d '+' | tr 'x' ' '`
HEIGHT=`echo -n "$SCREEN" | cut -f 2 -d ' '`
WIDTH=`echo -n "$SCREEN" | cut -f 1 -d ' '`
RATIO=`dc $WIDTH $HEIGHT div 100 mul p | cut -f 1 -d '.'`
SIZE=`expr $HEIGHT / 4`
if [ $RATIO -gt 140 ]; then
MARGINGET=`expr $HEIGHT \* 1`
MARGIN=`expr $MARGINGET / 3`
else MARGIN=20
fi
function YAF (){
echo BG="\"$BG\"" >$HOME/.bigclockrc
echo FG="\"$FG\"" >>$HOME/.bigclockrc
echo NOISE="\"$NOISE\"" >>$HOME/.bigclockrc
yaf-splash -font "-misc-dejavu sans-bold-r-normal--$SIZE-0-0-0-p-0-iso10646-1" -margin $MARGIN -bg $BG -fg $FG -outline 0 -clock
}
function BELL (){
#ZEROTIME=`date +%T|cut -d ':' -f3`
until [ -f /tmp/killclock ]
do
if [ "`date +%T|cut -d ':' -f3`" = "00" ];then aplay $NOISE ;fi
sleep 0.5
done
}
function KILLSWITCH (){
kill `ps|grep "clockgui"|awk '{print $1}'`
export killswitch='
<window decorated="false">
<vbox>
<hbox>
<button>
<label>KILLSWITCH</label>
<input file>/usr/share/doc/puppylogo96.png</input>
<action>echo "" > /tmp/killclock &</action>
<action>exit:Exit</action>
</button>
</hbox>
</vbox>
</window>'
gtkdialog3 -p killswitch
unset killswitch
}
clockgui="
<vbox>
<hbox>
<text><label>Enter a colour for background</label></text>
<entry>
<variable>BG</variable>
<input>echo \"$BG\"</input>
</entry>
</hbox>
<hbox>
<text><label>Enter a colour for foreground</label></text>
<entry>
<variable>FG</variable>
<input>echo \"$FG\"</input>
</entry>
</hbox>
<hbox>
<text><label>Enter the path to a sound</label></text>
<entry>
<variable>NOISE</variable>
<input>echo $NOISE</input>
</entry>
</hbox>
<hbox>
<button>
<label>Sound</label>
<input file stock=\"gtk-directory\"></input>
<action>exec rox /usr/share/audio &</action>
</button>
<button>
<label>Colour</label>
<input file stock=\"gtk-select-color\"></input>
<action>exec gcolor2 &</action>
</button>
<button>
<label>Go!</label>
<input file stock=\"gtk-yes\"></input>
<action>YAF &</action>
<action>BELL &</action>
<action>KILLSWITCH &</action>
</button>
</hbox>
</vbox>"
gtkdialog3 -p clockgui
unset clockgui
Puppy Linux Blog - contact me for access
Hi Mick
I hope you don't mind that I stole some nifty code from you. This one goes straight to fullscreen clock when executed. Colors are defined in command 'clock black red'. My thought was; wouldn't this be cool to add as a corner-activated app in DuDE. Drag the mouse-pointer to the tray-clock, and you get a fullscreen clock.
Do you know if it possible to move the numbers slightly (maybe every minute) for screensaver features?
Thank you!!!!
Sigmund
I hope you don't mind that I stole some nifty code from you. This one goes straight to fullscreen clock when executed. Colors are defined in command 'clock black red'. My thought was; wouldn't this be cool to add as a corner-activated app in DuDE. Drag the mouse-pointer to the tray-clock, and you get a fullscreen clock.
Do you know if it possible to move the numbers slightly (maybe every minute) for screensaver features?
Thank you!!!!
Sigmund
Code: Select all
#!/bin/sh -a
BG=$1; [ ! "$BG" ] && BG=black
FG=$2; [ ! "$FG" ] && FG=gray20
HEIGHT=`xwininfo -root | grep ' \-geometry ' | tr -s ' ' | cut -f 3 -d ' ' | cut -f 1 -d '+' | tr 'x' ' ' | cut -f 2 -d ' '`
WIDTH=`xwininfo -root | grep ' \-geometry ' | tr -s ' ' | cut -f 3 -d ' ' | cut -f 1 -d '+' | tr 'x' ' ' | cut -f 1 -d ' '`
RATIO=`dc $WIDTH $HEIGHT div 100 mul p | cut -f 1 -d '.'`
SIZE=`expr $HEIGHT / 4`
if [ $RATIO -gt 140 ]; then
MARGINGET=`expr $HEIGHT \* 1`
MARGIN=`expr $MARGINGET / 3`
else
MARGIN=20
fi
yaf-splash -font "-misc-dejavu sans-bold-r-normal--$SIZE-0-0-0-p-0-iso10646-1" -margin $MARGIN -bg $BG -fg $FG -outline 0 -clock
Hi Sigmund
Well you can certainly position yaf-splash anywhere you like on the screen. I suppose a 1 minute loop could be made with set or random values. I guess the trick is to actually keep it on screen, which would be easier done by increasing the SIZE divisor making the clock display a little smaller and giving more placement options for a screensaver.
Oh yeah, the code for detecting widescreen is Barry's,(from the widescreen wallpaper cropper) I just manipulated it to suit the need here.
Run with it mate!
Cheers
Well you can certainly position yaf-splash anywhere you like on the screen. I suppose a 1 minute loop could be made with set or random values. I guess the trick is to actually keep it on screen, which would be easier done by increasing the SIZE divisor making the clock display a little smaller and giving more placement options for a screensaver.
Oh yeah, the code for detecting widescreen is Barry's,(from the widescreen wallpaper cropper) I just manipulated it to suit the need here.
Run with it mate!
Cheers
Puppy Linux Blog - contact me for access
Here is a simplified code, using -geometry instead of -margin to center the clock correct.
Code: Select all
#!/bin/sh
BG=$1; [ ! "$BG" ] && BG=black
FG=$2; [ ! "$FG" ] && FG=gray20
HEIGHT=`xwininfo -root | grep -m 1 '\geometry' | cut -f4 -d ' ' | cut -f2 -d 'x' | cut -f1 -d '+'`
WIDTH=`xwininfo -root | grep -m 1 '\geometry' | cut -f4 -d ' ' | cut -f1 -d 'x'`
SIZE=$((HEIGHT/44*10))
yaf-splash -font "-misc-dejavu sans-bold-r-normal--$SIZE-0-0-0-p-0-iso10646-1" -bg $BG -fg $FG -outline 0 -clock -24 -geometry ${WIDTH}x${HEIGHT}
- abushcrafter
- Posts: 1418
- Joined: Fri 30 Oct 2009, 16:57
- Location: England
- Contact:
Combined zigbert's and 01micko's code. So now we have a proper full screen clock which plays a sound ever minute and with the colour options all of which are saved into a configuration file. I also got rid of the kill sound button so when you click on the yaf-splash clock to close it kills the sound with it.
Code: Select all
#!/bin/sh -a
rm -f /tmp/killclock
if [ -f $HOME/.bigclockrc ];then . $HOME/.bigclockrc
fi
HEIGHT=`xwininfo -root | grep -m 1 '\geometry' | cut -f4 -d ' ' | cut -f2 -d 'x' | cut -f1 -d '+'`
WIDTH=`xwininfo -root | grep -m 1 '\geometry' | cut -f4 -d ' ' | cut -f1 -d 'x'`
SIZE=$((HEIGHT/44*10))
function YAF (){
echo BG="\"$BG\"" >$HOME/.bigclockrc
echo FG="\"$FG\"" >>$HOME/.bigclockrc
echo NOISE="\"$NOISE\"" >>$HOME/.bigclockrc
yaf-splash -font "-misc-dejavu sans-bold-r-normal--$SIZE-0-0-0-p-0-iso10646-1" -geometry ${WIDTH}x${HEIGHT} -bg $BG -fg $FG -outline 0 -clock
echo "" > /tmp/killclock &
}
function BELL (){
#ZEROTIME=`date +%T|cut -d ':' -f3`
until [ -f /tmp/killclock ]
do
if [ "`date +%T|cut -d ':' -f3`" = "00" ];then aplay $NOISE ;fi
sleep 0.5
done
rm -v -f /tmp/killclock
echo ""
echo "Finished. Will Now Exit."
exit
}
function KILLCLOCKGUI (){
kill `ps|grep "clockgui"|awk '{print $1}'`
}
clockgui="
<vbox>
<hbox>
<text><label>Enter a colour for background</label></text>
<entry>
<variable>BG</variable>
<input>echo \"$BG\"</input>
</entry>
</hbox>
<hbox>
<text><label>Enter a colour for foreground</label></text>
<entry>
<variable>FG</variable>
<input>echo \"$FG\"</input>
</entry>
</hbox>
<hbox>
<text><label>Enter the path to a sound</label></text>
<entry>
<variable>NOISE</variable>
<input>echo $NOISE</input>
</entry>
</hbox>
<hbox>
<button>
<label>Sound</label>
<input file stock=\"gtk-directory\"></input>
<action>exec rox /usr/share/audio &</action>
</button>
<button>
<label>Colour</label>
<input file stock=\"gtk-select-color\"></input>
<action>exec gcolor2 &</action>
</button>
<button>
<label>Go!</label>
<input file stock=\"gtk-yes\"></input>
<action>YAF &</action>
<action>BELL &</action>
<action>KILLCLOCKGUI &</action>
</button>
</hbox>
</vbox>"
gtkdialog3 -p clockgui
unset clockgui
[url=http://www.adobe.com/flashplatform/]adobe flash is rubbish![/url]
My Quote:"Humans are stupid, though some are clever but stupid." http://www.dependent.de/media/audio/mp3/System_Syn_Heres_to_You.zip http://www.systemsyn.com/
My Quote:"Humans are stupid, though some are clever but stupid." http://www.dependent.de/media/audio/mp3/System_Syn_Heres_to_You.zip http://www.systemsyn.com/
- Béèm
- Posts: 11763
- Joined: Wed 22 Nov 2006, 00:47
- Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win
Stumbled on this post and wanted to try.01micko wrote:don't know if you saw the edit, but there are new variables as of about 20 minutes ago.
Cheers
a bit later, saves config
Ok, I tested this out at 800x600 and 1024x768 and it's good, but of course it can't fill the screen, so we don't even try hence the "fixed" variable for margin. Widescreen is perfect at 1360x768, the script detects widescreen.Code: Select all
#!/bin/sh -a rm -f /tmp/killclock if [ -f $HOME/.bigclockrc ];then . $HOME/.bigclockrc fi SCREEN=`xwininfo -root | grep ' \-geometry ' | tr -s ' ' | cut -f 3 -d ' ' | cut -f 1 -d '+' | tr 'x' ' '` HEIGHT=`echo -n "$SCREEN" | cut -f 2 -d ' '` WIDTH=`echo -n "$SCREEN" | cut -f 1 -d ' '` RATIO=`dc $WIDTH $HEIGHT div 100 mul p | cut -f 1 -d '.'` SIZE=`expr $HEIGHT / 4` if [ $RATIO -gt 140 ]; then MARGINGET=`expr $HEIGHT \* 1` MARGIN=`expr $MARGINGET / 3` else MARGIN=20 fi function YAF (){ echo BG=""$BG"" >$HOME/.bigclockrc echo FG=""$FG"" >>$HOME/.bigclockrc echo NOISE=""$NOISE"" >>$HOME/.bigclockrc yaf-splash -font "-misc-dejavu sans-bold-r-normal--$SIZE-0-0-0-p-0-iso10646-1" -margin $MARGIN -bg $BG -fg $FG -outline 0 -clock } function BELL (){ #ZEROTIME=`date +%T|cut -d ':' -f3` until [ -f /tmp/killclock ] do if [ "`date +%T|cut -d ':' -f3`" = "00" ];then aplay $NOISE ;fi sleep 0.5 done } function KILLSWITCH (){ kill `ps|grep "clockgui"|awk '{print $1}'` export killswitch=' <window decorated="false"> <vbox> <hbox> <button> <label>KILLSWITCH</label> <input file>/usr/share/doc/puppylogo96.png</input> <action>echo "" > /tmp/killclock &</action> <action>exit:Exit</action> </button> </hbox> </vbox> </window>' gtkdialog3 -p killswitch unset killswitch } clockgui=" <vbox> <hbox> <text><label>Enter a colour for background</label></text> <entry> <variable>BG</variable> <input>echo "$BG"</input> </entry> </hbox> <hbox> <text><label>Enter a colour for foreground</label></text> <entry> <variable>FG</variable> <input>echo "$FG"</input> </entry> </hbox> <hbox> <text><label>Enter the path to a sound</label></text> <entry> <variable>NOISE</variable> <input>echo $NOISE</input> </entry> </hbox> <hbox> <button> <label>Sound</label> <input file stock="gtk-directory"></input> <action>exec rox /usr/share/audio &</action> </button> <button> <label>Colour</label> <input file stock="gtk-select-color"></input> <action>exec gcolor2 &</action> </button> <button> <label>Go!</label> <input file stock="gtk-yes"></input> <action>YAF &</action> <action>BELL &</action> <action>KILLSWITCH &</action> </button> </hbox> </vbox>" gtkdialog3 -p clockgui unset clockgui
I get in the terminal
Code: Select all
# ./full-screen-clock
** ERROR **: GtkDialog: Could not find the dialog description in the environment variable 'clockgui'.
aborting...
./full-screen-clock: line 101: 11728 Aborted gtkdialog3 -p clockgui
#
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]
I copy and pasted the code to geany, saved it as /root/bin/EXPERICLOCK, chmod 755 /root/bin/EXPERICLOCK, typed `EXPERICLOCK` at console and it opened up fine. Two icons were missing - that`s all. I haven`t tested it deeper, but rox showed up and `gcolor2`. I didn`t give it a 'go'. The code is as usual somehow not understandable but bash seem to interpret the code right. (Macpup F3 4.3.0/1)
Maybe Lucy has got different version of `gtkdialogNR`
Maybe Lucy has got different version of `gtkdialogNR`
Béèm
Did you be sure to add -a option to the shebang?
Anyway, there's a new one because in late model woof builds Barry has replaced yaf-splash with gtk-dialog splash, however the yaf-splash binary still exists so we call it with it's full path.
See first variable in the updated script. I also changed the yaf-splash options with zigbert's DuDE improvements, now you get it full screen on any screen.
Hey davids45... see what you started
Copy paste this to text editor, name it something and make executable
Have fun!
Cheers
Did you be sure to add -a option to the shebang?
Code: Select all
#!/bin/sh -a
See first variable in the updated script. I also changed the yaf-splash options with zigbert's DuDE improvements, now you get it full screen on any screen.
Hey davids45... see what you started
Copy paste this to text editor, name it something and make executable
Code: Select all
#!/bin/sh -a
YAFSPLASH="/usr/X11R7/bin/yaf-splash"
rm -f /tmp/killclock
if [ -f $HOME/.bigclockrc ];then . $HOME/.bigclockrc
fi
HEIGHT=`xwininfo -root | grep -m 1 '\geometry' | cut -f4 -d ' ' | cut -f2 -d 'x' | cut -f1 -d '+'`
WIDTH=`xwininfo -root | grep -m 1 '\geometry' | cut -f4 -d ' ' | cut -f1 -d 'x'`
SIZE=$((HEIGHT/5))
SIZE=`expr $HEIGHT / 4`
if [ $RATIO -gt 140 ]; then
MARGINGET=`expr $HEIGHT \* 1`
MARGIN=`expr $MARGINGET / 3`
else MARGIN=20
fi
function YAF (){
echo BG="\"$BG\"" >$HOME/.bigclockrc
echo FG="\"$FG\"" >>$HOME/.bigclockrc
echo NOISE="\"$NOISE\"" >>$HOME/.bigclockrc
$YAFSPLASH -font "-misc-dejavu sans-bold-r-normal--$SIZE-0-0-0-p-0-iso10646-1" -bg $BG -fg $FG -outline 0 -clock -geometry $((WIDTH+PLACEMENT_X))x$((HEIGHT+PLACEMENT_Y))+0+0
#$YAFSPLASH -font "-misc-dejavu sans-bold-r-normal--$SIZE-0-0-0-p-0-iso10646-1" -margin $MARGIN -bg $BG -fg $FG -outline 0 -clock
}
function BELL (){
#ZEROTIME=`date +%T|cut -d ':' -f3`
until [ -f /tmp/killclock ]
do
if [ "`date +%T|cut -d ':' -f3`" = "00" ];then aplay $NOISE ;fi
sleep 0.5
done
}
function KILLSWITCH (){
kill `ps|grep "clockgui"|awk '{print $1}'`
export killswitch='
<window decorated="false">
<vbox>
<hbox>
<button>
<label>KILLSWITCH</label>
<input file>/usr/share/doc/puppylogo96.png</input>
<action>echo "" > /tmp/killclock &</action>
<action>exit:Exit</action>
</button>
</hbox>
</vbox>
</window>'
gtkdialog3 -p killswitch
unset killswitch
}
clockgui="
<vbox>
<hbox>
<text><label>Enter a colour for background</label></text>
<entry>
<variable>BG</variable>
<input>echo \"$BG\"</input>
</entry>
</hbox>
<hbox>
<text><label>Enter a colour for foreground</label></text>
<entry>
<variable>FG</variable>
<input>echo \"$FG\"</input>
</entry>
</hbox>
<hbox>
<text><label>Enter the path to a sound</label></text>
<entry>
<variable>NOISE</variable>
<input>echo $NOISE</input>
</entry>
</hbox>
<hbox>
<button>
<label>Sound</label>
<input file stock=\"gtk-directory\"></input>
<action>exec rox /usr/share/audio &</action>
</button>
<button>
<label>Colour</label>
<input file stock=\"gtk-select-color\"></input>
<action>exec gcolor2 &</action>
</button>
<button>
<label>Go!</label>
<input file stock=\"gtk-yes\"></input>
<action>YAF &</action>
<action>BELL &</action>
<action>KILLSWITCH &</action>
</button>
</hbox>
</vbox>"
gtkdialog3 -p clockgui
unset clockgui
Cheers
Puppy Linux Blog - contact me for access
G'day 01micko,
.
I'm hoping to give the 'el cheapo' a try this Wednesday at some night orienteering in Chatswood (Lowanna Park, 7-8pm). A discount will be offered for any Puppy Linux users, and free use of our First Aid kit .
And thanks for everyone's interest and input.
David S.
Well, I did want this for an 'el cheapo' start clock - a fully blown beeping+LED start clock (Norwegian - G'day zigbert) is costing my orienteering club over AU$3000 by the time we get it through our customs.Hey davids45... see what you started
.
I'm hoping to give the 'el cheapo' a try this Wednesday at some night orienteering in Chatswood (Lowanna Park, 7-8pm). A discount will be offered for any Puppy Linux users, and free use of our First Aid kit .
And thanks for everyone's interest and input.
David S.
bit far for me mate, but maybe cthisbear or jamesbond can make it.I'm hoping to give the 'el cheapo' a try this Wednesday at some night orienteering in Chatswood (Lowanna Park, 7-8pm). A discount will be offered for any Puppy Linux users, and free use of our First Aid kit
Cheers
Puppy Linux Blog - contact me for access
Sounds like a reasonable price......after all it's not more than we have to pay for 1 kg marinated kangaroo meatdavids45 wrote:a fully blown beeping+LED start clock (Norwegian - G'day zigbert) is costing my orienteering club over AU$3000 by the time we get it through our customs.
I would really like to come.......davids45 wrote:I'm hoping to give the 'el cheapo' a try this Wednesday at some night orienteering in Chatswood (Lowanna Park, 7-8pm). A discount will be offered for any Puppy Linux users, and free use of our First Aid kit .
I have Germany on my agenda this year. - But Australia.......sounds like a dream to me.
Sigmund
- Béèm
- Posts: 11763
- Joined: Wed 22 Nov 2006, 00:47
- Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win
Well I took the script where you told davids45 'there has been an update 20 minutes ago' and there was no -a in it.01micko wrote:Béèm
Did you be sure to add -a option to the shebang?
Have fun!
Cheers
I now took your latest and it's working.
Now I think the next question from people would be to start this clock when the screen locks.
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]
-
- Posts: 76
- Joined: Fri 23 Jan 2009, 14:59
- Location: California
The bell function did not work on my PC. Here is a replacement that does work but is less than ideal. I was going to make it phase lock the delay timing to get exactly onto the minutes roll over but I had an attack of the lazies.01micko wrote:Would you like a config gui with that? Perhaps sound choice, colour choice?
It dings on the minute roll over plus just a smidge. It also doesn't loop every 0.5 seconds while waiting. It does some math to work out the delay that is needed then does that delay.
Code: Select all
function BELL (){
PREVDING="`date +%M`"
until [ -f /tmp/killclock ] ; do
THISDING="`date +%M`"
THISTICK="`date +%S`"
THISTICK=`expr 60 - $THISTICK`
if [ "$THISDING" != "$PREVDING" ] ; then
aplay $NOISE
PREVDING="$THISDING"
fi
sleep ${THISTICK}.3
done
}