summaryrefslogtreecommitdiff
path: root/url_handler.sh
blob: bbf383fe86964412985b14877e9193233cb70f1c (plain) (blame)
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