#!/bin/bash

# basic menu activated from the top left

CHOICE="$(echo ':b Applications
:b Settings
:b Terminal
:b Info
:g Documentation
:b Keybindings
:r Shutdown
:r Close menu' | instantmenu -i -bw 4 -w -1 -h -1 -n -l 10 -x 0 -F -a 0)"

[ -z "$CHOICE" ] && exit

echo "$CHOICE"
case "$CHOICE" in
*Applications)
    sleep 0.05
    appmenu &
    ;;
*Settings)
    instantsettings &
    ;;
*Info)
    kitty -e sh -c 'fastfetch && echo -ne "$(cat /usr/share/instantutils/thanks.txt | sed "s/^/   /g")" && sleep 60m' &
    ;;
*Shutdown)
    instantshutdown &
    ;;
*Terminal)
    kitty &
    ;;
*Documentation)
    instantutils open browser 'https://instantos.io/docs/' &
    ;;
*Keybindings)
    kitty -e instanthotkeys &
    ;;
*menu)
    echo "closed menu"
    ;;
*)
    echo "other choice"
    instantmenu_smartrun "startmenu" "$CHOICE"
    ;;
esac

exit
