2019-12-11 23:59:43 -05:00
|
|
|
!/usr/bin/env bash
|
2019-11-08 22:35:51 -05:00
|
|
|
# ____ _____
|
2019-11-08 17:33:56 -05:00
|
|
|
# | _ \_ _| Derek Taylor (DistroTube)
|
|
|
|
# | | | || | http://www.youtube.com/c/DistroTube
|
2019-11-08 22:35:51 -05:00
|
|
|
# | |_| || | http://www.gitlab.com/dwt1/
|
|
|
|
# |____/ |_|
|
2019-11-08 17:33:56 -05:00
|
|
|
#
|
|
|
|
# This is a test script
|
|
|
|
|
2019-11-08 22:35:51 -05:00
|
|
|
myDir="$HOME/test/"
|
2019-11-08 17:33:56 -05:00
|
|
|
|
|
|
|
dirOptions=$(cd ${myDir} && /bin/ls -d */ | cut -d " " -f 1)
|
|
|
|
dirChoice=$(echo -e "${dirOptions[@]}\nquit" | dmenu -i -p 'My directories: ')
|
|
|
|
|
|
|
|
if [ "$dirChoice" == "quit" ]; then
|
|
|
|
echo "Program terminated."
|
2019-11-08 22:35:51 -05:00
|
|
|
elif [ -n "$dirChoice" ]; then
|
|
|
|
fileChoice=$(/bin/ls ${myDir}'/'${dirChoice} -Apb | cut -d " " -f 1 | \
|
|
|
|
grep -v / | dmenu -i -l 15 -p 'Edit this file: ')
|
|
|
|
[ -n "$fileChoice" ] && exec emacsclient -c ${myDir}${dirChoice}${fileChoice}
|
2019-11-08 17:33:56 -05:00
|
|
|
fi
|