#!/usr/bin/env sh # wrapper for /bin/sh that adds visual feedback when launching large and # bloated applications from dmenu on slow machines by spamming notify-send # calls to xwin-statusd to draw an animated spinner [ ! -z "$@" ] && stdin="$@" || read -r stdin [ -z "$stdin" ] && exit 1 { while :; do for f in '⠋' '⠙' '⠸' '⠴' '⠦' '⠇'; do echo "launching '$stdin' $f" | { notify-send -t 0.15; sleep 0.15; } done done } & SPINNER_PID=$! trap 'kill -9 $SPINNER_PID' 0 1 2 3 6 15 echo "$stdin" | sh & xwin-window-wait