summaryrefslogtreecommitdiff
path: root/scripts/dmenu-urlselect
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/dmenu-urlselect')
-rwxr-xr-xscripts/dmenu-urlselect28
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/dmenu-urlselect b/scripts/dmenu-urlselect
new file mode 100755
index 0000000..a988826
--- /dev/null
+++ b/scripts/dmenu-urlselect
@@ -0,0 +1,28 @@
1#!/bin/sh
2
3# Finds all URLs in stdin and prompts a dmenu choice, then writes the selected
4# url to stdout.
5# Requires: dmenu (or similar), urlgrep
6
7# Usage: dmenu-urlselect [-m menu]
8
9menu="dmenu -i -l 20"
10
11usage() {
12 echo "Usage: dmenu-urlselect [-m MENU]"
13}
14
15while getopts "m:" opt; do
16 case "$opt" in
17 m)
18 menu="$OPTARG"
19 ;;
20 *)
21 usage
22 exit 1
23 ;;
24 esac
25done
26shift $((OPTIND - 1))
27
28urlgrep | $menu

Generated with cgit - Back to sebastiano.tronto.net