You are not logged in.

#126 2011-01-13 22:33:58

Adetque
Member
Registered: 2011-01-03
Posts: 14

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

I'm not putting anything in the systray.  I'm not starting anything other than dwm.

Offline

#127 2011-01-14 06:04:23

kcirick
Member
Registered: 2010-06-21
Posts: 364

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

When you say "almost" vanilla without any patches, what exactly did you change from the code (from when you downloaded the code and unarchived the source)? The problem must be coming from whatever you changed.

Offline

#128 2011-01-14 07:51:14

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

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

Hello folks, since the title suggests that we can "request" patches, can someone point me to patch that can cycle the layouts.

I have seen cycletags patch, but i don't want that. The default dwm behaviour is to toggle between 2 layouts ctrl + space. But, i want behaviour similar to that of xmonad.

Can someone please help me out.

Last edited by x33a (2011-01-14 07:51:51)

Offline

#129 2011-01-14 08:23:17

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

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


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#130 2011-01-14 10:08:01

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

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

thanks jason, i'll try that.

Offline

#131 2011-01-14 10:44:08

0mark
Member
From: earth
Registered: 2010-06-09
Posts: 162
Website

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

kcirick wrote:

Part 2/2
Anyway, this is simply to provide systray to DWM without using external programs such as trayer or stalonetray. The problem with using external programs is that the status text doesn't automatically position as the systray grows/shrinks. This is a little bit more complicated than the previous hack I posted (launcher), but hopefully this will make sense... If not, I'll try to learn to make a diff patch :-)

Woooh, great, thanks!
Saved my day, i was trying to rip the systray from awesome, but it did not go well. Now im free big_smile

I could provide a patch against vanilla dwm, if interested.


Ceterum autem censeo Systemdinem esse delendam

Offline

#132 2011-01-14 15:45:08

kcirick
Member
Registered: 2010-06-21
Posts: 364

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

0mark wrote:

I could provide a patch against vanilla dwm, if interested.

Thanks. Please see Post 118 in this thread. I've posted a link (github) to the systray patch that works on vanilla dwm.

Offline

#133 2011-01-14 16:06:05

0mark
Member
From: earth
Registered: 2010-06-09
Posts: 162
Website

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

kcirick wrote:
0mark wrote:

I could provide a patch against vanilla dwm, if interested.

Thanks. Please see Post 118 in this thread. I've posted a link (github) to the systray patch that works on vanilla dwm.

Oh. I did not read further, i was to excitet about the patch wink


Ceterum autem censeo Systemdinem esse delendam

Offline

#134 2011-01-15 00:41:19

Adetque
Member
Registered: 2011-01-03
Posts: 14

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

kcirick wrote:

When you say "almost" vanilla without any patches, what exactly did you change from the code (from when you downloaded the code and unarchived the source)? The problem must be coming from whatever you changed.

Sorry for not being clear.  The only difference between my current dwm and vanilla dwm is your systray patch.  My config.h, just because it could help:

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

/* appearance */
static const char font[]            = "fixed"; //"-*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*";
static const char normbordercolor[] = "#cccccc";
static const char normbgcolor[]     = "#cccccc";
static const char normfgcolor[]     = "#000000";
static const char selbordercolor[]  = "#0066ff";
static const char selbgcolor[]      = "#0066ff";
static const char selfgcolor[]      = "#ffffff";
static const unsigned int borderpx  = 2;        /* border pixel of windows */
static const unsigned int snap      = 32;       /* snap pixel */
static const Bool showbar           = True;     /* False means no bar */
static const Bool topbar            = True;     /* False means bottom bar */
static const Bool systray_enable    = False;
static const int systray_spacing    = 1;

/* tagging */
static const char *tags[] = { "web", "term", "ntfctn", "misc", "stat" };

static const Rule rules[] = {
    /* class      instance    title       tags mask     isfloating   monitor */
    { "Chromium", NULL,       NULL,       1,            False,       -1 },
    { "Eog",      NULL,       NULL,       0,            True,        -1 },
    { "Firefox",  NULL,       NULL,       1,            False,       -1 },
    { "Gimp",     NULL,       NULL,       0,            True,        -1 },
    { "Gnome-panel", NULL,    NULL,       1 << 2,       True,        -1 },
    { "Gnome-mplayer", NULL,  NULL,       0,            True,        -1 },
    { "trayer",   NULL,       NULL,       1 << 2,       True,        -1 },
};

