From 77b295b8b0f9b73ecbda809e7843812c5f4c3737 Mon Sep 17 00:00:00 2001 From: Sam Nystrom Date: Thu, 27 Nov 2025 17:35:42 -0500 Subject: update --- bin/harespec | 3 --- bin/readmail | 24 +++++++++++++++++++++--- bin/shuffle | 19 ++++++++----------- bin/statusline | 4 ++-- bin/wmenu-run | 2 +- 5 files changed, 32 insertions(+), 20 deletions(-) delete mode 100755 bin/harespec (limited to 'bin') diff --git a/bin/harespec b/bin/harespec deleted file mode 100755 index 7bfeaf9..0000000 --- a/bin/harespec +++ /dev/null @@ -1,3 +0,0 @@ -#!/command/execlineb -P -importas -i HOME HOME -zathura ${HOME}/Documents/hare-specification.pdf diff --git a/bin/readmail b/bin/readmail index 1643706..5466088 100755 --- a/bin/readmail +++ b/bin/readmail @@ -5,15 +5,33 @@ dir=~/mail/"${1:-INBOX}" while true; do mlist "$dir" | msort -dr | mseq -S | MBLAZE_PAGER=cat mscan read -r addr cmd || break + if [ -z "$cmd" ]; then + cmd="$addr" + addr=. + fi case "$cmd" in - g) mbsync primary >/dev/null 2>&1 && minc ~/mail/* >/dev/null ;; - c) mseq -C "$addr" ;; + g) mbsync primary && minc ~/mail/* >/dev/null ;; + C) mseq -C "$addr" ;; + c*) dir=~/mail/"${cmd#c}" ;; s) mshow "$addr" && mflag -S "$addr" >/dev/null ;; a) mrefile "$addr" ~/mail/Archive ;; m*) mrefile "$addr" ~/mail/"${cmd#m}" ;; f*) mflag -"${cmd#f}" "$addr" >/dev/null ;; + h) + echo 'Commands:' + echo 'g - fetch mail' + echo 'C - set the sequence to messages' + echo 'cFOLDER - cd to FOLDER' + echo 's - show messages' + echo 'a - archive messages' + echo 'mFOLDER - move messages to FOLDER' + echo 'fFLAGS - set FLAGS on messages. Uppercase sets, lowercase unsets.' + echo ' d=draft, f=flagged, p=passed, r=replied, s=seen, t=trashed.' + echo 'h - print this message' + echo + ;; q) break ;; esac done echo 'Syncing changes...' -mbsync primary >/dev/null 2>&1 +mbsync primary diff --git a/bin/shuffle b/bin/shuffle index 67c4de9..33f7b95 100755 --- a/bin/shuffle +++ b/bin/shuffle @@ -2,9 +2,9 @@ printhelp() { cat <&1 >/dev/null; then + if printf %d "$OPTARG" >/dev/null 2>&1; then volume="$OPTARG" else printf "%s: invalid number '%s'\n" "${0##*/}" "$OPTARG" @@ -35,18 +35,15 @@ done shift $((OPTIND-1)) -if [ $# -gt 1 ]; then - printusage -elif [ $# -eq 1 ]; then - dir="$1" -else - dir="$(. "${XDG_CONFIG_HOME:-"$HOME"/.config}/user-dirs.dirs" && printf '%s' "$XDG_MUSIC_DIR")" +if [ $# -lt 1 ]; then + # set -- "$(. "${XDG_CONFIG_HOME:-"$HOME"/.config}/user-dirs.dirs" && printf '%s' "$XDG_MUSIC_DIR")" + set -- . fi prev1= prev2= while true; do - file="$(find -L "$dir" -type f \( -name '*.m4a' -o -name '*.opus' \) ! -path "$prev1" ! -path "$prev2" -exec shuf -n1 -e '{}' +)" + file="$(find -L "$@" -type f \( -name '*.m4a' -o -name '*.opus' \) ! -path "$prev1" ! -path "$prev2" -exec shuf -n1 -e '{}' +)" prev1="$prev2" prev2="$file" printf 'Playing %s\n' "${file#$dir/}" diff --git a/bin/statusline b/bin/statusline index 948e8cb..b442b91 100755 --- a/bin/statusline +++ b/bin/statusline @@ -50,8 +50,8 @@ function battery() f:close() local symbol = 'ERROR' - local i = capacity > 0 and (capacity - 1) // 10 or 0 - if status == 'Discharging\n' then + local i = capacity > 0 and (capacity - 1) // 10 + 1 or 1 + if status == 'Discharging\n' or status == 'Not charging\n' then symbol = ({"󰁺", "󰁻", "󰁼", "󰁽", "󰁾", "󰁿", "󰂀", "󰂁", "󰂂", "󰁹"})[i] -- 󰂃 elseif status == 'Charging\n' then symbol = ({"󰢜", "󰂆", "󰂇", "󰂈", "󰢝", "󰂉", "󰢞", "󰂊", "󰂋", "󰂅"})[i] diff --git a/bin/wmenu-run b/bin/wmenu-run index 84e85f2..6d80a33 100755 --- a/bin/wmenu-run +++ b/bin/wmenu-run @@ -1,2 +1,2 @@ #!/bin/sh -exec $(IFS=:; find -L ${PATH} -type f -perm -555 -exec basename -a '{}' + | wmenu -p run:) +exec $(IFS=:; find -L ${PATH} -type f -perm -555 -exec basename -a '{}' + | sort -u | wmenu -p run:) -- cgit v1.2.3