Run terminal applications from dmenu with their Xresources name

If you are using dmenu, you might want to run terminal applications from it. I’ve found an old post about a modified dmenu_run script in the Arch Linux Forums, in the Dmenu Hacking Thread: #45. It worked fine, but I’m using urxvt with .Xresources color definitions for some apps.

So I modded that script a bit to use the .Xresources name when it’s given. For that to work, you need to create list with the names of the apps in ~/.dmenu_term_apps, for example:

$cat ~/.dmenu_term_apps

htop
alsamixer
ranger -name ranger
mocp -name moc
newsbeuter -name newsbeuter
rtorrent -name rTorrent

If the -name <name> was given, the app will use its own Xresources settings, otherwise it will use the default settings.

You can find this modified script in my Scripts repo: dmenu_run