#!/bin/fish
# wrapper around bemenu
# bmenu *       - use as dmenu, -p for custom prompt (man bemenu)
# bmenu run     - select from .desktop files and run it
# bmenu start   - internal option
if test "$argv[1]" != "start" || test "$argv[1]" = "run"
    test -n "$SWAYSOCK" && swaymsg fullscreen off > /dev/null
end

if test "$argv[1]" = "run"
    test -n "$2" && set t "$2" || set t "terminal"
    exec j4-dmenu-desktop --dmenu="bmenu start -p Iniciar:" --term "$t"
end

# t  title
# f  filter
# n  normal
# h  highlighted
# s  selected
# sc scrollbar

bemenu \
    --ignorecase\
    --bottom\
    --no-overlap\
    --list 20\
    --prefix '->'\
    --fn "{{@@ font.mono @@}} 12"\
    --tb "{{@@ color.bg       @@}}" --tf "{{@@ color.accent @@}}" \
    --fb "{{@@ color.bg       @@}}" --ff "{{@@ color.txt    @@}}" \
    --nb "{{@@ color.bg       @@}}" --nf "{{@@ color.txt    @@}}" \
    --hb "{{@@ color.bg_light @@}}" --hf "{{@@ color.accent @@}}" \
    $argv
