1
0
Fork 0
mirror of https://gitlab.com/dwt1/dotfiles.git synced 2023-02-13 20:55:19 -05:00
dwt1--dotfiles/new.sh

22 lines
681 B
Bash
Raw Normal View History

2019-12-11 23:59:43 -05:00
!/usr/bin/env bash
# ____ _____
2019-11-08 17:33:56 -05:00
# | _ \_ _| Derek Taylor (DistroTube)
# | | | || | http://www.youtube.com/c/DistroTube
# | |_| || | http://www.gitlab.com/dwt1/
# |____/ |_|
2019-11-08 17:33:56 -05:00
#
# This is a test script
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."
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