aboutsummaryrefslogtreecommitdiff
path: root/dmenu-urlselect
blob: a9888262c9498e13baffcae4690724099fab37df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

# Finds all URLs in stdin and prompts a dmenu choice, then writes the selected
# url to stdout.
# Requires: dmenu (or similar), urlgrep

# Usage: dmenu-urlselect [-m menu]

menu="dmenu -i -l 20"

usage() {
	echo "Usage: dmenu-urlselect [-m MENU]"
}

while getopts "m:" opt; do
	case "$opt" in
		m)
			menu="$OPTARG"
			;;
		*)
			usage
			exit 1
			;;
		esac
done
shift $((OPTIND - 1))

urlgrep | $menu

Generated with cgit - Back to sebastiano.tronto.net