4 [ -z "$VIS_MENU" ] && VIS_MENU
="slmenu"
5 [ -z "$VIS_MENU_ARGS" ] && VIS_MENU_ARGS
="-b"
10 echo "usage: $0 [-h] [-p prompt] [file-pattern]"
14 VIS_MENU_ARGS
="$VIS_MENU_ARGS -p $2"
25 if ! type "$VIS_MENU" >/dev
/null
2>&1; then
26 if [ ! -z "$DISPLAY" ] && type "dmenu" >/dev
/null
2>&1; then
29 echo "Neither slmenu nor dmenu found"
35 [ ! -z "$PATTERN" -a "$PATTERN" != "." -a -d "$PATTERN" ] && DIR
="$PATTERN"
38 SEL
=$
({ echo ..
; ls -1 $PATTERN; } |
$VIS_MENU $VIS_MENU_ARGS)
39 [ -z "$SEL" ] && exit 1
40 [ ! -z "$DIR" ] && SEL
="$DIR/$SEL"
41 if [ -d "$SEL" ]; then