dmenu

Kris's build of dmenu
git clone git clone https://git.krisyotam.com/krisyotam/dmenu.git
Log | Files | Refs | README | LICENSE

README.md (3815B)


      1 # Kris's build of dmenu (flexipatch)
      2 
      3 My build of [dmenu](https://tools.suckless.org/dmenu/), the dynamic menu for X.
      4 
      5 This build is based on [dmenu-flexipatch](https://github.com/bakkeby/dmenu-flexipatch), which uses preprocessor directives to manage patches. This allows easy toggling of features without manual patching.
      6 
      7 ---
      8 
      9 ## How Patches Work (Preprocessor Directives)
     10 
     11 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):
     12 
     13 ```c
     14 #define CENTER_PATCH 1      /* enabled */
     15 #define VI_MODE_PATCH 0     /* disabled */
     16 ```
     17 
     18 Then rebuild:
     19 ```bash
     20 sudo make clean install
     21 ```
     22 
     23 All patch options are documented in `patches.h`.
     24 
     25 ---
     26 
     27 ## Features
     28 
     29 | Feature | Description |
     30 |---------|-------------|
     31 | **Centered** | dmenu appears centered on screen (enabled by default) |
     32 | **Fuzzy matching** | Type non-consecutive portions to match |
     33 | **Highlight** | Matched characters are highlighted |
     34 | **Mouse support** | Click to select options |
     35 | **Password mode** | `-P` flag hides input with dots |
     36 | **Transparency** | Alpha support with compositor |
     37 | **Xresources** | Read colors from `~/.Xresources` (pywal compatible) |
     38 | **Numbers** | Shows match count in top right |
     39 | **Border** | Visible border when centered |
     40 
     41 ---
     42 
     43 ## Usage
     44 
     45 ```bash
     46 # Run dmenu (centered by default)
     47 dmenu_run
     48 
     49 # Vertical list
     50 echo -e "option1\noption2\noption3" | dmenu -l 5
     51 
     52 # Password mode
     53 echo -e "option1\noption2" | dmenu -P
     54 
     55 # Reject non-matching input
     56 echo -e "yes\nno" | dmenu -r
     57 
     58 # With prompt
     59 dmenu -l 5 -p "Select:" < options.txt
     60 
     61 # Case-sensitive (default is insensitive)
     62 dmenu -s
     63 ```
     64 
     65 ---
     66 
     67 ## Enabled Patches
     68 
     69 Configured in `patches.h`:
     70 
     71 | Patch | Description |
     72 |-------|-------------|
     73 | alpha | Transparency support |
     74 | border | Visible border around dmenu |
     75 | caseinsensitive | Case-insensitive by default |
     76 | center | Centered on screen |
     77 | ctrl_v_to_paste | Ctrl+V paste support |
     78 | fuzzymatch | Fuzzy matching |
     79 | highlight | Highlight matched characters |
     80 | line_height | Configurable line height |
     81 | mouse_support | Click to select |
     82 | numbers | Show match count |
     83 | password | Hide input with -P |
     84 | rejectnomatch | Reject non-matching input |
     85 | xresources | Read from Xresources |
     86 
     87 ---
     88 
     89 ## Installation
     90 
     91 ```bash
     92 git clone https://github.com/krisyotam/dmenu
     93 cd dmenu
     94 sudo make clean install
     95 ```
     96 
     97 > Requires a compositor (`xcompmgr`, `picom`, etc.) for transparency.
     98 
     99 ---
    100 
    101 ## Configuration
    102 
    103 ### Enabling/Disabling Patches
    104 
    105 Edit `patches.h` to toggle patches:
    106 
    107 ```c
    108 #define FUZZYMATCH_PATCH 1   /* Enable fuzzy matching */
    109 #define VI_MODE_PATCH 0      /* Disable vi mode */
    110 ```
    111 
    112 ### Customizing Settings
    113 
    114 Edit `config.def.h` for:
    115 - Font settings
    116 - Colors
    117 - Default behavior (centered, etc.)
    118 - Border width
    119 
    120 After editing, rebuild:
    121 ```bash
    122 rm config.h && sudo make clean install
    123 ```
    124 
    125 ### Xresources
    126 
    127 This build reads settings from `~/.Xresources`. Example:
    128 
    129 ```
    130 dmenu.font: JetBrainsMono Nerd Font:size=14
    131 dmenu.background: #9CC2EC
    132 dmenu.foreground: #2a4055
    133 dmenu.selbackground: #DEC292
    134 dmenu.selforeground: #2a4055
    135 ```
    136 
    137 Apply with:
    138 ```bash
    139 xrdb merge ~/.Xresources
    140 ```
    141 
    142 ---
    143 
    144 ## My Other Suckless Repos
    145 
    146 - [dwm](https://github.com/krisyotam/dwm) - dynamic window manager
    147 - [st](https://github.com/krisyotam/st) - simple terminal
    148 - [dwmblocks](https://github.com/krisyotam/dwmblocks) - modular status bar
    149 - [surf](https://github.com/krisyotam/surf) - simple web browser
    150 
    151 ---
    152 
    153 ## Credits
    154 
    155 - Based on [dmenu-flexipatch](https://github.com/bakkeby/dmenu-flexipatch) by bakkeby
    156 - [suckless.org](https://tools.suckless.org/dmenu/) for the original dmenu
    157 
    158 ---
    159 
    160 ## Contact
    161 
    162 - Kris Yotam <krisyotam@protonmail.com>
    163 - [https://krisyotam.com](https://krisyotam.com)