diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2026-05-06 08:30:49 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2026-05-06 08:30:49 +0200 |
| commit | 60052659b98832c78c902e4f27ecee2663d8e913 (patch) | |
| tree | 9efc1388569c43456557aa1975b4bec99bf06c94 /scripts/dmenu-urlselect | |
| parent | 10e16c2fb2266bb2b46ec7ea64d721de0c29a0d9 (diff) | |
| download | config-60052659b98832c78c902e4f27ecee2663d8e913.tar.gz config-60052659b98832c78c902e4f27ecee2663d8e913.zip | |
Added scripts
Diffstat (limited to '')
| -rwxr-xr-x | scripts/dmenu-urlselect | 28 |
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 | |||
| 9 | menu="dmenu -i -l 20" | ||
| 10 | |||
| 11 | usage() { | ||
| 12 | echo "Usage: dmenu-urlselect [-m MENU]" | ||
| 13 | } | ||
| 14 | |||
| 15 | while getopts "m:" opt; do | ||
| 16 | case "$opt" in | ||
| 17 | m) | ||
| 18 | menu="$OPTARG" | ||
| 19 | ;; | ||
| 20 | *) | ||
| 21 | usage | ||
| 22 | exit 1 | ||
| 23 | ;; | ||
| 24 | esac | ||
| 25 | done | ||
| 26 | shift $((OPTIND - 1)) | ||
| 27 | |||
| 28 | urlgrep | $menu | ||
