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.3 KiB
Plaintext
Raw Normal View History

2020-11-03 06:15:23 +01:00
#!/bin/sh
2020-04-26 08:43:54 +02:00
# 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
2020-11-03 06:15:23 +01:00
if test "$1" != "start" || test "$1" = "run"
then
2021-02-17 01:18:57 +01:00
test -n "$SWAYSOCK" && swaymsg fullscreen off &> /dev/null
2020-11-03 06:15:23 +01:00
fi
2019-12-01 23:21:31 +01:00
2020-11-03 06:15:23 +01:00
if test "$1" = "run"
then
test -n "$2" && t="$2" || t="terminal"
2020-04-26 08:43:54 +02:00
exec j4-dmenu-desktop --dmenu="bmenu start -p Iniciar:" --term "$t"
2020-11-03 06:15:23 +01:00
fi
2019-12-01 23:21:31 +01:00
2020-04-24 23:17:08 +02:00
# t title
# f filter
# n normal
# h highlighted
# s selected
# sc scrollbar
2020-12-07 02:12:21 +01:00
fn="{{@@ font.mono @@}} {{@@ font.size.small @@}}"
2020-10-20 18:54:12 +02:00
2020-11-03 06:15:23 +01:00
tb="{{@@ color.bg @@}}"
tf="{{@@ accent_color @@}}"
2020-10-20 18:54:12 +02:00
2020-11-03 06:15:23 +01:00
fb="{{@@ color.bg @@}}"
ff="{{@@ color.txt @@}}"
2020-10-20 18:54:12 +02:00
2020-11-03 06:15:23 +01:00
nb="{{@@ color.bg @@}}"
nf="{{@@ color.txt @@}}"
2020-10-20 18:54:12 +02:00
2020-11-03 06:15:23 +01:00
hb="{{@@ color.bg_light @@}}"
hf="{{@@ accent_color @@}}"
2020-10-20 18:54:12 +02:00
#{%@@ if False @@%}#
# Hacks to allow runnning even if not templated
2020-11-03 06:15:23 +01:00
fn="Fira Code 12"
2020-10-20 18:54:12 +02:00
2020-11-03 06:15:23 +01:00
tf="#D9534F"
tb="#202020"
2020-10-20 18:54:12 +02:00
2020-11-03 06:15:23 +01:00
ff="#ffffff"
fb="#202020"
2020-10-20 18:54:12 +02:00
2020-11-03 06:15:23 +01:00
nf="#ffffff"
nb="#202020"
2020-10-20 18:54:12 +02:00
2020-11-03 06:15:23 +01:00
hf="#D9534F"
hb="#404040"
2020-10-20 18:54:12 +02:00
#{%@@ endif @@%}#
2019-12-01 23:21:31 +01:00
bemenu \
--ignorecase\
--bottom\
2020-04-24 23:17:08 +02:00
--no-overlap\
2019-12-01 23:21:31 +01:00
--list 20\
2020-12-07 02:12:21 +01:00
--prefix '>'\
2020-10-20 18:54:12 +02:00
--fn "$fn"\
--tb "$tb" --tf "$tf" \
--fb "$fb" --ff "$ff" \
--nb "$nb" --nf "$nf" \
--hb "$hb" --hf "$hf" \
2020-11-03 06:15:23 +01:00
$@