You are not logged in.

#476 2011-12-23 04:36:00

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: DWM Hackers Unite! Share (or request) dwm patches.

I've been trying to get statuscolors to work with 6.0 - I can apply it without any of the hunks failing (and by hand patching, obviously), but it completely munts the bar.

I've diff'ed dwm.c between 5.9 and 6.0 and I can't see where the relevant changes that impact on the bar are. Has anyone successfully patched in statuscolors, or would be willing to point me at the parts of the source I need to look at?

Last edited by jasonwryan (2011-12-23 04:36:26)


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#477 2011-12-23 14:26:52

kaptenen
Member
Registered: 2009-12-06
Posts: 287
Website

Re: DWM Hackers Unite! Share (or request) dwm patches.

jasonwryan wrote:

I've been trying to get statuscolors to work with 6.0 - I can apply it without any of the hunks failing (and by hand patching, obviously), but it completely munts the bar.

I've diff'ed dwm.c between 5.9 and 6.0 and I can't see where the relevant changes that impact on the bar are. Has anyone successfully patched in statuscolors, or would be willing to point me at the parts of the source I need to look at?

I´m using fancycoloredbarclickable but then you also get the fancybar.

Offline

#478 2011-12-23 14:32:39

guelfi
Member
From: /home/guelfi
Registered: 2011-07-01
Posts: 111

Re: DWM Hackers Unite! Share (or request) dwm patches.

I don't know if someone already made this patch (didn't read the complete
thread so far), but I used xmonad for a long time, and xmonad switches monitors
with "absolute addressing" (e.g. Mod-w switches to the first monitor),
while dwm uses "relative addressing". So I just created a patch containing 2
functions which emulate the behaviour of xmonad (I hope it's not too big to be
posted on a forum):

