nix-config/home/desktop-sway/bemenu.nix

102 lines
4.7 KiB
Nix
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{ config, pkgs, ... }:
# usage: bemenu [options]
# Options
# -h, --help display this help and exit.
# -v, --version display version.
# -i, --ignorecase match items case insensitively.
# -F, --filter filter entries for a given string.
# -w, --wrap wraps cursor selection.
# -l, --list list items vertically with the given number of lines.
# -p, --prompt defines the prompt text to be displayed.
# -P, --prefix text to show before highlighted item.
# -I, --index select item at index automatically.
# -x, --password hide input.
# -s, --no-spacing disable the title spacing on entries.
# --scrollbar display scrollbar. (none (default), always, autohide)
# --ifne only display menu if there are items.
# --fork always fork. (bemenu-run)
# --no-exec do not execute command. (bemenu-run)
#
# Use BEMENU_BACKEND env variable to force backend:
# curses ncurses based terminal backend
# wayland wayland backend
# x11 x11 backend
#
# If BEMENU_BACKEND is empty, one of the GUI backends is selected automatically.
#
# Backend specific options
# c = ncurses, w == wayland, x == x11
# (...) At end of help indicates the backend support for option.
#
# -b, --bottom appears at the bottom of the screen. (wx)
# -c, --center appears at the center of the screen. (wx)
# -f, --grab show the menu before reading stdin. (wx)
# -n, --no-overlap adjust geometry to not overlap with panels. (w)
# -m, --monitor index of monitor where menu will appear. (wx)
# -H, --line-height defines the height to make each menu line (0 = default height). (wx)
# -M, --margin defines the empty space on either side of the menu. (wx)
# -W, --width-factor defines the relative width factor of the menu (from 0 to 1). (wx)
# -B, --border defines the width of the border in pixels around the menu. (wx)
# --ch defines the height of the cursor (0 = scales with line height). (wx)
# --cw defines the width of the cursor. (wx)
# --hp defines the horizontal padding for the entries in single line mode. (wx)
# --fn defines the font to be used ('name [size]'). (wx)
# --tb defines the title background color. (wx)
# --tf defines the title foreground color. (wx)
# --fb defines the filter background color. (wx)
# --ff defines the filter foreground color. (wx)
# --nb defines the normal background color. (wx)
# --nf defines the normal foreground color. (wx)
# --hb defines the highlighted background color. (wx)
# --hf defines the highlighted foreground color. (wx)
# --fbb defines the feedback background color. (wx)
# --fbf defines the feedback foreground color. (wx)
# --sb defines the selected background color. (wx)
# --sf defines the selected foreground color. (wx)
# --ab defines the alternating background color. (wx)
# --af defines the alternating foreground color. (wx)
# --scb defines the scrollbar background color. (wx)
# --scf defines the scrollbar foreground color. (wx)
# --bdr defines the border color. (wx)
let
bemenuColors = {
titleBackground = "#282828E0";
titleForeground = "#fbf1c7";
filterBackground = "#282828E0";
filterForeground = "#ebdbb2";
normalBackground = "#282828E0";
normalForeground = "#ebdbb2";
highlightedBackground = "#458588E0";
highlightedForeground = "#fbf1c7";
scrollbarBackground = "#282828E0";
scrollbarForeground = "#458588E0";
};
in {
home.packages = [ pkgs.bemenu ];
home.sessionVariables.BEMENU_OPTS = ''
--ignorecase \
--list 20 \
--prompt '' \
--scrollbar none \
--wrap \
--scrollbar autohide \
--no-overlap \
--monitor all \
--fn 'Inter 13px' \
--tb '${bemenuColors.titleBackground}' \
--tf '${bemenuColors.titleForeground}' \
--fb '${bemenuColors.filterBackground}' \
--ff '${bemenuColors.filterForeground}' \
--nb '${bemenuColors.normalBackground}' \
--ab '${bemenuColors.normalBackground}' \
--nf '${bemenuColors.normalForeground}' \
--af '${bemenuColors.normalForeground}' \
--hb '${bemenuColors.highlightedBackground}' \
--hf '${bemenuColors.highlightedForeground}' \
--scb '${bemenuColors.scrollbarBackground}' \
--scf '${bemenuColors.scrollbarForeground}'
'';
}