urlgrab (385B)
1 #!/bin/sh 2 set -e 3 if [ -z "$TERM" -o "$TERM" = linux -o "$TERM" = dumb ]; then 4 menu="dmenu -i" 5 else 6 menu="fzy" 7 fi 8 (sleep 1; xdotool click 1) & 9 pid="$(xprop | awk '/_NET_WM_PID/ { print $3 }')" 10 f="${HOME}/.cache/st/$(date +%Y-%m-%d)/"*".$pid" 11 urls="$(cat $f | extract_urls | tr -cd '\11\12\15\40-\176')" 12 c="$(printf '%s\n' "$urls" | reverse | $menu)" 13 if test "$c"; then 14 plumb "$c" 15 fi