2015-05-29 21:08:06 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
DMENU=$(dirname $0)/dmenu.sh
|
|
|
|
|
|
|
|
UP="[..]"
|
|
|
|
OPEN_EXPLORER="[Open Thunar here]"
|
|
|
|
OPEN_TERMINAL="[Open Terminal here]"
|
|
|
|
WIDTH=300
|
|
|
|
LINES=30
|
|
|
|
|
|
|
|
OPEN_CMD="xdg-open"
|
|
|
|
TERM_CMD="urxvt"
|
|
|
|
|
|
|
|
if [ -n "$1" ]; then
|
|
|
|
DIR=$1
|
|
|
|
else
|
|
|
|
DIR=$HOME
|
|
|
|
fi
|
|
|
|
|
|
|
|
while true; do
|
|
|
|
bname=$(basename "$DIR")
|
|
|
|
choice=$(
|
|
|
|
(
|
|
|
|
echo "$UP";
|
|
|
|
echo "$OPEN_EXPLORER";
|
|
|
|
echo "$OPEN_TERMINAL";
|
2016-02-18 11:49:18 +01:00
|
|
|
ls "$DIR";
|
2015-05-29 21:08:06 +02:00
|
|
|
) | $DMENU -i
|
|
|
|
)
|
|
|
|
if [ -z "$choice" ]; then
|
|
|
|
exit 1
|
|
|
|
elif [ "$choice" == "$UP" ]; then
|
2016-02-18 11:49:18 +01:00
|
|
|
DIR=$(dirname "$DIR")
|
2015-05-29 21:08:06 +02:00
|
|
|
elif [ "$choice" == "$OPEN_EXPLORER" ]; then
|
|
|
|
($OPEN_CMD "$DIR" &) &
|
|
|
|
exit 0
|
|
|
|
elif [ "$choice" == "$OPEN_TERMINAL" ]; then
|
2016-02-18 11:49:18 +01:00
|
|
|
( cd "$DIR"; $TERM_CMD &) &
|
2015-05-29 21:08:06 +02:00
|
|
|
exit 0
|
|
|
|
elif [ -f "$DIR/$choice" ]; then
|
|
|
|
($OPEN_CMD "$DIR/$choice" &) &
|
|
|
|
exit 0
|
|
|
|
elif [ -d "$DIR/$choice" ]; then
|
2016-02-18 11:49:18 +01:00
|
|
|
DIR="$DIR/$choice"
|
2015-05-29 21:08:06 +02:00
|
|
|
fi
|
|
|
|
done
|