aboutsummaryrefslogtreecommitdiff
path: root/dmenu-urlselect
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2023-06-20 23:01:09 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2023-06-20 23:01:09 +0200
commit581865ee0c8b8aea872f053d804a41fb5f416b17 (patch)
tree9a2f99ea48c31629a5c3c42b0454483982cdbfed /dmenu-urlselect
parentc5d101ab2c9db3b1a001cb56953cb90b24f8fdcf (diff)
downloadscripts-581865ee0c8b8aea872f053d804a41fb5f416b17.tar.gz
scripts-581865ee0c8b8aea872f053d804a41fb5f416b17.zip
Various shellcheck fixes (www.shellcheck.net)
Diffstat (limited to '')
-rwxr-xr-xdmenu-urlselect13
1 files changed, 11 insertions, 2 deletions
diff --git a/dmenu-urlselect b/dmenu-urlselect
index d4e1f59..a988826 100755
--- a/dmenu-urlselect
+++ b/dmenu-urlselect
@@ -2,18 +2,27 @@
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]
6# Requires: dmenu (or similar), urlgrep 5# Requires: dmenu (or similar), urlgrep
7 6
7# Usage: dmenu-urlselect [-m menu]
8
8menu="dmenu -i -l 20" 9menu="dmenu -i -l 20"
9 10
11usage() {
12 echo "Usage: dmenu-urlselect [-m MENU]"
13}
14
10while getopts "m:" opt; do 15while getopts "m:" opt; do
11 case "$opt" in 16 case "$opt" in
12 m) 17 m)
13 menu="$OPTARG" 18 menu="$OPTARG"
14 ;; 19 ;;
20 *)
21 usage
22 exit 1
23 ;;
15 esac 24 esac
16done 25done
17shift `expr $OPTIND - 1` 26shift $((OPTIND - 1))
18 27
19urlgrep | $menu 28urlgrep | $menu

Generated with cgit - Back to sebastiano.tronto.net