I've just got dwm configured to my liking in terms of colors and tags. I'm just looking for one more thing: the ability to have certain applications automatically start with dwm on certain tags.

For example, I have a irc tag, I would like irssi to be run in that tag when I start my machine up. Is this possible? What would it look like in config.h?


dwm is a minimalist window manager that just manages windows. What you are asking requires a bit of a workaround. There are two separate, but related steps.

First, set up your rules for irrsi in config.h - specifying the tag in which you would like it to appear and whether it should be floating or not. Something like this will open irssi in the first tag:

{ NULL, NULL, "irssi",       1 << 0,       False,       -1 },

(explanation of what 1 << 0 means)

If you would like to specify the layout of this tag when dwm opens, you would need to apply the pertag patch and recompile.

The second step is to start the application when you login to X. If you are not using a login manager, you could add an entry to your ~/.xinitrc - something like:

(sleep 5 && xterm -title "irssi" -e irssi ) &

The sleep is to allow X to start and dwm to load: 5 is ample, you can experiment how little you need...

If you are using a login manager, you will have a .desktop file that you can put the commands in.

I prefer a simpler approach using rules and keybinds. So once dwm is open, I just hit, for example, CtrlAltm and mutt opens in tag 3.

You can see my config.h to get a better idea of how this works: https://bitbucket.org/jasonwryan/dwm-patchset/src/tip/base.config.customizations

| improve this answer | |
  • I remember seeing a pic of a desktop you had ing dwm/tmux. It was really nice (this was a couple months back, I think I emailed you about it). Small world :) Thanks for the link to your dotfile, I'll take a look. – n0pe Aug 14 '11 at 2:20
  • No problem: have fun with dwm. – jasonwryan Aug 14 '11 at 2:23
  • Are you sure it’s .desktop and not .xprofile? – Devon Jul 30 '19 at 11:13

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.