dmenu - ArchWiki

# dmenu

From ArchWiki
Jump to navigation Jump to search

Related articles

- List of applications/Other#Application launchers

dmenu is a fast and lightweight dynamic menu for X. It reads arbitrary text from stdin, and creates a menu with one item for each line. The user can then select an item, through the arrow keys or typing a part of the name, and the line is printed to stdout. dmenu_run is a wrapper that ships with the dmenu distribution that allows its use as an application launcher.

## Installation

Install the dmenu package, or dmenu-gitAUR for the development version.

Various patched variants exist which extend dmenu's default functionality. Consider installing one of the following packages from the AUR:

- dmenu2AUR: dmenu fork with many useful patches applied and additional capabilities added including dimming, specifying a custom opacity, and underlining.

You may run dmenu with:

    $ dmenu_run

## Configuration

Now, you will want to attach the `dmenu_run` command to a keystroke combination. This can be done either via your window manager or desktop environment configuration, or with a program like xbindkeys. See the Hotkeys article for more information.

### Displaying Custom Items

Custom items may be shown by piping them into dmenu. For example:

    $ echo -e "first\nsecond\nthird" | dmenu

### Manually Adding Items

dmenu will look for executables in the directories defined in your `$PATH`. For information on modifying your `$PATH` see environment variables.

### Fonts

This article or section is out of date.

Reason: Since dmenu 4.6 XFT font rendering is enabled by default: 4.6 Release Notes. Specifying fonts via X logical font description does not work anymore. Instead fontconfig's font.conf syntax is used. (Discuss in Talk:Dmenu#)

dmenu can display fonts using the X logical font description as found using the tool xfontsel, which is provided by xorg-xfontsel. This example will run dmenu using the terminus-font:

    $ dmenu_run -fn "-xos4-terminus-medium-r-*-*-14-*"

The syntax is similar if using a dmenu variant patched with XFT support.

    $ dmenu_run -fn 'Droid Sans Mono-9'

### Support for shell aliases

dmenu does not support shell aliases. To have dmenu recognize your aliases, install the dmenu-recent-aliasesAUR[broken link: archived in aur-mirror] package from the AUR and run `dmenu_run_aliases`. Your aliases must be in either `~/.bash_aliases` or `~/.zsh_aliases` to be recognized by dmenu_run_aliases.

## Troubleshooting

### No locale support

Running dmenu_run results in the following error message:

    $ dmenu_run

    no locale support

Make sure that the environment variable `LANG` is correctly set. See the following for more information: Locale#Troubleshooting

### Missing menu entries

If certain entries are missing from dmenu, the cache may be malformed. Delete it and restart dmenu.

    $ rm ~/.dmenu_cache
    $ rm ~/.cache/dmenu_run

Note that there will most likely be only one cache file, depending on if `$XDG_CACHE_HOME` is set. See the contents of `/usr/bin/dmenu_run` for more information.

### Environment Variables

Environment variables needed for applications should instead be added to `/etc/environment`.

### Current window loses focus

A bug in dmenu 4.9 causes the current window to lose focus when dmenu is opened and to not regain focus when it is closed. It can also happen that a newly launched program is does not gain focus. You can fix this by downgrading to dmenu 4.8. See this ticket for a discussion.

## See also

- dmenu – The official dmenu website
- Dmenu Hacking thread – Dmenu hacking thread in arch linux forums. An overview of scripts is provided in the dmenu_scripts collection.

Categories:

- Application launchers
- Suckless

Hidden categories:

- Pages or sections flagged with Template:Out of date
- Pages with broken package links