1 2 3 4 5 6 7 8 9 10 11 12 13 14
#!/bin/sh # Prompt for a URL or search term get_url() { dmenu -p "URL or search" } URL=$1 [ -n "$URL" ] || URL=$(xclip -selection clipboard -o) [ -n "$URL" ] || URL=$(get_url) [ -n "$URL" ] || exit echo "$URL" xdg-open $URL