dotfiles

<-- duh.
Log | Files | Refs | LICENSE

commit 2c43988e146e3709d1ebf5b077beb695b85d4f17
parent abc39c3b68aac38c4067aeb86040617e98bd567b
Author: hhvn <dev@haydenvh.com>
Date:   Sat, 27 Mar 2021 19:07:14 +0000

.s/b/urlhand: add ALL choice

Diffstat:
M.scripts/bin/urlhand | 11+++++++----
1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/.scripts/bin/urlhand b/.scripts/bin/urlhand @@ -1,9 +1,7 @@ #!/bin/sh links=$(grep -Eo '[A-Za-z][A-Za-z]*://[^ ]*' < /dev/stdin 2>/dev/null | sed 's/[>,:)]$//') - -[ $(echo "$links" | wc -l) -eq 1 ] && link=$links || link=$(echo "$links" | dmenu -i) - +[ $(echo "$links" | wc -l) -eq 1 ] && link=$links || link=$(printf 'ALL\n%s\n' "$links" | dmenu -i) [ "$link" = "" ] && exit 1 hand=$(printf "mpvms video @@ -36,4 +34,9 @@ torsocks popupcgo torsocks popupw3m torsocks gpgimport" | dmenu -i) -nohup sh -c "$hand $link" >/dev/null & +[ "$link" = "ALL" ] && { + for u in $links + do + nohup sh -c "$hand $u" >/dev/null & + done +} || nohup sh -c "$hand $link" >/dev/null &