Browse Source

Allow passing arguments down to dmenu

Alois Mahdal 10 years ago
parent
commit
669eef8078
1 changed files with 6 additions and 7 deletions
  1. 6
    7
      bin/eedmenu.in

+ 6
- 7
bin/eedmenu.in View File

7
 FFOO_INI_PATH="__FFOO_INI_PATH__"
7
 FFOO_INI_PATH="__FFOO_INI_PATH__"
8
 
8
 
9
 usage() {
9
 usage() {
10
-    usage_is "[-l|--lines NUM] [-s|--split CHAR]"
10
+    usage_is "[-l|--lines NUM] [--split CHAR] ARGS..."
11
 }
11
 }
12
 
12
 
13
 numbered=false
13
 numbered=false
15
 maybe_split=cat
15
 maybe_split=cat
16
 
16
 
17
 while true; do case $1 in
17
 while true; do case $1 in
18
-    -l|--lines)         lines=$2; shift 2 ;;
19
-    -s|--split)         delim=$2; shift 2 ;;
20
-    "")                 break             ;;
21
-    *)  usage
18
+    -l|--lines)     lines=$2; shift 2 ;;
19
+    --split)        delim=$2; shift 2 ;;
20
+    --help|--usage) usage             ;;
21
+    *)              break             ;;
22
 esac done
22
 esac done
23
 
23
 
24
 test -n "$delim"        && maybe_split=do_split
24
 test -n "$delim"        && maybe_split=do_split
41
     cut -d$delim -f2-
41
     cut -d$delim -f2-
42
 }
42
 }
43
 
43
 
44
-dmenu -l $lines $style \
45
-  | $maybe_split
44
+dmenu -l $lines $style "$@" | $maybe_split