~kris/suckless

dmenu

ref: 39e0e33c9db0825c6f13bf0ff51d4911704f2394 dmenu/README.md -rw-r--r-- 3.7 KiB
39e0e33c — Kris Yotam Disable caseinsensitive patch to restore -i flag 7 months ago

#Kris's build of dmenu (flexipatch)

My build of dmenu, the dynamic menu for X.

This build is based on dmenu-flexipatch, which uses preprocessor directives to manage patches. This allows easy toggling of features without manual patching.


#How Patches Work (Preprocessor Directives)

Unlike traditional dmenu patching, this build uses C preprocessor directives to include/exclude patches at compile time. To enable or disable a patch, edit patches.h and set the value to 1 (enabled) or 0 (disabled):

#define CENTER_PATCH 1      /* enabled */
#define VI_MODE_PATCH 0     /* disabled */

Then rebuild:

sudo make clean install

All patch options are documented in patches.h.


#Features

Feature Description
Centered dmenu appears centered on screen (enabled by default)
Fuzzy matching Type non-consecutive portions to match
Highlight Matched characters are highlighted
Mouse support Click to select options
Password mode -P flag hides input with dots
Transparency Alpha support with compositor
Xresources Read colors from ~/.Xresources (pywal compatible)
Numbers Shows match count in top right
Border Visible border when centered

#Usage

# Run dmenu (centered by default)
dmenu_run

# Vertical list
echo -e "option1\noption2\noption3" | dmenu -l 5

# Password mode
echo -e "option1\noption2" | dmenu -P

# Reject non-matching input
echo -e "yes\nno" | dmenu -r

# With prompt
dmenu -l 5 -p "Select:" < options.txt

# Case-sensitive (default is insensitive)
dmenu -s

#Enabled Patches

Configured in patches.h:

Patch Description
alpha Transparency support
border Visible border around dmenu
caseinsensitive Case-insensitive by default
center Centered on screen
ctrl_v_to_paste Ctrl+V paste support
fuzzymatch Fuzzy matching
highlight Highlight matched characters
line_height Configurable line height
mouse_support Click to select
numbers Show match count
password Hide input with -P
rejectnomatch Reject non-matching input
xresources Read from Xresources

#Installation

git clone https://github.com/krisyotam/dmenu
cd dmenu
sudo make clean install

Requires a compositor (xcompmgr, picom, etc.) for transparency.


#Configuration

#Enabling/Disabling Patches

Edit patches.h to toggle patches:

#define FUZZYMATCH_PATCH 1   /* Enable fuzzy matching */
#define VI_MODE_PATCH 0      /* Disable vi mode */

#Customizing Settings

Edit config.def.h for:

  • Font settings
  • Colors
  • Default behavior (centered, etc.)
  • Border width

After editing, rebuild:

rm config.h && sudo make clean install

#Xresources

This build reads settings from ~/.Xresources. Example:

dmenu.font: JetBrainsMono Nerd Font:size=14
dmenu.background: #9CC2EC
dmenu.foreground: #2a4055
dmenu.selbackground: #DEC292
dmenu.selforeground: #2a4055

Apply with:

xrdb merge ~/.Xresources

#My Other Suckless Repos

  • dwm - dynamic window manager
  • st - simple terminal
  • dwmblocks - modular status bar
  • surf - simple web browser

#Credits


#Contact