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

23 lines
548 B
Text
Raw Normal View History

2019-01-29 18:22:13 -06:00
#!/bin/bash
# ____ _____
# | _ \_ _| Derek Taylor (DistroTube)
# | | | || | http://www.youtube.com/c/DistroTube
# | |_| || | http://www.gitlab.com/dwt1/
# |____/ |_|
#
# Use dmenu to open and edit a file from a given list.
# I use this to quickly open my dwm source files in vim.
2019-02-10 14:18:26 -06:00
source $HOME/.dmenurc
2019-01-29 18:22:13 -06:00
# Global variables:
FILES=${1:-"/home/dt/dwm"}
DMENU='dmenu -l -i'
EDITOR='st -e vim'
# Show list of options
choice=$(ls -a "${FILES}" | $DMENU -p "« dwm » source code:")
if [ $choice ]; then
$EDITOR ${FILES}/${choice}
fi