dgy
/
hexagons
Archived
1
0
Fork 0
This repository has been archived on 2021-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
hexagons/.local/bin/notas

23 lines
486 B
Bash
Executable File

#!/usr/bin/env bash
set -euf -o pipefail
MAINDIR="$HOME/doc/"
NOTAS="notas"
DIARIO="blog"
DIRS=("$NOTAS" "$DIARIO")
SELPATH="$(printf '%s\n' "${DIRS[@]}" | dmenu -w 250 -p "Wiki ")"
cd "$MAINDIR/$SELPATH"
if command -v fd >/dev/null 2>&1; then
SEL=$(fd -d 1 -e wiki | dmenu -w 250 -p "File ")
else
SEL=$(find . -maxdepth 1 -type f -printf '%P\n' | sort -M | dmenu -w 250 -p "File ")
fi
if [[ $SEL == "" ]]; then
exit 0
else
alacritty --class=flota -e nvim "$SEL"
fi