Difference between revisions of "Dmenu"

From ArchWiki
Jump to: navigation, search
(added i18n)
(27 intermediate revisions by 16 users not shown)
Line 1: Line 1:
[[Category:Utilities (English)]]
+
[[Category:Application launchers]]
[[Category:HOWTOs (English)]]
+
[[es:Dmenu]]
 +
[[zh-CN:Dmenu]]
 +
{{DISPLAYTITLE:dmenu}}
  
{{i18n_links_start}}
+
== Introduction ==
{{i18n_entry|English|Dmenu}}
+
{{i18n_entry|Español|Dmenu (Español)}}
+
{{i18n_entry|简体中文|Dmenu (简体中文)}}
+
{{i18n_links_end}}
+
  
= Introduction =
+
[http://tools.suckless.org/dmenu 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.
  
dmenu is a fast and lightweight dynamic menu launcher for X.  It can be compared to 'Quicksilver' on OS X, or 'Launchy' on Windows.  With a quick keystroke, the dmenu menu appears, enabling you to type the name of a program you wish to start.
+
== Installation ==
 
+
= Installation =
+
  
 
Installing dmenu is simple:
 
Installing dmenu is simple:
  pacman -S dmenu
+
  # pacman -S dmenu
 +
 
 +
run it
 +
$ dmenu_run
 +
 
 +
== Configuration ==
 +
Now, you will want to attach the {{Ic|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 {{Pkg|xbindkeys}}. See the [[Hotkeys]] article for more information.
 +
And so, dmenu nice to be [[Prelink]]'ed.
 +
 
 +
== Strange segfaulting ==
 +
 
 +
If executing {{Ic|dmenu_run}} results in an error similar to this:
 +
$ dmenu_run
 +
/usr/bin/dmenu_run: line 15: 1879 Segmentation fault          dmenu "$@" < "$cache"
 +
 
 +
And running dmenu crashes like the following:
 +
$ echo "blahblahblah" | dmenu
 +
no locale support
 +
Segmentation fault
  
Once it is installed, you will need to create a shell script to run it. The following script presents some common defaults:
+
Make sure {{Ic|$LANG}} is set to something valid. For example, I was experiencing this problem because I had set {{Ic|$LANG}} to "en_US.UTF_8" in /etc/locale.conf. In my case it should have been "en_US.UTF-8".
#!/bin/sh
+
$(dmenu_path | \
+
dmenu -fn '-*-terminus-*-r-normal-*-*-120-*-*-*-*-iso8859-*' \
+
-nb '#000000' -nf '#FFFFFF' -sb '#0066ff')
+
  
Save the script somewhere (~/bin is a good choice) and make it executable.
+
Keep in mind that the value contained in {{Ic|$LANG}} must be uncommented in /etc/locale.gen and generated via {{Ic|locale-gen}} as well.
  
= Configuration =
+
== More font support ==
Now, you will need to attach that shell script to a keystroke combination. This can be done either via your window manager or desktop environment configuration, or with a program like xbindkeysSee the [[Hotkeys]] article for more information.
+
dmenu can be patched to allow using more fonts which don't seem to be working with the version from mainstream. The patched version can be found on [https://bbs.archlinux.org/viewtopic.php?pid=1135475 AUR]. Using this version, fonts like Droid Sans mono can be set.
 +
  $ dmenu_run -fn 'Droid Sans Mono-9'
  
= Additional Resources =
+
== External Resources ==
* [http://www.suckless.org/programs/dmenu.html Dmenu] - The official dmenu website
+
* [http://tools.suckless.org/dmenu dmenu] &ndash; The official dmenu website
 +
* [http://dmwit.com/yeganesh Yeganesh] &ndash; a light wrapper that reorders commands based on popularity
 +
* [https://aur.archlinux.org/packages.php?ID=33379 dmenu-launch (AUR)] &ndash; A simple Dmenu-based application launcher. Launches binaries and XDG shortcuts.
 +
* [https://bbs.archlinux.org/viewtopic.php?id=80145 Dmenu Hacking thread ] &ndash; Dmenu hacking thread in arch linux forums.

Revision as of 22:23, 6 November 2012


Introduction

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

Installing dmenu is simple:

# pacman -S dmenu

run it

$ 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. And so, dmenu nice to be Prelink'ed.

Strange segfaulting

If executing dmenu_run results in an error similar to this:

$ dmenu_run
/usr/bin/dmenu_run: line 15: 1879 Segmentation fault           dmenu "$@" < "$cache"

And running dmenu crashes like the following:

$ echo "blahblahblah" | dmenu
no locale support
Segmentation fault

Make sure $LANG is set to something valid. For example, I was experiencing this problem because I had set $LANG to "en_US.UTF_8" in /etc/locale.conf. In my case it should have been "en_US.UTF-8".

Keep in mind that the value contained in $LANG must be uncommented in /etc/locale.gen and generated via locale-gen as well.

More font support

dmenu can be patched to allow using more fonts which don't seem to be working with the version from mainstream. The patched version can be found on AUR. Using this version, fonts like Droid Sans mono can be set.

$ dmenu_run -fn 'Droid Sans Mono-9'

External Resources

  • dmenu – The official dmenu website
  • Yeganesh – a light wrapper that reorders commands based on popularity
  • dmenu-launch (AUR) – A simple Dmenu-based application launcher. Launches binaries and XDG shortcuts.
  • Dmenu Hacking thread – Dmenu hacking thread in arch linux forums.