summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--bin/fbclock.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/fbclock.c b/bin/fbclock.c
index d35369ca..cac3b272 100644
--- a/bin/fbclock.c
+++ b/bin/fbclock.c
@@ -45,11 +45,11 @@ struct Psf2Header {
 static const uint32_t BG = 0x1D2021;
 static const uint32_t FG = 0xA99A84;
 
-int main(int argc, char *argv[]) {
+int main() {
     size_t count;
 
-    const char *fontPath = "/usr/share/kbd/consolefonts/Lat2-Terminus16.psfu.gz";
-    if (argc > 1) fontPath = argv[1];
+    const char *fontPath = getenv("FONT");
+    if (!fontPath) fontPath = "/usr/share/kbd/consolefonts/Lat2-Terminus16.psfu.gz";
 
     gzFile font = gzopen(fontPath, "r");
     if (!font) err(EX_NOINPUT, "%s", fontPath);
@@ -93,6 +93,7 @@ int main(int argc, char *argv[]) {
 
         char str[64];
         size_t len = strftime(str, sizeof(str), "%H:%M", local);
+        assert(len);
 
         for (int i = 0; i < (60 - local->tm_sec); ++i) {
             uint32_t left = info.xres - header.glyphWidth * len;
roe 2020-10-27Switch gr alias back to git rebaseJune McEnroe 2020-10-27Allow cd host: to cd to same path over sshJune McEnroe 2020-10-27Use SendEnv for cd host:pathJune McEnroe 2020-10-27Allow cd host:path over sshJune McEnroe 2020-10-07Use mandoc -T utf8 for text.June McEnroe 2020-09-20Add The Awakened KingdomJune McEnroe 2020-09-12Move /opt/local back, cheat port select to use system manJune McEnroe 2020-09-12Move /opt/local behind /usr againJune McEnroe 2020-09-12Enable toc in cgit renderings of man pagesJune McEnroe 2020-09-11Install mandoc on macOSJune McEnroe 2020-09-11Rewrite install script yet againJune McEnroe 2020-09-11Remove NetBSD from install scriptJune McEnroe 2020-09-11Use MacPorts rather than pkgsrcJune McEnroe 2020-09-11Add debian VM name to sshJune McEnroe 2020-09-11Add influencer tweetJune McEnroe 2020-09-10Add The Kingdom of GodsJune McEnroe 2020-09-07Add SunglassesJune McEnroe 2020-09-06Add Between the BreathsJune McEnroe 2020-09-04Open /dev/tty in nudgeJune McEnroe 2020-09-04Add nudgeJune McEnroe 2020-09-03Build fbclock with -lzJune McEnroe 2020-08-29Add tweets from retweetsJune McEnroe