summaryrefslogtreecommitdiff
path: root/bin/menuscripts/mcurs
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2023-08-30 08:23:45 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2023-08-30 08:23:45 +0200
commit3f8594ee04d2a3d9b40a259daf3b564a53b510fa (patch)
tree66ed50643cdc81af813b5771a99732d0f78bb618 /bin/menuscripts/mcurs
parent45d39ae0c67bb086f4df0c366b251e06c888408d (diff)
parent333aaf38c66a1e4ba41d3acea38b21613c0075b2 (diff)
Merge branch 'main' of db:dotfiles
Diffstat (limited to 'bin/menuscripts/mcurs')
-rwxr-xr-xbin/menuscripts/mcurs25
1 files changed, 7 insertions, 18 deletions
diff --git a/bin/menuscripts/mcurs b/bin/menuscripts/mcurs
index 32f5525..4349e0b 100755
--- a/bin/menuscripts/mcurs
+++ b/bin/menuscripts/mcurs
@@ -1,22 +1,11 @@
#!/bin/sh
-if [ "$MENUCMD" = "tofi" ]
-then
- menucmd="tofi --width 30% --height 20% --padding-left 2% --matching-algorithm normal"
-elif [ "$MENUCMD" = "dmenu" ]
-then
- menucmd="dmenu -l 10 -g 1 -x -i"
-else
- menucmd="fzf"
-fi
-
# requirements
-which $MENUCMD firefox > /dev/null ||
- exit 1
+which "$BROWSER" > /dev/null || exit 1
+
+choice="$(find "${1:-$HOME/docs/school}" |
+ grep -i "cursus/index.html" 2> /dev/null |
+ sed "s;$HOME;~;" | commander -x -d -c)"
+[ "$choice" ] && 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"
+$BROWSER "$choice"