The patch is failing because the other patches that you have previously applied have shifted the code around sufficiently to defeat patch's attempts to apply the change, even with an offset (as can be seen in those hunks that did succeed).
If you open dwm.c.rej
you will see the failed hunks, then it is just a matter of hand patching them in to dwm.c
.
For each failed hunk, search in dwm.c
for the original code (the lines that begin with a -
in dwm.c.rej
) and replace them with the patched code (those lines beginning with a +
). If dwm recompiles without error, you have successfully patched in transparency.
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
dwm is an acronym for dynamic window manager: the central principle of dwm is that the tags are supposed to be dynamic, not fixed. See why tags don't remember their layout. The pertag patch breaks this paradigm.
If you want to be able to have your window manager use static workspaces, you are better off using xmonad or awesome (both inspired by dwm).
However, if you really are intent on patching out dwm's core and defining feature, there are some patches floating about that will do this, like Jokerboy's remember tags patch, which should be used in conjunction with his pertag patch.