I just start to use xmonad window manager. It is wonderful. I tried to modify some configurations to get it work more suitable for me.

My question is:

  1. How to make a keyboard shortcut for commonly used apps? For example, I'd like to bind Chrome to mod-b.

  2. How to change the dmenu font? I tried to add options to the exec part:

    dmenu_run -fn "-xos4-terminus-medium-r-*-*-14-*"
    dmenu_run -fn 'Droid Sans Mono-14'

but it doesn't work.


Question 1 solved by:

In the section myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $


-- launch Chrome browser
, ((modm, xK_b), spawn "exe=`google-chrome`")

Edit 2:

Question 2 solved by https://askubuntu.com/questions/326907/custom-font-with-dmenu

  • Do you have this fonts installed in your system? Also, for Droid font you need package dmenu-xft.
    – kirill-a
    Dec 17 '14 at 15:30
  • @kirill-a Thank you! Yes. I have both fonts installed. Where could I find the dmenu-xft?
    – Nick
    Dec 17 '14 at 15:43

You must use the X Logical Font Description ("XLFD") full name for the font provided by xfontsel. The output should look something like this:


which you must use in the config file:

dmenu -fn '-sazanami-mincho-*-*-*-*-*-*-*-*-*-*-*-*'

xfontsel allows you to preview the different settings.

To use non-bitmap fonts, you need to patch and recompile dmenu (see link for help) or just download already patched version. Then you'll be able to use fonts like droid-sans.

  • I downloaded the patched version, did a make clean install. When I run dmenu_run -fn 'DejaVu Sans Mono 14' from shell, it said: cannot load font 'DejaVu Sans Mono 14' I did have DejaVu Sans Mono font installed. May I ask what's wront?
    – Nick
    Dec 19 '14 at 0:59
  • It seems the patched version doesn't work. I patched it again and build it with the help from http://askubuntu.com/questions/326907/custom-font-with-dmenu Finally it works. Thank you.
    – Nick
    Dec 19 '14 at 1:13
  • Added your link to my answer.
    – kirill-a
    Dec 19 '14 at 14:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.