Merge branch 'master' of http://www.gitlab.com/dwt1/dotfiles
This commit is contained in:
commit
e9999ec202
10
new.sh
10
new.sh
|
@ -7,15 +7,15 @@
|
||||||
#
|
#
|
||||||
# This is a test script
|
# This is a test script
|
||||||
|
|
||||||
myDir='/home/dt/test/'
|
myDir="$HOME/test/"
|
||||||
|
|
||||||
dirOptions=$(cd ${myDir} && /bin/ls -d */ | cut -d " " -f 1)
|
dirOptions=$(cd ${myDir} && /bin/ls -d */ | cut -d " " -f 1)
|
||||||
dirChoice=$(echo -e "${dirOptions[@]}\nquit" | dmenu -i -p 'My directories: ')
|
dirChoice=$(echo -e "${dirOptions[@]}\nquit" | dmenu -i -p 'My directories: ')
|
||||||
|
|
||||||
if [ "$dirChoice" == "quit" ]; then
|
if [ "$dirChoice" == "quit" ]; then
|
||||||
echo "Program terminated."
|
echo "Program terminated."
|
||||||
elif [ "$dirChoice" == ${dirChoice} ]; then
|
elif [ -n "$dirChoice" ]; then
|
||||||
fileOptions=$(cd ${myDir}${dirChoice} && /bin/ls -Ap | cut -d " " -f 1 | grep -v / )
|
fileChoice=$(/bin/ls ${myDir}'/'${dirChoice} -Apb | cut -d " " -f 1 | \
|
||||||
fileChoice=$(echo -e "${fileOptions[@]}" | dmenu -i -l 15 -p 'Edit this file: ')
|
grep -v / | dmenu -i -l 15 -p 'Edit this file: ')
|
||||||
exec emacsclient -c ${myDir}${dirChoice}${fileChoice}
|
[ -n "$fileChoice" ] && exec emacsclient -c ${myDir}${dirChoice}${fileChoice}
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue