dotfiles

configurations and scripts
git clone https://riazj.com/git/dotfiles
Log | Files | Refs | README | LICENSE

commit d29eb1c3d2d304f046832dfce5092208d79dec06
parent ddab326b90cf2a13e74be5e9ba74c211eae849a7
Author: Riaz <riaz@riazj.com>
Date:   Mon, 24 Nov 2025 19:00:45 -0800

Shorten scripts

Diffstat:
M.local/bin/new-article | 11++---------
M.local/bin/todo | 6+-----
2 files changed, 3 insertions(+), 14 deletions(-)

diff --git a/.local/bin/new-article b/.local/bin/new-article @@ -1,20 +1,13 @@ #!/bin/sh -e -error() { - echo "new-article: $1" >&2; exit 1 -} - cd ~/repos/riazj.com/articles -gitstat="$(git status -s . | grep "^??")" || error "no new articles" +gitstat="$(git status -s . | grep "^??")" article="${gitstat#* }" -[ "$(printf "%s\n" "$article" | wc -l)" -ne 1 ] && - error "found more than one article" - text2html "$article" grep -q '<meta name="description" content="">' "$article" && - error "no article description" + echo "new-article: no article description" && exit 1 tidy -mq -wrap --keep-tabs yes --tidy-mark no "$article" diff --git a/.local/bin/todo b/.local/bin/todo @@ -1,16 +1,12 @@ #!/bin/sh TODO="$HOME/todo" -height="$(wc -l "$TODO")" -height="${height% *}" -while sel="$(dmenu -i -l "$height" < "$TODO")"; do +while sel="$(dmenu -i -l 10 < "$TODO")"; do if grep -Fqx "$sel" "$TODO"; then grep -vFx "$sel" "$TODO" > "$TODO.tmp" mv "$TODO.tmp" "$TODO" - height=$((height-1)) else echo "$sel" >> "$TODO" - height=$((height+1)) fi done