diff -up vanilla/config.def.h monabs/config.def.h
--- vanilla/config.def.h	2011-12-19 16:02:46.000000000 +0100
+++ monabs/config.def.h	2011-12-23 15:08:10.708661624 +0100
@@ -70,10 +70,10 @@ static Key keys[] = {
 	{ MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },
 	{ MODKEY,                       XK_0,      view,           {.ui = ~0 } },
 	{ MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
-	{ MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },
-	{ MODKEY,                       XK_period, focusmon,       {.i = +1 } },
-	{ MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
-	{ MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
+	{ MODKEY,                       XK_comma,  focusmonabs,    {.ui = 0 } },
+	{ MODKEY,                       XK_period, focusmonabs,    {.ui = 1 } },
+	{ MODKEY|ShiftMask,             XK_comma,  tagmonabs,      {.ui = 0 } },
+	{ MODKEY|ShiftMask,             XK_period, tagmonabs,      {.ui = 1 } },
 	TAGKEYS(                        XK_1,                      0)
 	TAGKEYS(                        XK_2,                      1)
 	TAGKEYS(                        XK_3,                      2)
diff -up vanilla/dwm.c monabs/dwm.c
--- vanilla/dwm.c	2011-12-19 16:02:46.000000000 +0100
+++ monabs/dwm.c	2011-12-23 15:11:27.038666205 +0100
@@ -185,6 +185,7 @@ static void expose(XEvent *e);
 static void focus(Client *c);
 static void focusin(XEvent *e);
 static void focusmon(const Arg *arg);
+static void focusmonabs(const Arg *arg);
 static void focusstack(const Arg *arg);
 static unsigned long getcolor(const char *colstr);
 static Bool getrootptr(int *x, int *y);
@@ -226,6 +227,7 @@ static void sigchld(int unused);
 static void spawn(const Arg *arg);
 static void tag(const Arg *arg);
 static void tagmon(const Arg *arg);
+static void tagmonabs(const Arg *arg);
 static int textnw(const char *text, unsigned int len);
 static void tile(Monitor *);
 static void togglebar(const Arg *arg);
@@ -886,6 +888,20 @@ focusmon(const Arg *arg) {
 }
 
 void
+focusmonabs(const Arg *arg) {
+	Monitor *m;
+	unsigned int i;
+
+	if (!mons->next)
+		return;
+	for (m = mons, i = 0; m->next && i < arg->ui; ++i)
+		m = m->next;
+	unfocus(selmon->sel, True);
+	selmon = m;
+	focus(NULL);
+}
+
+void
 focusstack(const Arg *arg) {
 	Client *c = NULL, *i;
 
@@ -1690,6 +1706,18 @@ tagmon(const Arg *arg) {
 	sendmon(selmon->sel, dirtomon(arg->i));
 }
 
+void
+tagmonabs(const Arg *arg) {
+	Monitor *m;
+	unsigned int i;
+
+	if(!selmon->sel || !mons->next)
+		return;
+	for (m = mons, i = 0; m->next && i < arg->ui; ++i)
+		m = m->next;
+	sendmon(selmon->sel, m);
+}
+
 int
 textnw(const char *text, unsigned int len) {
 	XRectangle r;

I know that it would be more elegant to put it in a seperate file that can be
included in your config.h, but this doesn't work well with pertag and I know
pertag is very popular (I use it, too).

Offline

#479 2011-12-23 18:13:55

JokerBoy
Member
From: România
Registered: 2009-09-24
Posts: 641

Re: DWM Hackers Unite! Share (or request) dwm patches.

kaptenen wrote:

JokerBoy, do you know why I see one border on my second monitor when i´m using monocle_no_borders.diff?

Try this one please:

http://hg.punctweb.ro/dwm/raw/3b92d379c … rders.diff

Offline

#480 2011-12-23 19:42:44

kaptenen
Member
Registered: 2009-12-06
Posts: 287
Website

Re: DWM Hackers Unite! Share (or request) dwm patches.

JokerBoy wrote:
kaptenen wrote:

JokerBoy, do you know why I see one border on my second monitor when i´m using monocle_no_borders.diff?

Try this one please:

http://hg.punctweb.ro/dwm/raw/3b92d379c … rders.diff

Thanks. smile

Offline

#481 2011-12-24 11:07:00

JokerBoy
Member
From: România
Registered: 2009-09-24
Posts: 641

Re: DWM Hackers Unite! Share (or request) dwm patches.

I'm waiting for some feedback..

Offline

#482 2011-12-25 15:23:37

kaptenen
Member
Registered: 2009-12-06
Posts: 287
Website

Re: DWM Hackers Unite! Share (or request) dwm patches.

The patch was working just fine, I did find something similar before but that one didn´t work, maybe I was just tired.

Offline

#483 2011-12-26 10:24:46

Ypnose
Member
From: Jailed in the shell
Registered: 2011-04-21
Posts: 353
Website

Re: DWM Hackers Unite! Share (or request) dwm patches.

With this version, I look forward to see Jokerboy patches and statuscolor/uselessgap.


Github -- My terminal font Envypn

Offline

#484 2011-12-26 10:36:46

inch
Member
Registered: 2010-12-21
Posts: 49

Re: DWM Hackers Unite! Share (or request) dwm patches.

Can I wish for a working statuscolor + pango script?

Offline

#485 2011-12-26 15:07:23

JokerBoy
Member
From: România
Registered: 2009-09-24
Posts: 641

Re: DWM Hackers Unite! Share (or request) dwm patches.

jasonwryan wrote:

I've been trying to get statuscolors to work with 6.0 - I can apply it without any of the hunks failing (and by hand patching, obviously), but it completely munts the bar.

I've diff'ed dwm.c between 5.9 and 6.0 and I can't see where the relevant changes that impact on the bar are. Has anyone successfully patched in statuscolors, or would be willing to point me at the parts of the source I need to look at?

You should try using "#define MAXCOLORS 9".

With this patch seems to work fine on my setup. Since dzen2 fails to build, I'm thinking to switch to statuscolors too..

Ypnose wrote:

With this version, I look forward to see Jokerboy patches and statuscolor/uselessgap.

Now I'm using statuscolors+urgentborder too, but I'm not going to use gaps patch again.. I prefer using 2px border now.

Last edited by JokerBoy (2011-12-26 19:28:47)

Offline

#486 2011-12-26 20:57:01

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: DWM Hackers Unite! Share (or request) dwm patches.

JokerBoy wrote:
jasonwryan wrote:

I've been trying to get statuscolors to work with 6.0 - I can apply it without any of the hunks failing (and by hand patching, obviously), but it completely munts the bar.

You should try using "#define MAXCOLORS 9".

<headdesk />

Thanks Jokerboy tongue


# edit: updated with the patch (the right way around this time...) http://beta.intuxication.org/jasonwryan … s-6.0.diff

Last edited by jasonwryan (2011-12-26 22:06:34)


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#487 2011-12-27 12:11:57

ivoarch
Member
Registered: 2011-03-31
Posts: 436

Re: DWM Hackers Unite! Share (or request) dwm patches.

Guys i have problem whit pertag2 on dwm-6.0
here is the output

dwm build options:
CFLAGS   = -std=c99 -pedantic -Wall -Os -I. -I/usr/include -I/usr/X11R6/include -DVERSION="6.0" -DXINERAMA
LDFLAGS  = -s -L/usr/lib -lc -L/usr/X11R6/lib -lX11 -L/usr/X11R6/lib -lXinerama
CC       = cc
CC dwm.c
In file included from dwm.c:318:0:
config.h:77:18: error: conflicting types for ‘tags’
config.h:33:20: note: previous definition of ‘tags’ was here
config.h:33:20: warning: ‘tags’ defined but not used [-Wunused-variable]
make: *** [dwm.o] Error 1
 

 

and my config.h

/* See LICENSE file for copyright and license details. */

/* appearance */
static const char font[]            = "-*-terminus-medium-r-*-*-14-*-*-*-*-*-*-*";
static const char normbordercolor[] = "#444444";
static const char normbgcolor[]     = "#222222";
static const char normfgcolor[]     = "#bbbbbb";
static const char selbordercolor[]  = "#005577";
static const char selbgcolor[]      = "#005577";
static const char selfgcolor[]      = "#eeeeee"; 
static const char* colors[NumColors][ColLast] = {
	// border          foreground   background
	{ normbordercolor, normfgcolor, normbgcolor },  // normal
	{ selbordercolor,  selfgcolor,  selbgcolor  },  // selected

	{ normbordercolor, selbgcolor,  selfgcolor  },  // warning
	{ normbordercolor, "#ffffff",   "#ff0000"   },  // error
	{ normbordercolor, "#7598b2",   normbgcolor },  // delim

        { normbordercolor, "#b10000",   normbgcolor },  // hot
	{ normbordercolor, "#b15c00",   normbgcolor },  // medium
	{ normbordercolor, "#6cb100",   normbgcolor },  // cool
};
static const unsigned int borderpx  = 1;          /* border pixel of windows */
static const unsigned int snap      = 32;        /* snap pixel */ 
static const unsigned int gappx     = 0;        /* gap pixel between windows */
static const Bool showbar           = True;    /* False means no bar */
static const Bool topbar            = True;   /* False means bottom bar */ 
static Bool useicons                = True;  /* False means use ascii symbols */ 
static const int marginbottom       = 18;   /* Bottom padding for conky */ 

/* tagging */
static const char *tags[] = { "null", "web", "misc", "code", "media", "gimp" };
 
/* tag definitions for rules */
#define WEB   1 << 1
#define MISC  1 << 2 
#define CODE  1 << 3 
#define MEDIA 1 << 4 
#define GIMP  1 << 5

/* rules */
static const Rule rules[] = {
/* class               instance       title       tags     isfloating  monitor */
{ "Chromium",            NULL,        NULL,       WEB,      False,      -1 }, 
{ "surf",                NULL,        NULL,       WEB,      False,      -1 },
{ "Gimp",                NULL,        NULL,       GIMP,     False,      -1 }, 
{ "Tabbed",              NULL,        NULL,       WEB,      False,      -1 }, 
{ "Skype",               NULL,        NULL,       MISC,     False,      -1 }, 
{ "Gvim",                NULL,        NULL,       CODE,     False,      -1 },       
{ "Deadbeef",            NULL,        NULL,       MEDIA,    False,      -1 }, 
{ "Xfburn",              NULL,        NULL,       MEDIA,    False,      -1 },     
{ "Vlc",                 NULL,        NULL,       MEDIA,    False,      -1 }, 
};

/* layout(s) */
static const float mfact      = 0.55; /* factor of master area size [0.05..0.95] */
static const int nmaster      = 1;    /* number of clients in master area */
static const Bool resizehints = False; /* True means respect size hints in tiled resizals */
 
/* PATHS */  
#define HOME "/home/ivo" 
#define ICONS HOME"/dwm/icons" 
static const Layout layouts[] = {
	/* symbol     arrange function */  
{ ICONS"/bstack.xbm",   "[b]",  bstack },
{ ICONS"/tile.xbm",     "[]=",    tile },
{ ICONS"/monocle.xbm",  "[M]", monocle },
{ ICONS"/float.xbm",    "><>",    NULL }, 
{ ICONS"/grid.xbm",     "[G]",    grid }, 
//{ ICONS"/spiral.xbm",   "[s]",  spiral }, 
//{ ICONS"/dwindle.xbm",  "[D]", dwindle }, 
{ .symbol = NULL, .arrange = NULL },
};
 
/* tagging */
static const Tag tags[] = {
        /* name       layout           mfact    nmaster */
        { "null",     &layouts[4],     -1,      -1 },
        { "web",      &layouts[4],     -1,      -1 },
        { "misc",      &layouts[2],     -1,      -1 },
        { "code",       &layouts[4],     0.83,    -1 },
        { "media",      &layouts[4],     -1,      -1 },
        { "gimp",     &layouts[4],     -1,      -1 },
}; 

/* key definitions */
#define MODKEY   Mod4Mask 
#define ALTKEY   Mod1Mask
#define TAGKEYS(KEY,TAG) \
	{ MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
	{ MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
	{ MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
	{ MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },

/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }

/* commands */
static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
static const char *termcmd[] =   { "urxvtc", NULL }; 
static const char *chromium[] =  { "chromium", NULL }; 
static const char *tabcmd[] =    { "urxvt", "-e", "tabbed", NULL }; 
static const char *mancmd[] =    { "urxvt", "-e", "ranger", NULL };  
static const char *voldown[] =   { "amixer", "-q", "-c", "0", "set", "Master", "5-", "unmute", NULL };
static const char *volup[] =     { "amixer", "-q", "-c", "0", "set", "Master", "5+", "unmute", NULL };
static const char *volmute[] =   { "amixer", "-q", "-c", "0", "set", "Master", "toggle", NULL }; 
static const char *mpdprev[] =   {"ncmpcpp", "prev", NULL };
static const char *mpdtoggle[] = {"ncmpcpp", "toggle", NULL };
static const char *mpdnext[] =   {"ncmpcpp", "next", NULL };
static const char *lockcmd[]       = { "slock", NULL };
static const char *suspendcmd[]    = { "dbus-send", "--system", "--print-reply", "--dest=org.freedesktop.UPower", "/org/freedesktop/UPower", 
"org.freedesktop.UPower.Suspend", NULL };
static const char *hibernatecmd[]  = { "dbus-send", "--system", "--print-reply", "--dest=org.freedesktop.UPower", "/org/freedesktop/UPower", 
"org.freedesktop.UPower.Hibernate", NULL };
static const char *rebootcmd[]     = { "dbus-send", "--system", "--print-reply", "--dest=org.freedesktop.ConsoleKit", "/org/freedesktop/ConsoleKit/Manager", 
"org.freedesktop.ConsoleKit.Manager.Restart", NULL };
static const char *shutdowncmd[]   = { "dbus-send", "--system", "--print-reply", "--dest=org.freedesktop.ConsoleKit", "/org/freedesktop/ConsoleKit/Manager", 
"org.freedesktop.ConsoleKit.Manager.Stop", NULL };

static Key keys[] = {
	/* modifier                     key        function        argument */
	{ MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
        { MODKEY,                       XK_x,      spawn,              {.v = termcmd } }, 
        { MODKEY,                       XK_c,      spawn,              {.v = chromium } }, 
        { MODKEY|ShiftMask,             XK_c,      spawn,              {.v = tabcmd } }, 
        { MODKEY,                       XK_e,      spawn,              {.v = mancmd } }, 
        /* Media */
        { 0,                            0xffc7,    spawn,              {.v = voldown } }, 
        { 0,                            0xffc8,    spawn,              {.v = volup } }, 
        { 0,                            0xffc9,    spawn,              {.v = volmute } }, 
        { 0,                            0xffc4,    spawn,              {.v = mpdprev } }, 
        { 0,                            0xffc6,    spawn,              {.v = mpdtoggle } }, 
        { 0,                            0xffc5,    spawn,              {.v = mpdnext } }, 
        { ControlMask|ALTKEY,           XK_l,      spawn,              {.v = lockcmd } },
        { ControlMask|ALTKEY,           XK_s,      spawn,              {.v = suspendcmd } },
        { ControlMask|ALTKEY,           XK_h,      spawn,              {.v = hibernatecmd } },
        { ControlMask|ALTKEY,           XK_r,      spawn,              {.v = rebootcmd } },
        { ControlMask|ALTKEY,           XK_q,      spawn,              {.v = shutdowncmd } },  
	{ MODKEY,                       XK_b,      togglebar,          {0} },
	{ MODKEY,                       XK_j,      focusstack,         {.i = +1 } },
	{ MODKEY,                       XK_k,      focusstack,         {.i = -1 } }, 
        { MODKEY|ShiftMask,             XK_j,      movestack,          {.i = +1 } },
        { MODKEY|ShiftMask,             XK_k,      movestack,          {.i = -1 } },
	{ MODKEY,                       XK_i,      incnmaster,         {.i = +1 } },
	{ MODKEY,                       XK_o,      incnmaster,         {.i = -1 } },
	{ MODKEY,                       XK_h,      setmfact,           {.f = -0.05} },
	{ MODKEY,                       XK_l,      setmfact,           {.f = +0.05} },
	{ MODKEY,                       XK_Return, zoom,               {0} },
	{ MODKEY,                       XK_Tab,    view,               {0} },
	{ MODKEY,                       XK_q,      killclient,         {0} },
	{ MODKEY,                       XK_d,      setlayout,          {.v = &layouts[0]} },
	{ MODKEY,                       XK_t,      setlayout,          {.v = &layouts[1]} },
	{ MODKEY,                       XK_m,      setlayout,          {.v = &layouts[2]} }, 
        { MODKEY,                       XK_f,      setlayout,          {.v = &layouts[3]} }, 
        { MODKEY,                       XK_g,      setlayout,          {.v = &layouts[4]} }, 
        { MODKEY,                       XK_s,      setlayout,          {.v = &layouts[5]} }, 
        { MODKEY,                       XK_a,      setlayout,          {.v = &layouts[6]} }, 
        { MODKEY|ShiftMask,             XK_space,  prevlayout,         {0} },
	{ MODKEY,                       XK_space,  nextlayout,         {0} },
	{ MODKEY|ShiftMask,             XK_f,  togglefloating,     {0} },
	{ MODKEY,                       XK_0,      view,               {.ui = ~0 } },
	{ MODKEY|ShiftMask,             XK_0,      tag,                {.ui = ~0 } },
	{ MODKEY,                       XK_comma,  focusmon,           {.i = -1 } },
	{ MODKEY,                       XK_period, focusmon,           {.i = +1 } },
	{ MODKEY|ShiftMask,             XK_comma,  tagmon,             {.i = -1 } },
	{ MODKEY|ShiftMask,             XK_period, tagmon,             {.i = +1 } },
	TAGKEYS(                        XK_1,                          0)
	TAGKEYS(                        XK_2,                          1)
	TAGKEYS(                        XK_3,                          2)
	TAGKEYS(                        XK_4,                          3)
	TAGKEYS(                        XK_5,                          4)
	TAGKEYS(                        XK_6,                          5)
	TAGKEYS(                        XK_7,                          6)
	TAGKEYS(                        XK_8,                          7)
	TAGKEYS(                        XK_9,                          8)
	{ MODKEY|ShiftMask,             XK_q,      quit,              {0} }, 
/* Cycle keys */
{ MODKEY,                               XK_Left,                       cycle, {.i = -1} },
{ MODKEY,                               XK_Right,                      cycle, {.i = +1} },
{ MODKEY|ShiftMask,                     XK_Left,                       tagcycle, {.i = -1} },
{ MODKEY|ShiftMask,                     XK_Right,                      tagcycle, {.i = +1} },  
/* Resize windows */ 
{ ALTKEY,                               XK_Down,    moveresize,        {.v = (int []){ 0, 25, 0, 0 }}},
{ ALTKEY,                               XK_Up,      moveresize,        {.v = (int []){ 0, -25, 0, 0 }}},
{ ALTKEY,                               XK_Right,   moveresize,        {.v = (int []){ 25, 0, 0, 0 }}},
{ ALTKEY,                               XK_Left,    moveresize,        {.v = (int []){ -25, 0, 0, 0 }}},
{ ALTKEY|ShiftMask,                     XK_Down,    moveresize,        {.v = (int []){ 0, 0, 0, 25 }}},
{ ALTKEY|ShiftMask,                     XK_Up,      moveresize,        {.v = (int []){ 0, 0, 0, -25 }}},
{ ALTKEY|ShiftMask,                     XK_Right,   moveresize,        {.v = (int []){ 0, 0, 25, 0 }}},
{ ALTKEY|ShiftMask,                     XK_Left,    moveresize,        {.v = (int []){ 0, 0, -25, 0 }}},
};

/* button definitions */
/* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
static Button buttons[] = {
	/* click                event mask      button          function        argument */
	{ ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
	{ ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
	{ ClkWinTitle,          0,              Button2,        zoom,           {0} },
	{ ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
	{ ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
	{ ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
	{ ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
	{ ClkTagBar,            0,              Button1,        view,           {0} },
	{ ClkTagBar,            0,              Button3,        toggleview,     {0} },
	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} }, 
        { ClkWinTitle,          0,              Button1,        focusonclick,   {0} },
};

 

 
and the same problem whit pertag from suckless

dwm build options:
CFLAGS   = -std=c99 -pedantic -Wall -Os -I. -I/usr/include -I/usr/X11R6/include -DVERSION="6.0" -DXINERAMA
LDFLAGS  = -s -L/usr/lib -lc -L/usr/X11R6/lib -lX11 -L/usr/X11R6/lib -lXinerama
CC       = cc
CC dwm.c
dwm.c:150:20: error: ‘tags’ undeclared here (not in a function)
make: *** [dwm.o] Error 1
 

Last edited by ivoarch (2011-12-27 12:18:12)


I love GnuEmacs, GnuScreen, ratpoison, and conkeror.
Github )||( Weblog

Offline

#488 2011-12-27 12:59:52

JokerBoy
Member
From: România
Registered: 2009-09-24
Posts: 641

Re: DWM Hackers Unite! Share (or request) dwm patches.

Delete this from your config

/* tagging */
static const char *tags[] = { "null", "web", "misc", "code", "media", "gimp" };

Offline

#489 2011-12-27 13:19:27

ivoarch
Member
Registered: 2011-03-31
Posts: 436

Re: DWM Hackers Unite! Share (or request) dwm patches.

@jokerboy   

Thanks works perfect : )
question how to edit it to work with Fibonacci

dwm build options:
CFLAGS   = -std=c99 -pedantic -Wall -Os -I. -I/usr/include -I/usr/X11R6/include -DVERSION="6.0" -DXINERAMA
LDFLAGS  = -s -L/usr/lib -lc -L/usr/X11R6/lib -lX11 -L/usr/X11R6/lib -lXinerama
CC       = cc
CC dwm.c
dwm.c: In function ‘fibonacci’:
dwm.c:2639:24: error: ‘Monitor’ has no member named ‘mfact’
make: *** [dwm.o] Error 1
 

I love GnuEmacs, GnuScreen, ratpoison, and conkeror.
Github )||( Weblog

Offline

#490 2011-12-27 13:32:03

JokerBoy
Member
From: România
Registered: 2009-09-24
Posts: 641

Re: DWM Hackers Unite! Share (or request) dwm patches.

Replace mon->mfact with mon->mfacts[mon->curtag]

My bad.

Last edited by JokerBoy (2011-12-27 13:42:08)

Offline

#491 2011-12-27 13:41:15

ivoarch
Member
Registered: 2011-03-31
Posts: 436

Re: DWM Hackers Unite! Share (or request) dwm patches.

JokerBoy wrote:

Replace mon->mfact with mon->mfacts[m->curtag]..

Uf.. tongue

thanks works

Last edited by ivoarch (2011-12-27 13:50:42)


I love GnuEmacs, GnuScreen, ratpoison, and conkeror.
Github )||( Weblog

Offline

#492 2011-12-28 10:13:26

Ypnose
Member
From: Jailed in the shell
Registered: 2011-04-21
Posts: 353
Website

Re: DWM Hackers Unite! Share (or request) dwm patches.

Glad to see a working statuscolor patch. It will be useful.


Github -- My terminal font Envypn

Offline

#493 2011-12-28 14:56:34

Raziel23
Member
Registered: 2010-03-30
Posts: 15

Re: DWM Hackers Unite! Share (or request) dwm patches.

Hi,

I have slightly modified an original cycle patch in conjunction with a shiftview patch that I have found at suckless mailing list: http://lists.suckless.org/dev/1104/7590.html. So now we use bit operations in the cycle patch instead of a for loop:

--- a/dwm.c 2011-12-19 16:02:46.000000000 +0100
+++ b/dwm.c 2011-12-28 12:26:06.294936901 +0100
@@ -251,6 +251,9 @@ static int xerror(Display *dpy, XErrorEv
 static int xerrordummy(Display *dpy, XErrorEvent *ee);
 static int xerrorstart(Display *dpy, XErrorEvent *ee);
 static void zoom(const Arg *arg);
+static void cycle(const Arg *arg);
+static int shifttag(int dist);
+static void tagcycle(const Arg *arg);

 /* variables */
 static const char broken[] = "broken";
@@ -2127,6 +2130,31 @@ zoom(const Arg *arg) {
 }

 int
+shifttag(int dist) {
+   int seltags = selmon->tagset[selmon->seltags] & TAGMASK;
+
+   if(dist > 0) // left circular shift
+       seltags = (seltags << dist) | (seltags >> (LENGTH(tags) - dist));
+   else // right circular shift
+       seltags = (seltags >> (- dist)) | (seltags << (LENGTH(tags) + dist));
+
+   return seltags;
+}
+
+void
+cycle(const Arg *arg) {
+   const Arg a = { .i = shifttag(arg->i) };
+   view(&a);
+}
+
+void
+tagcycle(const Arg *arg) {
+   const Arg a = { .i = shifttag(arg->i) };
+   tag(&a);
+   view(&a);
+}
+
+int
 main(int argc, char *argv[]) {
    if(argc == 2 && !strcmp("-v", argv[1]))
        die("dwm-"VERSION", © 2006-2011 dwm engineers, see LICENSE for details\n");

and appropriate entries in the config.h file are:

--- a/config.h  2011-12-19 16:02:46.000000000 +0100
+++ b/config.h  2011-12-28 12:29:47.037074371 +0100
@@ -74,6 +74,10 @@ static Key keys[] = {
    { MODKEY,                       XK_period, focusmon,       {.i = +1 } },
    { MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
    { MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
+   { MODKEY,                       XK_Left,   cycle,          {.i = -1 } },
+   { MODKEY,                       XK_Right,  cycle,          {.i = +1 } },
+   { MODKEY|ControlMask,           XK_Left,   tagcycle,       {.i = -1 } },
+   { MODKEY|ControlMask,           XK_Right,  tagcycle,       {.i = +1 } },
    TAGKEYS(                        XK_1,                      0)
    TAGKEYS(                        XK_2,                      1)
    TAGKEYS(                        XK_3,                      2)

This patch also work properly with the scratchpad and scratchpad_stay patch, therefore I have added "& TAGMASK" operation in the shifttag function. This operation may be omitted if we don't use those patches.

This patch is much simpler than the original one and also works with multiple selected tags. Maybe someone will be interested.

Last edited by Raziel23 (2011-12-28 15:06:47)

Offline

#494 2011-12-29 17:32:12

M4he
Member
Registered: 2011-08-11
Posts: 75

Re: DWM Hackers Unite! Share (or request) dwm patches.

On page 3 lolilolicon offered a patch for the uselessgaps to get rid of double gaps and to add gaps between windows in the stack:

lolilolicon wrote:

I tried to patch 6.0 with that; patching worked but still get double borders and such.

Any chance getting this to work with 6.0 ?


Arch - makes me feel right at /home

Offline

#495 2011-12-29 19:39:54

steve___
Member
Registered: 2008-02-24
Posts: 452

Re: DWM Hackers Unite! Share (or request) dwm patches.

I was able to get utf icons to work in the status bar:
dwm-sb.png

To install the icon font:

$ cd /usr/share/fonts/local
$ wget http://snk.tuxfamily.org/ext/fonts/stlarch-16.bdf
$ mkfontscale
$ mkfontdir
$ xset +fp /usr/share/fonts/local
$ xset fp rehash 

Further discussion here

Offline

#496 2011-12-30 06:12:08

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: DWM Hackers Unite! Share (or request) dwm patches.

M4he wrote:

On page 3 lolilolicon offered a patch for the uselessgaps to get rid of double gaps and to add gaps between windows in the stack:

lolilolicon wrote:

I tried to patch 6.0 with that; patching worked but still get double borders and such.

Any chance getting this to work with 6.0 ?

I think that patch didn't really work, but I posted several pages back a patch (or patchset) which seemed to work: https://gist.github.com/1189290
The patch was created against dwm 5.9, and I don't use gaps anymore, so can't guarantee it works.  Good luck.


This silver ladybug at line 28...

Offline

#497 2011-12-31 10:44:59

Ypnose
Member
From: Jailed in the shell
Registered: 2011-04-21
Posts: 353
Website

Re: DWM Hackers Unite! Share (or request) dwm patches.

Jokerboy, is there a chance to see your famous pertag2 on dwm-6.0?


Github -- My terminal font Envypn

Offline

#498 2011-12-31 10:56:32

ivoarch
Member
Registered: 2011-03-31
Posts: 436

Re: DWM Hackers Unite! Share (or request) dwm patches.

Ypnose wrote:

Jokerboy, is there a chance to see your famous pertag2 on dwm-6.0?

I use the jokerboy http://hg.punctweb.ro/dwm/src/9fc65fcf1 … rtag2.diff  on my dwm-6.0


I love GnuEmacs, GnuScreen, ratpoison, and conkeror.
Github )||( Weblog

Offline

#499 2011-12-31 11:02:45

JokerBoy
Member
From: România
Registered: 2009-09-24
Posts: 641

Re: DWM Hackers Unite! Share (or request) dwm patches.

Ypnose wrote:

Jokerboy, is there a chance to see your famous pertag2 on dwm-6.0?

First, it's not mine.. I just made some changes, and added nbstack to it, but it's not mine.. Kudos to simongmzlj in this case. tongue

Second, pertag2 was updated to 6.0 even before it was released 'cause I'm using the -hg version. But ATM -hg is the same thing as stable.

http://hg.punctweb.ro/dwm/src

Offline

#500 2011-12-31 11:04:30

Ypnose
Member
From: Jailed in the shell
Registered: 2011-04-21
Posts: 353
Website

Re: DWM Hackers Unite! Share (or request) dwm patches.

Thanks a lot. It is exactly what i was looking for.

EDIT: Applied pertag2 from Jokerboy Bitbucket and statucolors from jasonwryan and it works perfect.

EDIT2: I noticed something different in dwm-6.0. Don't know if it's normal behavior but it's strange. Space after last tag and symbols is short in dwm-6.0 and it creates a big space before window name.
Compared to dwm-5.9 and it's not the same thing. Using statuscolors, pertag2 and centred-floating.

Screens:
dwm-5.9:
e25a0a0326.png

dwm-6.0:
12f423cf5b.png

The missing space after 'FOO' appears after I apply this patch http://beta.intuxication.org/jasonwryan … s-6.0.diff
Don't know what's going on.

Last edited by Ypnose (2011-12-31 17:24:56)


Github -- My terminal font Envypn

Offline

Board footer

Powered by FluxBB