dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 545ee3f6236f7a5793e2e03bb8db7d0a7cd6381e
parent 9beee45de8c6f5fb5c1d6958fde984151361826e
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Mon,  6 Jul 2020 13:45:03 +0200

Show exit status in notification

Diffstat:
M.local/bin/search | 10++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/.local/bin/search b/.local/bin/search @@ -29,10 +29,16 @@ regeximatch() { if command -v "$(printf '%s' "$c" | sed 's/ .*//')" >/dev/null 2>&1; then out="$(eval "$c" 2>&1)" + s=$? + if [ "$s" -gt 0 ]; then + s=" (${s})" + else + s="" + fi if [ -n "$out" ]; then - notify "\$ $c" "$out" + notify "\$ ${c}${s}" "$out" fi - exit $? + exit "$s" fi if regeximatch "$c" '^gopher://' || \