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

29 lines
537 B
Bash
Executable File

#!/usr/bin/env bash
set -euf -o pipefail
MAINDIR="$HOME/doc/"
NOTAS="notas"
DIARIO="blog"
CHIP="chiptune"
DIRS=("$NOTAS" "$DIARIO" "$CHIP")
SELPATH="$(printf '%s\n' "${DIRS[@]}" | dmenu -w 250 -p "Wiki ")"
wiki () {
cd "$MAINDIR/$SELPATH"
if command -v fd >/dev/null 2>&1; then
sel=$(fd -d 1 -e wiki | dmenu -w 250 -p "Blog ")
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
}
wiki