You are not logged in.

#776 2012-06-16 14:31:02

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

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

Unia wrote:

Just noticed a tiny issue with the systray patch: when in monocle mode, it shows the border of the monocle window under the systray. I have the monocly-no-border patch so it shouldn't. Here's a scrot:
http://ompldr.org/tZWNtZA

What part of the systray patch do I have to edit so it won't show?

Here's my patch:
http://pastebin.com/UERjKrUM

I had the same issue. Try monocle-no-border patch from my github page. I modified it so the border color in monocle mode is the same as background color - ugly, but worked for me.

Offline

#777 2012-06-16 14:37:00

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

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

OK100 wrote:
Unia wrote:

Just noticed a tiny issue with the systray patch: when in monocle mode, it shows the border of the monocle window under the systray. I have the monocly-no-border patch so it shouldn't. Here's a scrot:
http://ompldr.org/tZWNtZA

What part of the systray patch do I have to edit so it won't show?

Here's my patch:
http://pastebin.com/UERjKrUM

I had the same issue. Try monocle-no-border patch from my github page. I modified it so the border color in monocle mode is the same as background color - ugly, but worked for me.

Thanks, will give it a go tonight!


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#778 2012-06-16 15:58:26

madders
Member
From: Reading, UK
Registered: 2012-04-01
Posts: 13

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

Hi,

Does anyone have a patch which limits the number of clients that can be opened on a particular tag, and when the tag is full, the client is opened on a different tag? I've seen there is an old clientspertag patch, but it doesn't allow a different tag to be specified when the tag is full, it just hides the client behind the visible windows.

I'd like to use this with the pertag patch and window rules. So for example, I could have tags 8 and 9 with grid layouts, and have rules to open XTerm windows on tag 8, but if there are already 6 clients open on tag 8, then open new windows on tag 9.

Thanks,
Michael

Offline

#779 2012-06-16 16:53:43

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,422
Website

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

If the clientspertag patch still works, it should be easy to modify it.  Just change the line that hides the client to a call to the function to move it to a new tag.  I don't recall the name of the function off the top of my head, but it can be found in the default key bindings.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#780 2012-06-22 09:55:01

Simple Boot
Member
Registered: 2012-06-19
Posts: 21

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

Lokaltog wrote:

I don't think this qualifies as a patch or a hack, but it's a tip I think some of you may find useful:

I like icons in my statusbar, but I don't want to use a separate app like dzen2 just to show xbm icons when dwm already has a status bar, and I don't know how to patch dwm with xbm support. I've solved this problem by editing my dwm font (I use artwiz cure) and drawing icons in the font itself:

1) If your font is a pcf font, use pcf2bdf (available in AUR) to convert it to a bdf font
2) Install gbdfed (available in AUR) and xorg-font-tools
3) Open your bdf font in gbdfed and replace the glyphs you want with icons. It may be possible to use empty glyphs beyond 0xFF instead, but I haven't tried this.
4) Change the font name if you want (Edit > Font Info > Font Properties), and save the font
5) Use bdftopcf to compile the bdf font to pcf, and gzip it (this step is optional)
6) Copy/move the font to an Xorg font dir, run fc-cache -vf and restart X
7) Insert the symbols in your status bar script or in config.h if you want. I've made some symbols to indicate the layout mode that I use in config.h (see screenshot).

Here's a screenshot of the tip in action (note that I've patched dwm with statuscolors to add some color to the icons):
http://bildr.no/thumb/664213.jpeg

Edit: Check out my GitHub repo for an updated bdf font with various symbols.

I edited DinaMedium9.pcf and restarted X, but nothing has changed - all of the spaces that were empty ( square ) still produce the same output.

static const char font[]            = "-*-dina-medium-r-normal-*-*-*-*-*-*-*-*-*";

tZWZvZA

What could be wrong ?


Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end.

Offline

#781 2012-06-22 19:46:03

stlarch
Member
From: hell
Registered: 2010-12-25
Posts: 1,265

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

^^If you just want a few icons, you could maybe try replacing a few glyphs that you won't use (if there are any) in the 00A0 - 00FF section.

Offline

#782 2012-06-23 12:31:20

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

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

Hey everyone, I'm back with yet another "project".

I'm using the XFT patch for my DWM so statuscolors can't be applied cleanly. That got me to think that actually, I don't need the whole statuscolors patch (I already have the urgentcolor one working):

I just want to color some parts of my statusbar in the selfgcolor. I started looking at the statuscolors patch and stripped everything I think I don't need to accomplish this and in the end, I got down to what you see below. Now comes my question: How can I edit this bit to make the statusbar show some parts in selfgcolor?

--- dwm.c.orig  2012-06-21 23:38:04.045848195 +0200
+++ src/dwm-6.0/dwm.c   2012-06-21 23:39:37.622513296 +0200
@@ -214,6 +214,7 @@
 static Monitor *dirtomon(int dir);
 static void drawbar(Monitor *m);
 static void drawbars(void);
+static void drawcoloredtext(char *text);
 static void drawsquare(Bool filled, Bool empty, Bool invert, XftColor col[ColLast]);
 static void drawtext(const char *text, XftColor col[ColLast], Bool invert);
 static void enternotify(XEvent *e);
@@ -863,7 +864,7 @@
            dc.x = x;
            dc.w = m->ww - x;
        }
-       drawtext(stext, dc.norm, False);
+       drawcoloredtext(stext);
    }
    else
        dc.x = m->ww;
@@ -891,6 +892,36 @@
 }
 
 void
+drawcoloredtext(char *text) {
+    Bool first=True;
+    char *buf = text, *ptr = buf, c = 1;
+    unsigned long *col = dc.colors[0];
+    int i, ox = dc.x;
+
+    while( *ptr ) {
+        for( i = 0; *ptr < 0 || *ptr > NUMCOLORS; i++, ptr++);
+            if( !*ptr ) break;
+            c=*ptr;
+            *ptr=0;
+             if( i ) {
+                 dc.w = selmon->ww - dc.x;
+                 drawtext(buf, col, first);
+                 dc.x += textnw(buf, i) + textnw(&c,1);
+                 if( first ) dc.x += ( dc.font.ascent + dc.font.descent ) / 2;
+                 first = False;
+             } else if( first ) {
+                 ox = dc.x += textnw(&c,1);
+             }
+             *ptr = c;
+             col = dc.colors[ c-1 ];
+             buf = ++ptr;
+     }
+     if( !first ) dc.x-=(dc.font.ascent+dc.font.descent)/2;
+     drawtext(buf, col, True);
+     dc.x = ox;
+}
+
+void
 drawsquare(Bool filled, Bool empty, Bool invert, XftColor col[ColLast]) {
    int x;

I already looked at some parts of my dwm.c to see how I could achieve this, but it didn't bring me that far. Can you give me some pointers?


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#783 2012-07-03 05:19:06

sw2wolf
Member
From: China
Registered: 2009-06-08
Posts: 99
Website

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

Why do the floating window loses focus ?    I am using dwm-6.0.
It seems a bug: http://permalink.gmane.org/gmane.comp.m … kless/5270

Sincerely!

Last edited by sw2wolf (2012-07-10 05:29:47)


e^(π⋅i) + 1 = 0

Offline

#784 2012-07-03 05:56:11

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

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

This is a hacking thread - for general support, please start a thread in Newbie Corner and include some more detail, like any customizations to your config.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#785 2012-07-18 13:39:16

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

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

Hey,
How can I define two commands in a 'static const char'?
I tried something, but I didn't work (and I think it's a bit dirty):

static const char *volup[]    = { "amixer", "-q", "-c", "0", "set", "Master", "4+", "unmute",  "&&", "vol", NULL };

Github -- My terminal font Envypn

Offline

#786 2012-07-18 13:51:36

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,422
Website

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

Ypnose, because of how the spawn function is written, that cannot work.  I don't think there is a way to put two commands into a single const char * and pass them to spawn().

The easiest solution would be to put those commands in a script and call the script.

I suspect it may also be possible to have one key press make two separate calls to the spawn function ... but a script would be far easier.

I use a volume script that takes one of three parameters "up", "down", and "toggle" (for muting).  This script can be bound to the approrpiate keys easily.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#787 2012-07-18 14:03:38

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

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

Thanks for support. I plan to create specials scripts for my needs.
You talked about your volume script, where can I take a look, and see some tips?


Github -- My terminal font Envypn

Offline

#788 2012-07-18 14:14:02

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,422
Website

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

There are many such scripts out there - basically just put those commands you want into a script.  Here's mine

#!/bin/bash
case "$1" in
	up) amixer set Master 4%+ > /dev/null ;;
	down) amixer set Master 4%- > /dev/null ;;
	toggle) amixer set Master toggle > /dev/null ;;
esac

I also have a couple lines after that to get the current volume settings and put it in a file read by my status bar program, but these lines do all the setting of volume.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#789 2012-07-18 14:21:52

mhertz
Member
From: Denmark
Registered: 2010-06-19
Posts: 681

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

Ypnose wrote:

Hey,
How can I define two commands in a 'static const char'?
I tried something, but I didn't work (and I think it's a bit dirty):

static const char *volup[]    = { "amixer", "-q", "-c", "0", "set", "Master", "4+", "unmute",  "&&", "vol", NULL };

The '&&' is a builtin shell-command, so for the above to work then you would need to preced it with 'bash -c', or 'sh -c'...

Example:

"bash", "-c", "foo", "&&", "bar"

Offline

#790 2012-07-18 14:32:11

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,422
Website

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

Of course *headslap*

mhertz suggestion should work well.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#791 2012-07-18 17:47:09

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

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

Ok, I tried script method with case.
It works like a charm and gives me a notification when I change volume settings.
Thanks.


Github -- My terminal font Envypn

Offline

#792 2012-07-22 19:32:38

lorin
Member
Registered: 2011-12-06
Posts: 28

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

Hey, could someone refresh my memory on what to comment out of dwm.c to remove the little square indicators on active tags?  I can't seem to find the very brief mention of it I found on some mailing list when configuring DWM on my old system ... Of course, not being sure what their proper name might be isn't helping my search, heh. Thanks!

Offline

#793 2012-07-22 19:47:09

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,422
Website

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

@lorin,

It'd be in the "drawbar" function somewhere near line 730.  I say somewhere near as I have made many modifications, particularly to that function.

You should be able to search for it in that area though, there is a call to the "drawsquare" function which is what you are looking for.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#794 2012-07-22 20:08:05

lorin
Member
Registered: 2011-12-06
Posts: 28

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

Success. Drawsquare seems so obvious now, feels like that should have rung a bell when I was skimming through. Thanks a bunch.

Offline

#795 2012-07-23 14:22:58

Gamer
Member
Registered: 2012-07-23
Posts: 17

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

I am using uselessgaps patch, but it doesn't seem to work the way I expected. Firefox and Thunar ( the only ones I have encountered having this issue so far ) have no gaps by default, but if I open and close a new terminal window ( in the same workspace ), gaps appear and everything is fine.

Except getting rid of this patch, is there a way to fix it ?

Last edited by Gamer (2012-07-23 17:10:23)


Real men don't use backups, they post their stuff on a public ftp server and let the rest of the world make copies.
- Linus Torvalds

Offline

#796 2012-07-24 02:03:55

eldamar
Member
From: Sweden
Registered: 2008-02-11
Posts: 104

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

I am having trouble getting icons to work for me, the whole statusbar seems to break after an icon character? i have the font installed and working when i try it in the terminal but however i try it doesn't seem to work in dwm for some reason. I am using the patches, config and font from w0ng's repo just to try it out: https://github.com/w0ng/dwm/blob/master/config.h

What might i be missing? locale has en_US UTF-8 and en_US ISO8859-1

EDIT: forgot to add locale to rc.conf >< stupid mistake.

Last edited by eldamar (2012-07-24 03:14:16)

Offline

#797 2012-07-28 01:13:06

DrKillPatient
Member
Registered: 2011-07-28
Posts: 85

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

I've set up Conky to pipe information to xsetroot for the DWM statusbar. However, I have two monitors, and I dislike that the statusbar text only draws on the selected monitor. I'd prefer that it displays on both simultaneously.

I've made some progress in fixing this (note that I have the statuscolors patch):
In the drawbar() function, there's an if-statement beginning with

if (m == selmon)

I commented out all but the parts that were to be executed 'if (m == selmon)', thus making the statusbar draw on any monitor regardless of whether it is selected.

Under the drawcoloredtext() function, I replaced

dc.w = selmon->ww - dc.x;

with

dc.w = mons->ww - dc.x;

Because my monitors were of different sizes, the unmodified version would cut off the statusbar text on the larger monitor if the smaller one were selected. I changed 'selmon' to 'mons' in the hope that this issue would not occur, and it seems not to cut off now. I do not know whether this 'fix' will affect anything else negatively, it doesn't appear to for now.

I have one issue that I cannot resolve, however: although the statusbar renders on both monitors, it will only update consistently on the selected one. If I switch the monitor selection, the other monitor's statusbar will update, but the unselected one will "freeze" until reselected. I cannot find a piece of code pertaining to this behavior. What can I do to modify this behavior? (and additionally, are my previously-described changes decent solutions to the other parts of the problem?)

Offline

#798 2012-07-28 01:55:23

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

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

A patch already exists: statusallmons

Offline

#799 2012-07-28 04:32:21

DrKillPatient
Member
Registered: 2011-07-28
Posts: 85

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

Ah, so it does-- should have checked there first! However, it actually patches the file in exactly the same way I did, so the problem with statusbar updates still persists. Any insight into that?

If it helps, I've also noticed that the bar on the unselected screen will still update at the point when I create a new window on the selected screen. Not sure what that entails, though.

Last edited by DrKillPatient (2012-07-28 04:32:52)

Offline

#800 2012-07-29 22:23:29

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

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

@Jokerboy: Saw your new patch called center window. http://hg.punctweb.ro/dwm/src/e78d596ad … indow.diff
I don't get what is the difference with center floating? Could you help me please.


Github -- My terminal font Envypn

Offline

Board footer

Powered by FluxBB