summaryrefslogtreecommitdiff
path: root/bin/menuscripts/mcurs
blob: 089bce489221e2447c1b5840251ef21641d41191 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

if [ "$MENUCMD" = "tofi" ]
then
	menucmd="tofi --width 30% --height 20% --padding-left 2%"
elif [ "$MENUCMD" = "dmenu" ]
then
	menucmd="dmenu -l 10 -g 1 -x -i" 
else
	menucmd="fzf"
fi

# requirements
which $MENUCMD firefox > /dev/null ||
	exit 1

choice="$(find ${1:-$HOME/docs/school} |
	grep "Cursus/index.html" 2> /dev/null |
	sed "s;$HOME;~;" |
	$menucmd)"
test -z "$choice" && exit 1
firefox "$choice"