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
dwm isn't designed to save the state of your session; that is typically something that a more full-bloatedblown desktop environment would do.
Instead, you can write rules in your config.h
for applications that you would like to start with consistent tags.
To use the examples you mention, a browser and a terminal:
static const Rule rules[] = {
/* class instance title tags mask isfloating monitor */
{ "Vimprobable", NULL, NULL, 1 << 1, False, -1 },
{ "urxvtc", NULL, NULL, 0 << 1, False, -1 },
...
This will start a browser in tag 2, and a terminal in tag 1.
You could also add keybinds to simplify launching these applications:
/* commands */
static const char *newtermcmd[] = { "urxvtc", "-title", "newterm", NULL };
static const char *browsercmd[] = { "vimprobable", "%s", NULL };
...
static Key keys[] = {
/* modifier key function argument */
{ 0, XK_Menu, spawn, {.v = dmenucmd } },
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = newtermcmd } },
{ ControlMask|Mod1Mask, XK_b, spawn, {.v = browsercmd } },
...
When you start dwm, you can then hit your keybinds and have those applications assigned their respective tags. If you wanted to further develop on this concept, you could write a shell script that opened all of the applications that you require and bind that to a key sequence:
#!/usr/bin/env sh
# autostart apps
tabbed -d >/tmp/tabbed.xid; vimprobable2 -e $(</tmp/tabbed.xid) &
urxvtc -title "mutt" -e mutt &
$HOME/bin/shux &
As long as there are rules for each of the individual applications, they will be assigned the correct tags; you just assign a key sequence for the shell script:
{ ControlMask|Mod1Mask, XK_a, spawn, SHCMD("$HOME/bin/autostart") },
Best Answer
You can configure hotkeys in your
config.h
. To use youreclipse
example (with a rule to have it open in a specific tag1 when you hit Ctrle:The window will not grab the input, irrespective of where the focus is.
1. Ignore the rule if you don't want to assign
eclipse
to the first tag...