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
Plaintext
Raw Normal View History

#!/usr/bin/env bash
set -euf -o pipefail
MAINDIR="$HOME/doc/"
NOTAS="notas"
DIARIO="blog"
2020-05-18 09:42:32 +00:00
DIRS=("$NOTAS" "$DIARIO")
SELPATH="$(printf '%s\n' "${DIRS[@]}" | dmenu -w 250 -p "Wiki ")"
2020-05-18 09:42:32 +00:00
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
2020-05-18 09:42:32 +00:00
if [[ $SEL == "" ]]; then
exit 0
else
alacritty --class=flota -e nvim "$SEL"
fi