Skip to content

MGSousa/dmenu-configs

Repository files navigation

dmenu-configs

What is dmenu?

dmenu is a dynamic menu for X, originally designed for dwm, now working for major of Window/Tiling Managers out there. It manages large numbers of user-defined menu items efficiently. It is a very powerful tool that allows you to pipe information into it. This makes dmenu a perfect utility to incorporate into your scripting.

What is dmenu-flexipatch?

Similar to dwm-flexipatch, the dmenu-flexipatch project has a unique take on patching. It uses preprocessor directives to decide whether or not to include a patch during build time. Patching with dmenu-flexipatch is much easier than the traditional patching methods, especially when using many patches (which I do!).

Patches can be added/removed using the patches.def.h file. For example to include the `alpha` patch then you would only need to flip this setting from 0 to 1:

#define ALPHA_PATCH 1

After you have decided on the patches that work for you, then run: sudo make install

The patches that I used were:

  • dmenu-alpha – adds transparency as an option.
  • dmenu-border – adds border around dmenu window
  • dmenu-center – centers dmenu in the middle of screen (-c)
  • dmenu-fuzzyhighlight – fuzzy matches gets highlighted
  • dmenu-fuzzymatch – adds support for fuzzy-matching
  • dmenu-grid – adds a flag (-g) to specify the number of grid columns
  • dmenu-lineheight – adds a flag (-h) to set the minimum height of dmenu lines
  • dmenu-morecolor – creates a color option for use the entries adjacent to the selection
  • dmenu-mousesupport – basic mouse support
  • dmenu-numbers – Displays number of matched and total items in top right corner
  • dmenu-xyw – Allows setting X/Y coordinates as well as W (width).
  • dmenu-password – Enables custom input as Password.

Due to the tedious nature of applying so many patches, I now use dmenu-flexipatch. After all, no need to reinvent the wheel!

Mouse functionality

Mouse actions supported:

  • Left-mouse click:
    • On prompt and input field: clear input text and selection.
    • In horizontal and vertical mode on item: select and output item (same as pressing enter).
    • In horizontal mode on arrows: change items to show left or right.
  • Ctrl-left-mouse click: multisel modifier.
  • Right-mouse click: close.
  • Middle-mouse click:
    • Paste current selection.
    • While holding shift: paste primary selection.
  • Scroll up:
    • In horizontal mode: same as left-clicking on left arrow.
    • In vertical mode: show items above.
  • Scroll down:
    • In horizontal mode: same as left-clicking on right arrow.
    • In vertical mode: show items below.

Available flags

  • [-bw borderwidth]
  • [-c] for centering
  • [-P for hidden input]
  • [-Pcb for hidden clipboard injection]
  • [-fn font]
  • [-g columns]
  • [-l lines]
  • [-m monitor]
  • [-nb color]
  • [-nf color]
  • [-nhb color]
  • [-nhf color]
  • [-p prompt]
  • [-sb color]
  • [-sf color]
  • [-shb color]
  • [-shf color]
  • [-w windowid]
  • [-X xoffset]
  • [-Y yoffset]
  • [-W width]

An example: ls | dmenu -c -bw 2 -l 20 -g 2

This launches default dmenu with -c (centered), -bw (border width), -l (number of vertical lines) and -g (number of grid columns).

Installing on Arch Linux

All you need to do is to download the PKGBUILD from this repository. Then run the following command:

makepkg -cf= && sudo pacman -U *.pkg.tar.zst=

Installing on other Linux distro’s

git clone https://github.com/MGSousa/dmenu-configs && cd dmenu-configs
sudo make clean install