This repository has been archived on 2024-04-07. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/dotfiles/scripts/bmenu

67 lines
1.4 KiB
Bash
Executable File

#!/bin/sh
# 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 "$1" != "start" || test "$1" = "run"
then
test -n "$SWAYSOCK" && swaymsg fullscreen off &> /dev/null
fi
if test "$1" = "run"
then
test -n "$2" && t="$2" || t="terminal"
exec j4-dmenu-desktop --dmenu="bmenu start -p Iniciar:" --term "$t"
fi
# t title
# f filter
# n normal
# h highlighted
# s selected
# sc scrollbar
fn="{{@@ font.mono @@}} {{@@ font.size.small @@}}"
tb="{{@@ color.bg @@}}{{@@ opacity | clamp_to_hex @@}}"
tf="{{@@ accent_color @@}}"
fb="{{@@ color.bg @@}}{{@@ opacity | clamp_to_hex @@}}"
ff="{{@@ color.txt @@}}"
nb="{{@@ color.bg @@}}{{@@ opacity | clamp_to_hex @@}}"
nf="{{@@ color.txt @@}}"
hb="{{@@ color.bg_light @@}}"
hf="{{@@ accent_color @@}}"
#{%@@ if False @@%}#
# Hacks to allow runnning even if not templated
fn="Fira Code 12"
tf="#D9534F"
tb="#202020"
ff="#ffffff"
fb="#202020"
nf="#ffffff"
nb="#202020"
hf="#D9534F"
hb="#404040"
#{%@@ endif @@%}#
bemenu \
--ignorecase\
--bottom\
--no-overlap\
--list 20\
--prefix '>'\
--fn "$fn"\
--tb "$tb" --tf "$tf" \
--fb "$fb" --ff "$ff" \
--nb "$nb" --nf "$nf" \
--hb "$hb" --hf "$hf" \
$@