2022-09-13 01:06:55 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# ***This script was made by Clay Gomera (Drake)***
|
|
|
|
# - Description: A simple script for file editing in rofi
|
|
|
|
# - Dependencies: rofi (Everything else can be changed)
|
|
|
|
|
|
|
|
# Show list of options
|
2022-09-14 14:28:06 +00:00
|
|
|
EDITOR="alacritty -e nvim"
|
2022-09-13 01:06:55 +00:00
|
|
|
cd "$HOME" || exit 0
|
|
|
|
file=1
|
|
|
|
while [ "$file" ]; do
|
|
|
|
file=$(fd -LHpd 1 | rofi -dmenu -b -l 10 -p "File to edit: $(basename $(pwd))")
|
|
|
|
if [ -e "$file" ]; then
|
|
|
|
owd=$(pwd)
|
|
|
|
if [ -d "$file" ]; then
|
|
|
|
cd "$file" || exit 0
|
|
|
|
else [ -f "$file" ]
|
|
|
|
if [ "$file" ]; then
|
|
|
|
$EDITOR "$owd/$file" &
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|