2022-04-05 16:59:13 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Feed this script a link or it will get it from your clipboard and it will give dmenu
|
|
|
|
# with some choice of programs to open the link with.
|
|
|
|
|
2022-07-09 19:13:31 +02:00
|
|
|
source $HOME/.config/dmenu/config
|
|
|
|
|
2022-04-05 16:59:13 +02:00
|
|
|
[ -z "$@" ] && link=$(xclip -o) || link="$@"
|
|
|
|
|
2022-07-09 19:13:31 +02:00
|
|
|
case "$(printf "mpv\\nbrowser\\ncopy url\\nw3m" | $DMENU -p "Open link with what program?")" in
|
2022-04-05 16:59:13 +02:00
|
|
|
mpv) "$VIDEO" "$link" ;;
|
|
|
|
browser) "$BROWSER" "$link" > /dev/null;;
|
|
|
|
"copy url") echo "$link" | xclip -selection clipboard ;;
|
|
|
|
w3m) readable "$link" | w3m -T text/html ;;
|
|
|
|
esac
|