/* layout(s) */
static const float mfact      = 0.55; /* factor of master area size [0.05..0.95] */
static const Bool resizehints = True; /* True means respect size hints in tiled resizals */

static const Layout layouts[] = {
    /* symbol     arrange function */
    { "[T]",      tile },    /* first entry is default */
    { "[F]",      NULL },    /* no layout function means floating behavior */
    { "[M]",      monocle },
};

/* key definitions */
#define MODKEY 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[]  = { "gnome-terminal", NULL };

static Key keys[] = {
    /* modifier                     key        function        argument */
    { MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
    { MODKEY|ShiftMask,             XK_Return, spawn,          {.v = termcmd } },
    { MODKEY,                       XK_b,      togglebar,      {0} },
    { MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
    { MODKEY,                       XK_k,      focusstack,     {.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|ShiftMask,             XK_c,      killclient,     {0} },
    { MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
    { MODKEY,                       XK_f,      setlayout,      {.v = &layouts[1]} },
    { MODKEY,                       XK_m,      setlayout,      {.v = &layouts[2]} },
    { MODKEY,                       XK_space,  setlayout,      {0} },
    { 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 } },
    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} },
};

/* 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} },
};

Offline

#135 2011-01-20 05:59:55

kcirick
Member
Registered: 2010-06-21
Posts: 364

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

Adetque wrote:

Sorry for not being clear.  The only difference between my current dwm and vanilla dwm is your systray patch.  My config.h, just because it could help:

static const Bool systray_enable    = False;
static const int systray_spacing    = 1;

Sorry it took me so long to get back. I noticed you have systray disabled (systray_enable = False). I have actually never tried disabling it, so maybe the error is there. Does everything work if you set systray_enable = True ?

Offline

#136 2011-01-20 20:27:35

Adetque
Member
Registered: 2011-01-03
Posts: 14

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

kcirick wrote:

Sorry it took me so long to get back. I noticed you have systray disabled (systray_enable = False). I have actually never tried disabling it, so maybe the error is there. Does everything work if you set systray_enable = True ?

Sorry for once again being unclear.  If systray_enabled == False, it works as if the patch was not applied.  If systray_enabled == True, it doesn't work.

Offline

#137 2011-01-22 15:43:09

portix
Member
Registered: 2009-01-13
Posts: 757

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

There was someone on #archlinux who asked for a patch, that only shows active tags. I don't know, if there is already such a patch so i created one:

diff -u dwm-5.8.2.orig//dwm.c dwm-5.8.2/dwm.c
--- dwm-5.8.2.orig//dwm.c    2011-01-22 16:26:44.000000000 +0100
+++ dwm-5.8.2/dwm.c    2011-01-22 16:29:04.000000000 +0100
@@ -695,12 +695,14 @@
     }
     dc.x = 0;
     for(i = 0; i < LENGTH(tags); i++) {
-        dc.w = TEXTW(tags[i]);
-        col = m->tagset[m->seltags] & 1 << i ? dc.sel : dc.norm;
-        drawtext(tags[i], col, urg & 1 << i);
-        drawsquare(m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
+        if (occ & 1 << i || m->tagset[m->seltags] & 1 << i) {
+            dc.w = TEXTW(tags[i]);
+            col = m->tagset[m->seltags] & 1 << i ? dc.sel : dc.norm;
+            drawtext(tags[i], col, urg & 1 << i);
+            drawsquare(m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
                    occ & 1 << i, urg & 1 << i, col);
-        dc.x += dc.w;
+            dc.x += dc.w;
+        }
     }
     dc.w = blw = TEXTW(m->ltsymbol);
     drawtext(m->ltsymbol, dc.norm, False);

Last edited by portix (2011-01-22 15:51:18)

Offline

#138 2011-01-23 06:55:53

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

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

portix wrote:

There was someone on #archlinux who asked for a patch, that only shows active tags. I don't know, if there is already such a patch so i created one

That was me big_smile and boy does the patch work well. Thanks a lot for the patch.

I have a 15" lcd and i wanted more space for the status bar scripts.

Thanks again.

Last edited by x33a (2011-01-23 06:58:22)

Offline

#139 2011-01-23 15:59:09

bsdard
Member
From: Surrey, UK
Registered: 2011-01-22
Posts: 15

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

https://github.com/akozadaev/pertag_addons
Remember layout (tile, float, monocle), mfact (modkey+h,l) for each tag. There is also another one for switching between tags using arrow keys.
I see that similar patches have been already published here, though

Offline

#140 2011-01-24 03:48:40

Jimi
Member
From: Brooklyn, NY
Registered: 2009-09-25
Posts: 125
Website

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

Anybody have a cycle.c or nextprev.c that works with pertag?

Offline

#141 2011-01-24 03:54:34

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

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

Simon's cycle.c works with pertag - you just have to hand patch it in...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#142 2011-01-24 05:07:09

Jimi
Member
From: Brooklyn, NY
Registered: 2009-09-25
Posts: 125
Website

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

cycle.c: In function 'shifttag':
cycle.c:8:19: error: dereferencing pointer to incomplete type
cycle.c:8:34: error: dereferencing pointer to incomplete type

That's what I get when I try to use cycle.c with pertag.
I know very basic C++ and not too much about pointers and OOP, so I'm not 100% sure what that error means to attempt to fix it.

Offline

#143 2011-01-24 06:14:49

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

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

Jimi wrote:

That's what I get when I try to use cycle.c with pertag.

How are you attempting to apply the patch?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#144 2011-01-24 06:44:20

Jimi
Member
From: Brooklyn, NY
Registered: 2009-09-25
Posts: 125
Website

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

add a cycle.c to the dwm-5.8.2 folder and then inside of config.h using #include "cycle.c"

Offline

#145 2011-01-24 06:46:44

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

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

That's not going to work: pertag shifts the code around (see the first couple of pages of this thread), you need to hand patch the cycle.c code into dwm.c. It is straightforward enough.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#146 2011-01-24 06:50:49

Jimi
Member
From: Brooklyn, NY
Registered: 2009-09-25
Posts: 125
Website

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

jasonwryan wrote:

That's not going to work: pertag shifts the code around (see the first couple of pages of this thread), you need to hand patch the cycle.c code into dwm.c. It is straightforward enough.

edit:

When I tried that before, it didn't work, but it did this time. Thanks!
and yeah the error I was getting before was because it was lacking definitions that were located in dwm.c, but not included in the cycle.c file.

Last edited by Jimi (2011-01-24 06:57:38)

Offline

#147 2011-01-24 06:56:57

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

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

Well, not just someplace  smile

Make sure you declare the respective functions (the static int shifttag(int dist), for example) and it will work fine. Just follow the patterns you see in dwm.c


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#148 2011-01-26 06:03:06

kcirick
Member
Registered: 2010-06-21
Posts: 364

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

Hello,

I would like to request a tiling mode that uses containers and tables, and with keybinds the users can assign where you want the client/container to be placed. If you've used i3, you'd know what I mean. You can read a little bit about it here:
http://i3.zekjur.net/docs/hacking-howto … yout_table

Alternatively, I would be happy with a manual tiling mode like ratpoison or musca, where the user splits the screen into containers then place a client in these containers.

It seems doable, but one may need to seriously hack away at the dwm code. Unless if there are easier/better way?

Offline

#149 2011-01-26 06:05:53

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

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

kcirick wrote:

It seems doable, but one may need to seriously hack away at the dwm code. Unless if there are easier/better way?

Use another WM.

Last edited by karol (2011-01-26 06:06:14)

Offline

#150 2011-01-26 06:16:28

kcirick
Member
Registered: 2010-06-21
Posts: 364

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

karol wrote:

Use another WM.

I like the dwm's bar, but I don't really like the master/stack concept. I like how i3 manages clients, but it's very hard to hack and fine-tune the code to my liking. I just wish there was a happy median.

Offline

Board footer

Powered by FluxBB