dotfiles/scripts/menu/menu
2023-08-03 20:30:35 -06:00

71 lines
1.2 KiB
Bash
Executable file

#!/bin/sh
# Script for using either bemenu or dmenu
# with preconfigured options
# Simple configuration
MENU="dmenu"
col_main="#83a598"
col_second="#121212"
# If given 'pass' as arg,
# format accordingly
PROMPT="$1"
MODE="$2"
[ "$MODE" = "pass" ] &&
BPASS="-x" &&
DPASS="-P"
# bemenu opts
BEMENU_OPTS=" \
-c \
-i \
-l 10 \
-M 5 \
-W 0.3 \
-B 2 \
--cw 2 \
--tb $col_main \
--tf $col_second \
--nb $col_second \
--nf $col_main \
--hb $col_main \
--hf $col_second \
--ab $col_second \
--af $col_main \
--bdr $col_main \
-p $PROMPT \
$BPASS \
"
# If chosen bemenu, use this args
[ "$MENU" = "bemenu" ] &&
OPTS="$BEMENU_OPTS" &&
RUN="-run"
# dmenu opts
DMENU_OPTS=" \
-i \
-l 10 \
-p $PROMPT \
$DPASS \
"
# DMENU_OPTS=" \
# -i \
# -l 10 \
# -nb $col_second \
# -nf $col_main \
# -sb $col_main \
# -sf $col_second \
# -p $PROMPT \
# $DPASS \
# "
# If chosen dmenu, use this args
[ "$MENU" = "dmenu" ] &&
OPTS="$DMENU_OPTS" &&
RUN="_run"
[ "$MODE" = "run" ] && $MENU$RUN $OPTS
[ "$MODE" = "pass" ] && < /dev/null | $MENU $OPTS
[ "$MODE" = "empty" ] && < /dev/null | $MENU $OPTS
[ -z "$MODE" ] && $MENU $OPTS