I’m a big fan of tiling window managers. Today I use i3, which I happen to have configured to use dmenu, which is an efficient tool for searching across all your applications. I often find myself wanting to add custom applications to dmenu, say a custom script I’ve written, and I’d like to capture how that’s done.

Example Desktop File

Let’s say you want to add Postman to your dmenu. You’ll need to create a desktop file for it. Here’s an example of what that file might look like:

[Desktop Entry]
Encoding=UTF-8    
Name=Postman    
X-GNOME-FullName=Postman API Client    
Exec=/usr/bin/postman    
Icon=/opt/Postman/app/resources/app/assets/icon.png    
Terminal=false    
Type=Application    
Categories=Development;

You’ll need to save this file in ~/.local/share/applications/postman.desktop. This new file should automatically be discovered in dmenu by searching for “Postman”.

What Does $ dmenu_path Do?

The command $ dmenu_path is used to generate a list of executable programs in your PATH. When you use dmenu, it pulls up this list, allowing you to quickly launch applications. By adding your custom desktop file, you can ensure that your application appears in this list.

How To use dmenu with i3

You can add a keybinding in your i3 configuration file (usually ~/.config/i3/config) like this:

bindsym $mod+d exec --no-startup-id i3-dmenu-desktop

Which I do in my toolbox here. Now, when you press your designated mod key + d, dmenu will open with a list of your applications, including those specified in your custom desktop files.

Happy customizing!