Created
September 3, 2010 15:42
-
-
Save jonyesno/564065 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This restores the countdown timer feature (a.k.a. beer o'clock) to Erco's rather fabulous nixieclock | |
# <http://seriss.com/people/erco/unixtools/nixieclock/> | |
# Seems my original patch has been partially reverted. | |
--- nixieclock.C.orig 2009-10-28 03:53:28.000000000 +0000 | |
+++ nixieclock.C 2010-09-03 16:37:43.000000000 +0100 | |
@@ -68,8 +68,7 @@ | |
" -t # test pattern for alphanumeric display\n" | |
" -n # no background mode (don't fork)\n" | |
" -geometry <pos> # sets geometry (x windows style positions)\n" | |
-// NOT YET | |
-// " -c <epochtime> # counts down to epochtime\n" | |
+ " -c <epochtime> # counts down to epochtime\n" | |
// NOT YET | |
// " -r cmd [args] # runs command, each line of output updates in clock\n" | |
@@ -106,6 +105,10 @@ | |
static char last_s[80] = ""; | |
time_t timt = time(NULL); | |
+ if (G_countdown) { | |
+ timt = G_countdown - timt; | |
+ } | |
+ | |
struct tm *tmbuf = localtime(&timt); | |
strftime(s, sizeof(s)-1, G_timestring, tmbuf); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment