You are not logged in.

#401 2011-10-29 17:35:25

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

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

Army wrote:

Can I disable focus-follow-mouse in dwm? It drives me mad!

On dwm.c search for '[EnterNotify] = enternotify' and comment it out

Army wrote:

Is there a patch which provides a fullscreen mode? This one isn't really THAT important, but it would be nice in some situations.

It's called 'monocycle' in dwm-lang and its there by default. Just press Mod1-m .

Tips on layouts:

dwm man page wrote:

       Mod1-b Toggles bar on and off.

       Mod1-t Sets tiled layout.

       Mod1-f Sets floating layout.

       Mod1-m Sets monocle layout.

       Mod1-space
              Toggles between current and previous layout.

Last edited by c00kiemon5ter (2011-10-29 17:41:19)


.:[ git me! ] :.

Offline

#402 2011-10-29 18:29:21

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

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

@Army
   
I disabled focus-follow-mouse so
On dwm.c search for '[EnterNotify] = enternotify' and comment it out
and 
removed this line from dwm.c

static void enternotify(XEvent *e); 

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

Offline

#403 2011-10-29 18:30:48

Army
Member
Registered: 2007-12-07
Posts: 1,784

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

Ok, this layout, but it's not "fullscreen", it's more like "maximized". Of course I can then hide the bar with Mod4-b (I use Mod4 instead of Mod1) and I'm fullscreen, but that's not the perfect solution, since e.g. all other terminals need to be redrawn, because they change their size as well, and it's too many key strokes away. But as I said, this one isn't that important!

Thanks about the enternotify, works perfect smile

edit: Damn, now I remember something else which I cannot find anywhere: Is it possible to go to the urgent window with a key combination? That would be very handy!

Last edited by Army (2011-10-29 18:32:41)

Offline

#404 2011-10-30 03:58:46

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

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

Army wrote:

Ok, this layout, but it's not "fullscreen", it's more like "maximized". Of course I can then hide the bar with Mod4-b (I use Mod4 instead of Mod1) and I'm fullscreen, but that's not the perfect solution, since e.g. all other terminals need to be redrawn, because they change their size as well, and it's too many key strokes away. But as I said, this one isn't that important!

https://gist.github.com/1325440
I just put it together really quickly, reusing code from dwm.c. The new function togglefullscreen() toggles fullscreen state of the focused window. It seems to work in my brief tests.

To use it, download togglefullscreen.c, then in config.h, #include it and assign a key combo to it, e.g.:

#include "togglefullscreen.c"

static Key keys[] = {
       { MODKEY|ShiftMask,             XK_f,      togglefullscreen, {0} },
};

This silver ladybug at line 28...

Offline

#405 2011-10-30 05:57:04

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

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

Army wrote:

edit: Damn, now I remember something else which I cannot find anywhere: Is it possible to go to the urgent window with a key combination? That would be very handy!

Try this: https://gist.github.com/1325562
To use it, #include "focusurgent.c" and assign a key combo to focusurgent() in config.h.

#include "focusurgent.c"

static Key keys[] = {
	{ MODKEY|ShiftMask,             XK_Tab,    focusurgent,    {0} },
};

You can hit the key combo Mod+Shift+Tab to focus the urgent client, then Mod+Tab to view the last selected tags. This should be fairly handy.
Improvements are welcome.

Last edited by lolilolicon (2011-10-30 06:45:39)


This silver ladybug at line 28...

Offline

#406 2011-10-30 06:42:22

Cloudef
Member
Registered: 2010-10-12
Posts: 636

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

@Army
My dwm fork provides everything you mentioned. Setting for focus type, fullscreen toggle and many "bug" fixes (personal annoyances).
It behaves a bit differently than vanilla dwm thought. If you ever give it a spin, I suggest removing the config.h that is there and just use the config.def.h.

Last edited by Cloudef (2011-10-30 07:11:54)

Offline

#407 2011-10-30 07:53:48

Army
Member
Registered: 2007-12-07
Posts: 1,784

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

Wow, thanks a lot!!!

The fullscreen patch works very well so far!
The focusurgent works too, but I personally would prefer if it wouldn't change the layout.

@Cloudef, maybe I'll take a look at it when I'm in the mood and have the time, thanks for your suggestion.

By the way, I use dwm-sprinkles-svn-experimental from the AUR, there are some quite impressive features in there. But in the future I want to use a dwm which only provides functionality I want and nothing more, but that's a bit too much for me right now.

Last edited by Army (2011-10-30 07:59:49)

Offline

#408 2011-10-30 08:16:48

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

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

Army wrote:

Wow, thanks a lot!!!

The fullscreen patch works very well so far!
The focusurgent works too, but I personally would prefer if it wouldn't change the layout.

You're welcome big_smile
focusurgent() does not change the layout, but simply selects the tags of the urgent client. To quickly go back to the last set of tags, just hit Mod+Tab.
This is IMO the least intrusive way of doing this, but if you have a better idea, feel free to describe it.

Last edited by lolilolicon (2011-10-30 08:17:39)


This silver ladybug at line 28...

Offline

#409 2011-10-30 08:27:44

Cloudef
Member
Registered: 2010-10-12
Posts: 636

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

lolilolicon wrote:

You're welcome big_smile
focusurgent() does not change the layout, but simply selects the tags of the urgent client. To quickly go back to the last set of tags, just hit Mod+Tab.
This is IMO the least intrusive way of doing this, but if you have a better idea, feel free to describe it.

You could check if the urgent client is visible with ISVISIBLE, and just focus if it is.
Otherwise do like you do now. However I don't remember if clients hold their own tag info too, if they do, you can just append to current tags.

Focus urgent actually sounds useful, and I might add it to mine.

Offline

#410 2011-10-30 08:44:03

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

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

Cloudef wrote:
lolilolicon wrote:

You're welcome big_smile
focusurgent() does not change the layout, but simply selects the tags of the urgent client. To quickly go back to the last set of tags, just hit Mod+Tab.
This is IMO the least intrusive way of doing this, but if you have a better idea, feel free to describe it.

You could check if the urgent client is visible with ISVISIBLE, and just focus if it is.

Yeah, I did the ISVISIBLE check in d90455.

Otherwise do like you do now. However I don't remember if clients hold their own tag info too, if they do, you can just append to current tags.

You mean like, selmon->tagset[selmon->seltags] |= c->tags? That would change the layout, potentially bringing in many windows in view... not cool IMO.

Focus urgent actually sounds useful, and I might add it to mine.

Agreed. Army has pretty cool ideas.

Last edited by lolilolicon (2011-10-30 08:44:26)


This silver ladybug at line 28...

Offline

#411 2011-10-30 08:59:52

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

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

Guys these patches are very useful!
Thanks for developers big_smile  and @Army for the pretty cool ideas

Added to my dwm wink

EDIT: 
Guys you can make this patch for dwm-5.9  http://dwm.suckless.org/patches/historical/save_floats

Last edited by ivoarch (2011-10-30 09:25:15)


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

Offline

#412 2011-10-30 09:57:43

Army
Member
Registered: 2007-12-07
Posts: 1,784

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

I'm honored that you like my ideas!!! I'll share any ideas I'll have in the future. If only I could code them myself...

@lolilolicon, focusurgent definitely changes the layout here. But I added it to dwm-sprinkles, so I'll check its behavior with a vanilla dwm to make sure it's not caused by something in dwm-sprinkles. I'll report back here asap.
edit: Ok, with a vanilla dwm it works perfectly. I take this as a reason to start building my own dwm smile Thanks again for those nice plugins!!!

Last edited by Army (2011-10-30 10:37:46)

Offline

#413 2011-10-30 10:59:11

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

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

lolilolicon wrote:
Army wrote:

edit: Damn, now I remember something else which I cannot find anywhere: Is it possible to go to the urgent window with a key combination? That would be very handy!

Try this: https://gist.github.com/1325562
To use it, #include "focusurgent.c" and assign a key combo to focusurgent() in config.h.

#include "focusurgent.c"

static Key keys[] = {
	{ MODKEY|ShiftMask,             XK_Tab,    focusurgent,    {0} },
};

You can hit the key combo Mod+Shift+Tab to focus the urgent client, then Mod+Tab to view the last selected tags. This should be fairly handy.
Improvements are welcome.

Thanks for this one. smile

Offline

#414 2011-10-30 18:05:33

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

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

lolilolicon wrote:

focusurgent() does not change the layout, but simply selects the tags of the urgent client. To quickly go back to the last set of tags, just hit Mod+Tab.
This is IMO the least intrusive way of doing this, but if you have a better idea, feel free to describe it.

If you are using the pertag patch with different layouts on the current tag and the tag with the urgent client, your patch will use the current layout for the second tag too.

Replacing

				if(!ISVISIBLE(c)) {
					selmon->seltags ^= 1;
					selmon->tagset[selmon->seltags] = c->tags;
				}

with

				if(!ISVISIBLE(c)) {
					Arg a = { .ui = c->tags }; 
					view(&a); 
				}

should use the proper layout in the second tag. smile Maybe you can find a more proper way to do this for pertag users.

Offline

#415 2011-10-30 18:27:38

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

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

Found a very useful patch from de @lolilolicon github, https://github.com/lolilolicon/dwm/blob … title.diff
I hidden my title to get more space for my dwmstatus
like this 

 static const unsigned int titlemaxw = 0;      /* maximum title width in pixel */  

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

Offline

#416 2011-10-30 18:33:10

Army
Member
Registered: 2007-12-07
Posts: 1,784

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

@JokerBoy, ok, when I used dwm-sprinkles, I also had the pertag patch included, as it is by default in this fork. Now I use a slightly patched dwm with a few plugins, so lolilolicon's version works right. Of course it would be good if it worked in combination with pertag.

Another question, which I remembered: Is it possible to move floating windows with the keyboard? That would be cool for some programs like easytag, if you really don't want to use the mouse all the time to move that window away.

Offline

#417 2011-10-30 18:37:33

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

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

@Army 

I use this patch http://dwm.suckless.org/patches/moveresize  for move windows with the keyboard


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

Offline

#418 2011-10-30 19:58:12

Army
Member
Registered: 2007-12-07
Posts: 1,784

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

Oh ... Looks like I didn't see that ... I'll give it a try, thanks!
edit: It works great! But it took me a while to figure out what caused a problem I had. The reason was, the explanation on this site wasn't complete, it's required to put a

static void movemouse(const Arg *arg);
//new
static void moveresize(const Arg *arg);
//
static Client *nexttiled(Client *c);

in there.

Good that I know a tiny little bit C smile

Last edited by Army (2011-10-30 21:27:21)

Offline

#419 2011-11-01 05:10:58

nqs
Member
Registered: 2011-10-31
Posts: 4

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

Hello peeps.

I've patched systray from page five against a vanilla 5.9, and am getting this error:

~/temp/dwm-5.9 on terminal pts/0, Command #1034
[nqs@pheonix]  OK % make                                                                                                                             2011-10-31-21:20:42
dwm build options:
CFLAGS   = -std=c99 -pedantic -Wall -Os -I. -I/usr/include -I/usr/X11R6/include -DVERSION="5.9" -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 'propertynotify':
dwm.c:1342:3: error: 'cme' undeclared (first use in this function)
dwm.c:1342:3: note: each undeclared identifier is reported only once for each function it appears in
make: *** [dwm.o] Error 1
zsh: exit 2     make
~/temp/dwm-5.9 on terminal pts/0, Command #1035
[nqs@pheonix]  FAIL %                                                                                                                                2011-10-31-21:20:45

the relevant function is @ lines 1311 - 1349 of dwm.c:

propertynotify(XEvent *e) {
        Client *c;
        Window trans;
        XPropertyEvent *ev = &e->xproperty;

        if((ev->window == root) && (ev->atom == XA_WM_NAME))
                updatestatus();
        else if(ev->state == PropertyDelete)
                return; /* ignore */
        else if((c = wintoclient(ev->window))) {
                switch(ev->atom) {
                default: break;
                case XA_WM_TRANSIENT_FOR:
                        if(!c->isfloating && (XGetTransientForHint(dpy, c->win, &trans)) &&
                           (c->isfloating = (wintoclient(trans)) != NULL))
                                arrange(c->mon);
                        break;
                case XA_WM_NORMAL_HINTS:
                        updatesizehints(c);
                        break;
                case XA_WM_HINTS:
                        updatewmhints(c);
                        drawbars();
                        break;
                }
                if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) {
                        updatetitle(c);
                        if(c == c->mon->sel)
                                drawbar(c->mon);
                }
        }
        (cme->window == traywin); {
      if(cme->data.l[1] == XEMBED_EMBEDDED_NOTIFY){
         systray_add(cme->data.l[2]);
         systray_update();
      }
   }

}

I've only done a little coding, and even less C, so i hit up google for "undeclared (first use in this function)", and as near as I understand, I need to declare 'cme' in config.h.  What I am unsure about is the how and where.  I think the how is simply a line similar to "static Bool systray_enable          = True;" (but using cme), but where should it go in the file?

Any help, or pointers towards the solution would be appreciated

NQS


These opinions are mine, mine I say! Piss off and get your own.

Offline

#420 2011-11-01 06:26:55

Cloudef
Member
Registered: 2010-10-12
Posts: 636

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

@nqs
XClientMessageEvent *cme = &e->xclient;

Put that at top of the function, the systray patch on page 5 is quite buggy to be honest (sometimes keeps adding icons and does not remove them after closed) Also does not work with KDE trayicons, I've fixed these bugs (there are still few like wine trayicons not showing), so I might update the patch later.

Offline

#421 2011-11-01 08:37:18

OK100
Member
From: [U==]
Registered: 2010-04-26
Posts: 455

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

@nqs
Or try fbpanel-dwm from AUR (https://aur.archlinux.org/packages.php?ID=34594).

Last edited by OK100 (2011-11-01 08:37:42)

Offline

#422 2011-11-01 09:31:00

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

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

Offline

#423 2011-11-01 11:59:48

Army
Member
Registered: 2007-12-07
Posts: 1,784

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

I use conky-cli in dwm with the following command

conky | while read -r; do xsetroot -name "$REPLY";done

That way of course everything which is displayed has the same color.

Does anyone of you know a patch / plugin for dwm which makes it possible to add colors to the output?
I thought and hoped that this is what http://dwm.suckless.org/patches/statuscolors provides, so I tried it, but that doesn't seem to do the trick here.

Offline

#424 2011-11-01 12:19:11

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

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

@Army   

you have to patch your dwm whit statuscolors patch http://ompldr.org/vYjJxYg -this is new version of the statuscolors patch with some bug
fixes to the textnw() function. The previous version would crash with
some double free() calls, so this version uses the C99 variable length
array instead.  look at this https://bbs.archlinux.org/viewtopic.php … 91#p953691

 
About how to use
Here https://bbs.archlinux.org/viewtopic.php … 91#p914391

and 

here https://bbs.archlinux.org/viewtopic.php … 51#p682951

Last edited by ivoarch (2011-11-01 12:28:42)


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

Offline

#425 2011-11-01 13:20:52

Army
Member
Registered: 2007-12-07
Posts: 1,784

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

Ok, thanks a lot! I used it wrong in my conkyrc, that's why it didn't work. Great stuff smile

Offline

Board footer

Powered by FluxBB