summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <curtis.mcenroe@adgear.com>2017-01-19 17:06:24 -0500
committerJune McEnroe <curtis.mcenroe@adgear.com>2017-01-19 17:06:24 -0500
commit58b5127c0c73aca7e044c8dfac5249142d8c33ba (patch)
tree656fce8bc4fa853fa7004307155d7bd503752150
parentInclude host in tmux status line (diff)
downloadsrc-58b5127c0c73aca7e044c8dfac5249142d8c33ba.tar.gz
src-58b5127c0c73aca7e044c8dfac5249142d8c33ba.zip
Add fuzzy clock
Diffstat (limited to '')
-rwxr-xr-x.bin/clock.c28
-rwxr-xr-xinstall.sh1
2 files changed, 29 insertions, 0 deletions
diff --git a/.bin/clock.c b/.bin/clock.c
new file mode 100755
index 00000000..9eb4dc23
--- /dev/null
+++ b/.bin/clock.c
@@ -0,0 +1,28 @@
+#if 0
+exec cc -Wall -Wextra -pedantic $@ -o $(dirname $0)/clock $0
+#endif
+
+#include <time.h>
+#include <stdio.h>
+#include <sysexits.h>
+#include <err.h>
+
+int main() {
+    time_t timestamp = time(NULL);
+    if (timestamp < 0) err(EX_OSERR, "time");
+
+    struct tm *clock = localtime(&timestamp);
+    if (!clock) err(EX_OSERR, "localtime");
+
+    switch ((clock->tm_min + 5) / 10) {
+        case 0: printf("...%02d...\n", clock->tm_hour); break;
+        case 1: printf("..%02d....\n", clock->tm_hour); break;
+        case 2: printf(".%02d.....\n", clock->tm_hour); break;
+        case 3: printf("%02d....%02d\n", clock->tm_hour, clock->tm_hour + 1); break;
+        case 4: printf(".....%02d.\n", clock->tm_hour + 1); break;
+        case 5: printf("....%02d..\n", clock->tm_hour + 1); break;
+        case 6: printf("...%02d...\n", clock->tm_hour + 1); break;
+    }
+
+    return 0;
+}
diff --git a/install.sh b/install.sh
index 3c0c5ed3..7a939866 100755
--- a/install.sh
+++ b/install.sh
@@ -26,6 +26,7 @@ if [ -d ~/Library ]; then
   link Library/Keyboard\ Layouts/Programmer.keylayout
 fi
 
+link .bin/clock.c
 link .bin/jrp.c
 link .bin/manpager
 link .bin/pbcopy.c
b473&follow=1'>Disable menu bar in GVimJune McEnroe 2012-01-30Set shiftwidth to 4 for LuaJune McEnroe 2012-01-29Don't show Syntastic errors automaticallyJune McEnroe 2012-01-28Update to Quicktask 1.1June McEnroe 2012-01-22Use space-test branch of quicktaskJune McEnroe 2012-01-22Enable syntax-based foldingJune McEnroe 2012-01-22Update quicktaskJune McEnroe 2012-01-22Revert "Add AutoClose"June McEnroe This reverts commit 39cfdd62ba82f93f68a2b5fa7b5771303d8b9dee. This fixes the delay when leaving insert mode 2012-01-22Revert "Disable powerline for now"June McEnroe This reverts commit fa48f5965c57272e616721d92475cd2f1e35f667. 2012-01-22Revert "Add VCS repo directories to wildignore"June McEnroe This reverts commit 41cb1db33ba7b64d8af63bf55bb82f7e8a617518. This fixes not being able to commit with vim-fugitive 2012-01-22Disable powerline for nowJune McEnroe 2012-01-22Update some pluginsJune McEnroe 2012-01-22Add VCS repo directories to wildignoreJune McEnroe 2012-01-22Map ,e and ,b to CtrlP file and buffer respectivelyJune McEnroe 2012-01-22Add vim-spaceJune McEnroe 2012-01-22Add AutoCloseJune McEnroe 2012-01-22Add binding for GundoJune McEnroe 2012-01-22Add GundoJune McEnroe 2012-01-22Add Jellybeans colorschemeJune McEnroe 2012-01-22Add syntasticJune McEnroe 2012-01-21Add PowerlineJune McEnroe 2012-01-21Add quicktaskJune McEnroe 2012-01-15Moved comments out of mapsJune McEnroe 2012-01-14Disable scrollbarsJune McEnroe