neodotfiles/user/.config/suckless/dmenu/scripts/dmenu_edit
2023-06-24 13:00:22 -04:00

25 lines
674 B
Bash
Executable file

#!/usr/bin/env bash
# ***This script was made by Clay Gomera (Drake)***
# - Description: A simple script for file editing in dmenu
# - Dependencies: dmenu (Everything else can be changed)
# Show list of options
cd "$HOME" || exit 0
file=1
while [ "$file" ]; do
file=$(fd -LHpd 1 | dmenu -i -l 10 -p "󰈙 Open file in text editor $(basename "$(pwd)")")
if [ -e "$file" ]; then
owd=$(pwd)
if [ -d "$file" ]; then
cd "$file" || exit 0
else [ -f "$file" ]
if [ "$file" ]; then
$VISUAL "$owd/$file" &
exit 0
else
exit 0
fi
fi
fi
done