diff options
| author | Sebastiano Tronto <sebastiano.tronto@gmail.com> | 2022-05-15 12:02:59 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano.tronto@gmail.com> | 2022-05-15 12:02:59 +0200 |
| commit | 115ff9a06870d51702918cd926199e2271bf4f92 (patch) | |
| tree | 4c2abf616b9eec3ba485f49bcefaf0a98882fa33 /dmenu-urlselect | |
| parent | 5ca3ebbf7c3cef6db6b8270af4fcf0be087c29c1 (diff) | |
| download | scripts-115ff9a06870d51702918cd926199e2271bf4f92.tar.gz scripts-115ff9a06870d51702918cd926199e2271bf4f92.zip | |
Added option to specify alternative menu. Some general cleanup.
Diffstat (limited to 'dmenu-urlselect')
| -rwxr-xr-x | dmenu-urlselect | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/dmenu-urlselect b/dmenu-urlselect index e19ec7b..d4e1f59 100755 --- a/dmenu-urlselect +++ b/dmenu-urlselect | |||
| @@ -2,9 +2,18 @@ | |||
| 2 | 2 | ||
| 3 | # Finds all URLs in stdin and prompts a dmenu choice, then writes the selected | 3 | # Finds all URLs in stdin and prompts a dmenu choice, then writes the selected |
| 4 | # url to stdout. | 4 | # url to stdout. |
| 5 | # Usage: dmenu-urlselect [-m menu] | ||
| 5 | # Requires: dmenu (or similar), urlgrep | 6 | # Requires: dmenu (or similar), urlgrep |
| 6 | 7 | ||
| 7 | menu=${MENU:-dmenu} | 8 | menu="dmenu -i -l 20" |
| 8 | menuopts="-l 20" | ||
| 9 | 9 | ||
| 10 | urlgrep | $menu $menuopts | 10 | while getopts "m:" opt; do |
| 11 | case "$opt" in | ||
| 12 | m) | ||
| 13 | menu="$OPTARG" | ||
| 14 | ;; | ||
| 15 | esac | ||
| 16 | done | ||
| 17 | shift `expr $OPTIND - 1` | ||
| 18 | |||
| 19 | urlgrep | $menu | ||
