From fc6b53d4dfdb96cb889388c6630d6994c99d410a Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 20 Jan 2022 21:48:24 -0800 Subject: [PATCH] [polybar] Show how many items there are in my GTD inbox --- polybar/.config/polybar/config | 8 +++++++- polybar/usr/bin/inbox-size | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100755 polybar/usr/bin/inbox-size diff --git a/polybar/.config/polybar/config b/polybar/.config/polybar/config index bc37764..2f1b775 100644 --- a/polybar/.config/polybar/config +++ b/polybar/.config/polybar/config @@ -36,7 +36,7 @@ font-2 = siji:pixelsize=10;1 modules-left = ewmh xwindow modules-center = -modules-right = email pulseaudio xkeyboard vpn date +modules-right = todo email pulseaudio xkeyboard vpn date tray-position = center tray-padding = 0 @@ -228,3 +228,9 @@ type = custom/script exec = count-emails interval = 5 format-prefix = " " + +[module/todo] +type = custom/script +exec = inbox-size +interval = 60 +format-prefix = " " diff --git a/polybar/usr/bin/inbox-size b/polybar/usr/bin/inbox-size new file mode 100755 index 0000000..0422aba --- /dev/null +++ b/polybar/usr/bin/inbox-size @@ -0,0 +1,6 @@ +#!/usr/bin/env -S scsh -s +;; # -*- mode: scheme; -*- +!# + +(display (run (emacs --quick --batch --visit ~/documents/gtd/inbox.org + --eval "(princ (how-many \"^\\\\* +\"))")))