diff options
author | Tom Willemse | 2022-03-03 01:20:50 -0800 |
---|---|---|
committer | Tom Willemse | 2022-03-03 01:20:50 -0800 |
commit | 5bcc4de5827282a3b633062211a2c697a849fe30 (patch) | |
tree | 851512995f280c268c178dcd1f7befd8f355b005 /polybar/usr/bin/inbox-size | |
parent | 88b6ba1760e8ba6a68c8e392112ac41df2b2addb (diff) | |
download | new-dotfiles-5bcc4de5827282a3b633062211a2c697a849fe30.tar.gz new-dotfiles-5bcc4de5827282a3b633062211a2c697a849fe30.zip |
[polybar] Several fixes for ‘inbox-size’
- Make the header more robust. If we need to add more argumetns to the scsh
command-line this will let us do that more easily in the future without having
to change the header again.
- Don't ‘display’ the result of the call to ‘run’ because that should always be
‘0’, unless something went wrong. Regardless, it doesn't belong in the output
of this program.
- Use ‘rx’ in Emacs to build the regular expression. This is easier to read,
especially considering how many times a single ‘\’ has to be escaped (once for
the string in scsh, and once more for the string in Emacs).
Diffstat (limited to 'polybar/usr/bin/inbox-size')
-rwxr-xr-x | polybar/usr/bin/inbox-size | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/polybar/usr/bin/inbox-size b/polybar/usr/bin/inbox-size index 0422aba..113715a 100755 --- a/polybar/usr/bin/inbox-size +++ b/polybar/usr/bin/inbox-size @@ -1,6 +1,8 @@ -#!/usr/bin/env -S scsh -s -;; # -*- mode: scheme; -*- +#!/usr/bin/env sh +# -*- mode: scheme; -*- +IFS=" " +exec scsh -s "$0" "$@" !# -(display (run (emacs --quick --batch --visit ~/documents/gtd/inbox.org - --eval "(princ (how-many \"^\\\\* +\"))"))) +(run (emacs --quick --batch --visit ~/documents/gtd/inbox.org + --eval "(princ (how-many (rx bol \"*\" (one-or-more space))))")) |