9

I'm running dwm with dmenu under Arch Linux. While dmenu is working, it doesn't start some programs, e.g., emacs, although it shows the command with auto-completion. When I start them in the terminal, it works fine.

What can I do? Is there an error log file for dmenu?

Michael Mrozek
  • 91,316
  • 38
  • 238
  • 232
Michael
  • 243
  • 3
  • 8

1 Answers1

12

dmenu doesn't have built in logging, but it is a very simple program and it is not difficult to have it log it's output to a file.

First, determine where pacman has placed the dmenu files with pacman -Ql dmenu. You should get:

dmenu /usr/
dmenu /usr/bin/
dmenu /usr/bin/dmenu
dmenu /usr/bin/dmenu_path
dmenu /usr/bin/dmenu_run
...

You can then open /usr/bin/dmenu_run, which is just a shell script, and add a temporary hack to write all output to a file, like so:

dmenu_path | dmenu "$@" | ${SHELL:-"/bin/sh"} &>/home/michael/dmenu_log

Selecting emacs from dmenu will now fail, but you will get the output in your log file:

]P0000000]P85e5e5e]P18a2f58]P9cf4f88]P2287373]PA53a6a6]P3914e89]PBbf85cc]P4395573]PC4779b3]P55e468c]PD7f62b3]P62b7694]PE47959e]P7899ca1]PFc0c0c0[H[JVim: Warning: Output is not to a terminal
Vim: Warning: Input is not from a terminal
...and a lot more

which makes the error pretty clear when you remove all the escapes. To have Emacs work, you'd have to assign a terminal as well from dmenu, something along the lines of: urxvt -e emacs yourfile.txt.

There is a long dmenu hacking thread on the Arch boards which has all manner of interesting hacks for dmenu, it is well worth checking out.

1. I don't have Emacs installed, but you'll get the same error...

jasonwryan
  • 71,734
  • 34
  • 193
  • 226
  • Thank you very much! Worked fine, problem was just a missing system font. I have another, but very similar problem with DWM+urxvt, maybe you know help: http://unix.stackexchange.com/questions/146732/terminal-does-not-open-under-dwm-is-there-an-error-log-file – Michael Jul 26 '14 at 16:18