You are not logged in.

#976 2012-11-11 11:37:55

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

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

So la1111, if I'm not mistaken your patch enables you to use colors in the statusbar, without having to define them in config.h? E.g. you keep dc.sel and dc.norm in dwm.c, instead of the dc.colors?

Last edited by Unia (2012-11-11 11:38:07)


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

#977 2012-11-11 13:13:52

la11111
Member
Registered: 2012-11-11
Posts: 11

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

yeah, that's correct. I just finished it up and made the patch, which I posted here:

https://gist.github.com/4054818
https://gist.github.com/4054818

I tested it with 5.9 and 6.0 tarballs, and it applied/compiled properly.

you set a color externally by putting the ansi code for that color in your status bar script. it actually doesn't mess with the default config.h whatsoever.

For example, from a bash prompt or something:

perl -e '`xsetroot -name "\x1b[38;5;196mHello World \x1b[0m\x1b[48;5;196mRed Background\x1b[0m"`'

it supports the standard ansi escape codes (16 colors~) plus the xterm 256 color mode colors.

more info on ansi color codes here:

http://www.frexx.de/xterm-256-notes/

a bit more info is in the diff. It's kind of a big patch, but it's a lot cleaner in that it doesn't muck around with the other code.

This is my first C project, so it could probably use a once-over to check for memory leaks; but hopefully that won't be an issue smile

here's a screenshot of my status script updated to use pretty colored output - as you can see my battery is discharging and my wifi signal is a bit weak smile

dwm_coloredstatus.png

Last edited by la11111 (2012-11-11 13:33:35)

Offline

#978 2012-11-11 13:30:38

illusionist
Member
From: localhost
Registered: 2012-04-03
Posts: 498

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

@la11111
Please edit your gist link. It is not working.


  Never argue with stupid people,They will drag you down to their level and then beat you with experience.--Mark Twain
@github

Offline

#979 2012-11-11 13:34:32

la11111
Member
Registered: 2012-11-11
Posts: 11

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

ah, sorry, corrected. i posted git:// instead of https://

Offline

#980 2012-11-11 13:42:51

illusionist
Member
From: localhost
Registered: 2012-04-03
Posts: 498

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

Thanks,
Can you post a config.h regarding normal{fg, bg} and selected{bg, fg} colors ?


  Never argue with stupid people,They will drag you down to their level and then beat you with experience.--Mark Twain
@github

Offline

#981 2012-11-11 13:50:47

la11111
Member
Registered: 2012-11-11
Posts: 11

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

sure, here's the relevant section from the stock config.h file:


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

/* appearance */
static const char font[]            = "-*-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";

Offline

#982 2012-11-11 13:54:34

illusionist
Member
From: localhost
Registered: 2012-04-03
Posts: 498

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

Oh i get it.
There is no need to define a color array. tongue
Thanks.

EDIT: typo

Last edited by illusionist (2012-11-11 14:00:38)


  Never argue with stupid people,They will drag you down to their level and then beat you with experience.--Mark Twain
@github

Offline

#983 2012-11-11 14:21:02

dickey
Member
Registered: 2009-06-01
Posts: 35

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

la11111 wrote:

y

it supports the standard ansi escape codes (16 colors~) plus the xterm 256 color mode colors.

more info on ansi color codes here:

http://www.frexx.de/xterm-256-notes/

Some of that is useful, but it adds to confusion regarding ANSI (which specified exactly 8 colors)

http://invisible-island.net/xterm/xterm … s_16colors

Offline

#984 2012-11-11 15:38:37

la11111
Member
Registered: 2012-11-11
Posts: 11

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

True, I just added them for in case someone tried to use them.

Besides those colors, I use the same 256 colors that Xterm uses. ( "#rgb", where r/g/b = "00", "5f", "87", "af", "d6", "ff") So there's no question there.

It wouldn't be difficult to allow for arbitrary #xxxxxx colors to be specified, but then, you wouldn't be able to test your status script in the terminal, which is why I did it that way.

it's not a true ansi sequence, but pretty much all terminal emulators support it nowadays.

also, here's a link to a perl script that will print out all of the colors that my patch supports with the escape code / hex value:
http://www.vim.org/scripts/script.php?script_id=1349

Last edited by la11111 (2012-11-11 15:48:42)

Offline

#985 2012-11-11 17:20:56

la11111
Member
Registered: 2012-11-11
Posts: 11

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

@illusionist

forgot to reply to your last question - do you mean the space on the right, in that screenshot?

I'm not sure how my patch would behave in different locales - it relies on ascii escape '\x1b' so I'm not sure how that translates to 2-byte text, if anything would be different at all.

Offline

#986 2012-11-11 20:01:11

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

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

I created a patch if you don't wanna use Xft. It could be cleaner but I'm just a novice.
EDIT: Now you can switch on / off xft by commenting lines in config.mk.

--- a/config.mk	2012-11-11 20:09:21.174319764 +0100
+++ b/config.mk	2012-11-11 19:36:25.990617582 +0100
@@ -10,13 +10,17 @@
 X11INC = /usr/X11R6/include
 X11LIB = /usr/X11R6/lib
 
+#Xft
+#XFTINC  = /usr/include/freetype2
+#XFTLIBS = -lutil -lXext -lXft -lfontconfig
+
 # Xinerama, comment if you don't want it
 XINERAMALIBS  = -lXinerama
 XINERAMAFLAGS = -DXINERAMA
 
 # includes and libs
-INCS = -I${X11INC} -I/usr/include/freetype2
-LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} -lutil -lXext -lXft -lfontconfig
+INCS = -I${X11INC} -I${XFTINC}
+LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${XFTLIBS}
 
 # flags
 CPPFLAGS = -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}

--- a/dwm.c	2012-11-11 20:46:08.738079237 +0100
+++ b/dwm.c	2012-11-11 20:45:51.781409248 +0100
@@ -37,8 +37,10 @@
 #include <X11/Xproto.h>
 #include <X11/Xutil.h>
 #include <X11/XKBlib.h>
+#ifdef XFT
 #include <fontconfig/fontconfig.h>
 #include <X11/Xft/Xft.h>
+#endif /* XFT */
 #ifdef XINERAMA
 #include <X11/extensions/Xinerama.h>
 #endif /* XINERAMA */
@@ -102,15 +104,25 @@
 
 typedef struct {
 	int x, y, w, h;
+#ifdef XFT
 	XftColor norm[ColLast];
 	XftColor sel[ColLast];
+#else
+	unsigned long norm[ColLast];
+	unsigned long sel[ColLast];
+#endif
 	Drawable drawable;
 	GC gc;
 	struct {
 		int ascent;
 		int descent;
 		int height;
+#ifdef XFT
 		XftFont *xfont;
+#else
+		XFontSet set;
+		XFontStruct *xfont;
+#endif
 	} font;
 } DC; /* draw context */
 
@@ -180,15 +192,24 @@
 static Monitor *dirtomon(int dir);
 static void drawbar(Monitor *m);
 static void drawbars(void);
+#ifdef XFT
 static void drawsquare(Bool filled, Bool empty, Bool invert, XftColor col[ColLast]);
 static void drawtext(const char *text, XftColor col[ColLast], Bool invert);
+#else
+static void drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]);
+static void drawtext(const char *text, unsigned long col[ColLast], Bool invert);
+#endif
 static void enternotify(XEvent *e);
 static void expose(XEvent *e);
 static void focus(Client *c);
 static void focusin(XEvent *e);
 static void focusmon(const Arg *arg);
 static void focusstack(const Arg *arg);
+#ifdef XFT
 static XftColor getcolor(const char *colstr);
+#else
+static unsigned long getcolor(const char *colstr);
+#endif
 static Bool getrootptr(int *x, int *y);
 static long getstate(Window w);
 static Bool gettextprop(Window w, Atom atom, char *text, unsigned int size);
@@ -488,6 +509,13 @@
 	for(m = mons; m; m = m->next)
 		while(m->stack)
 			unmanage(m->stack, False);
+#ifdef XFT
+#else
+	if(dc.font.set)
+		XFreeFontSet(dpy, dc.font.set);
+	else
+		XFreeFont(dpy, dc.font.xfont);
+#endif
 	XUngrabKey(dpy, AnyKey, AnyModifier, root);
 	XFreePixmap(dpy, dc.drawable);
 	XFreeGC(dpy, dc.gc);
@@ -720,7 +748,11 @@
 drawbar(Monitor *m) {
 	int x;
 	unsigned int i, occ = 0, urg = 0;
+#ifdef XFT
 	XftColor *col;
+#else
+	unsigned long *col;
+#endif
 	Client *c;
 
 	for(c = m->clients; c; c = c->next) {
@@ -775,10 +807,18 @@
 }
 
 void
+#ifdef XFT
 drawsquare(Bool filled, Bool empty, Bool invert, XftColor col[ColLast]) {
+#else
+drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]) {
+#endif
 	int x;
 
+#ifdef XFT
 	XSetForeground(dpy, dc.gc, col[invert ? ColBG : ColFG].pixel);
+#else
+	XSetForeground(dpy, dc.gc, col[invert ? ColBG : ColFG]);
+#endif
 	x = (dc.font.ascent + dc.font.descent + 2) / 4;
 	if(filled)
 		XFillRectangle(dpy, dc.drawable, dc.gc, dc.x+1, dc.y+1, x+1, x+1);
@@ -787,12 +827,22 @@
 }
 
 void
+#ifdef XFT
 drawtext(const char *text, XftColor col[ColLast], Bool invert) {
+#else
+drawtext(const char *text, unsigned long col[ColLast], Bool invert) {
+#endif
 	char buf[256];
 	int i, x, y, h, len, olen;
+#ifdef XFT
 	XftDraw *d;
+#endif
 
+#ifdef XFT
 	XSetForeground(dpy, dc.gc, col[invert ? ColFG : ColBG].pixel);
+#else
+	XSetForeground(dpy, dc.gc, col[invert ? ColFG : ColBG]);
+#endif
 	XFillRectangle(dpy, dc.drawable, dc.gc, dc.x, dc.y, dc.w, dc.h);
 	if(!text)
 		return;
@@ -807,11 +857,19 @@
 	memcpy(buf, text, len);
 	if(len < olen)
 		for(i = len; i && i > len - 3; buf[--i] = '.');
+#ifdef XFT
 
 	d = XftDrawCreate(dpy, dc.drawable, DefaultVisual(dpy, screen), DefaultColormap(dpy,screen));
 
 	XftDrawStringUtf8(d, &col[invert ? ColBG : ColFG], dc.font.xfont, x, y, (XftChar8 *) buf, len);
 	XftDrawDestroy(d);
+#else
+	XSetForeground(dpy, dc.gc, col[invert ? ColBG : ColFG]);
+	if(dc.font.set)
+		XmbDrawString(dpy, dc.drawable, dc.font.set, dc.gc, x, y, buf, len);
+	else
+		XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len);
+#endif
 }
 
 void
@@ -857,7 +915,11 @@
 		detachstack(c);
 		attachstack(c);
 		grabbuttons(c, True);
+#ifdef XFT
 		XSetWindowBorder(dpy, c->win, dc.sel[ColBorder].pixel);
+#else
+		XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]);
+#endif
 		setfocus(c);
 	}
 	else {
@@ -931,14 +993,32 @@
 	return atom;
 }
 
+#ifdef XFT
 XftColor 
+#else
+unsigned long
+#endif
 getcolor(const char *colstr) {
+#ifdef XFT
 	XftColor color;
+#else
+	Colormap cmap = DefaultColormap(dpy, screen);
+	XColor color;
+#endif
 
+#ifdef XFT
 	if(!XftColorAllocName(dpy, DefaultVisual(dpy, screen), DefaultColormap(dpy, screen), colstr, &color))
+#else
+	if(!XAllocNamedColor(dpy, cmap, colstr, &color, &color))
+#endif
 		die("error, cannot allocate color '%s'\n", colstr);
 
+#ifdef XFT
+
 	return color;
+#else
+return color.pixel;
+#endif
 }
 
 Bool
@@ -1040,12 +1120,44 @@
 void
 initfont(const char *fontstr) {
 
+#ifdef XFT
 	if(!(dc.font.xfont = XftFontOpenName(dpy,screen,fontstr))
 	&& !(dc.font.xfont = XftFontOpenName(dpy,screen,"fixed")))
 		die("error, cannot load font: '%s'\n", fontstr);
 
 	dc.font.ascent = dc.font.xfont->ascent;
 	dc.font.descent = dc.font.xfont->descent;
+#else
+	char *def, **missing;
+	int n;
+ 
+	dc.font.set = XCreateFontSet(dpy, fontstr, &missing, &n, &def);
+	if(missing) {
+		while(n--)
+			fprintf(stderr, "dwm: missing fontset: %s\n", missing[n]);
+		XFreeStringList(missing);
+	}
+	if(dc.font.set) {
+		XFontStruct **xfonts;
+		char **font_names;
+
+		dc.font.ascent = dc.font.descent = 0;
+		XExtentsOfFontSet(dc.font.set);
+		n = XFontsOfFontSet(dc.font.set, &xfonts, &font_names);
+		while(n--) {
+			dc.font.ascent = MAX(dc.font.ascent, (*xfonts)->ascent);
+			dc.font.descent = MAX(dc.font.descent,(*xfonts)->descent);
+			xfonts++;
+		}
+	}
+	else {
+		if(!(dc.font.xfont = XLoadQueryFont(dpy, fontstr))
+		&& !(dc.font.xfont = XLoadQueryFont(dpy, "fixed")))
+			die("error, cannot load font: '%s'\n", fontstr);
+		dc.font.ascent = dc.font.xfont->ascent;
+		dc.font.descent = dc.font.xfont->descent;
+	}
+#endif
 	dc.font.height = dc.font.ascent + dc.font.descent;
 }
 
@@ -1127,7 +1239,11 @@
 
 	wc.border_width = c->bw;
 	XConfigureWindow(dpy, w, CWBorderWidth, &wc);
+#ifdef XFT
 	XSetWindowBorder(dpy, w, dc.norm[ColBorder].pixel);
+#else
+	XSetWindowBorder(dpy, w, dc.norm[ColBorder]);
+#endif
 	configure(c); /* propagates border_width, if size doesn't change */
 	updatewindowtype(c);
 	updatesizehints(c);
@@ -1616,6 +1732,11 @@
 	dc.drawable = XCreatePixmap(dpy, root, DisplayWidth(dpy, screen), bh, DefaultDepth(dpy, screen));
 	dc.gc = XCreateGC(dpy, root, 0, NULL);
 	XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
+#ifdef XFT
+#else
+	if(!dc.font.set)
+	XSetFont(dpy, dc.gc, dc.font.xfont->fid);
+#endif
 	/* init bars */
 	updatebars();
 	updatestatus();
@@ -1686,9 +1807,18 @@
 
 int
 textnw(const char *text, unsigned int len) {
+#ifdef XFT
 	XGlyphInfo ext;
 	XftTextExtentsUtf8(dpy, dc.font.xfont, (XftChar8 *) text, len, &ext);
 	return ext.xOff;
+#else
+	XRectangle r;
+	if(dc.font.set) {
+		XmbTextExtents(dc.font.set, text, len, NULL, &r);
+		return r.width;
+	}
+	return XTextWidth(dc.font.xfont, text, len);
+#endif
 }
 
 void
@@ -1768,7 +1898,11 @@
 	if(!c)
 		return;
 	grabbuttons(c, False);
+#ifdef XFT
 	XSetWindowBorder(dpy, c->win, dc.norm[ColBorder].pixel);
+#else
+	XSetWindowBorder(dpy, c->win, dc.norm[ColBorder]);
+#endif
 	if(setfocus) {
 		XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
 		XDeleteProperty(dpy, root, netatom[NetActiveWindow]);

Last edited by Ypnose (2012-11-11 20:16:44)


Github -- My terminal font Envypn

Offline

#987 2012-11-11 20:40:40

Crunch
Member
From: -+-
Registered: 2011-02-17
Posts: 56

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

@la11111

Couple of hunks failed on vanilla 6.0-1, but easy fix and I must say I like it. Definitely makes things easier than using the regular statuscolors if you want more than a few colors. I just might have to play with it a bit now tongue


Registered Linux user #536591.

Offline

#988 2012-11-11 22:12:42

kuraku
Member
From: planet Earth
Registered: 2012-01-03
Posts: 202

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

Is there a patch that can make dwm to overlap borders of clients in tile mode?

Offline

#989 2012-11-11 22:28:52

la11111
Member
Registered: 2012-11-11
Posts: 11

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

Nice smile It patches fine on vanilla 5.9 and 6, but that's all I've tested with. did you pull 6.0-1 from hg?

I can do a better job of putting it together probably, since modifications to the original code are so minimal.

I also added it to the wiki under dwm/patches/ansistatuscolors.

Offline

#990 2012-11-13 05:16:13

la11111
Member
Registered: 2012-11-11
Posts: 11

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

Well, I fixed it to patch better on 6&up - also fixed a pretty serious memory leak - dwm's not supposed to be using 400MB of memory ... oops!

Offline

#991 2012-11-14 10:53:11

Pranavg1890
Member
From: Nagpur,India
Registered: 2012-09-07
Posts: 114

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

Hi, can anyone suggest me a patch which allows the selection of windows using dmenu in dwm just like in musca wm?


Using Openbox + Tint2 + Idesk

Offline

#992 2012-11-18 16:00:05

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

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

@Unia

How to fix the systray patch on monocle mode?


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

Offline

#993 2012-11-18 16:18:20

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

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

ivoarch wrote:

@Unia

How to fix the systray patch on monocle mode?

You mean that little border underneath it? I'm not sure what would be a clean way to remove that. A dirty fix would be to set the border color in monocle mode the same as normal background color.


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

#994 2012-11-18 16:27:31

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

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

Ok thanks dude!!
I will see another way to make it.


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

Offline

#995 2012-11-18 16:38:56

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

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

ivoarch wrote:

Ok thanks dude!!
I will see another way to make it.

Please share if you do! wink


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

#996 2012-11-19 18:17:55

illusionist
Member
From: localhost
Registered: 2012-04-03
Posts: 498

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

@Unia,
I saw the transparent bar patch in your repo and the commit message related to it. I modified the patch little bit. Now you can set the transparency in config.h. But there are some (maybe one) issue.
1) It needs composite manager. (which is obvious since we are setting the window property )
2) The systray patch needs to be modified to work with transparency.

Here is the patch :
Patch
and put this in config.h
static const float opacity    = 0.60;    ( max 0.75 )

Let me know what you think about it. smile

Last edited by illusionist (2012-11-19 18:19:19)


  Never argue with stupid people,They will drag you down to their level and then beat you with experience.--Mark Twain
@github

Offline

#997 2012-11-19 18:57:40

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

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

illusionist wrote:

@Unia,
I saw the transparent bar patch in your repo and the commit message related to it. I modified the patch little bit. Now you can set the transparency in config.h. But there are some (maybe one) issue.
1) It needs composite manager. (which is obvious since we are setting the window property )
2) The systray patch needs to be modified to work with transparency.

Here is the patch :
Patch
and put this in config.h
static const float opacity    = 0.60;    ( max 0.75 )

Let me know what you think about it. smile

Perfect! Before I set a color with 0x00000000 syntax, but it was confusing and didn't always give the desired result.

One question though; does this also make the text transparent? On my version it does (and I think this one too) and I was meaning to look into it. It does. Is there any way possible to not make the text transparent? That would make this patch perfect! smile

EDIT: And I know about the systray. In my previous version (which used pseudo-transparency) I messed with it but it's complicated. With this patch it should be easier, seeing the system tray is made with an XCreateSimpleWindow command. I think that means it's just another window just like the statusbar; so I think you can apply the same lines.

EDIT2: Here's one with a working transparent system tray: https://gist.github.com/4113641

Right now I use the unsigned long real_opacity[] = { opacity * 0xffffffff }; line twice. I think it's cleaner if we use this only once and place it in a common part of the code. I don't where this would go, though. Anyone?

Last edited by Unia (2012-11-19 20:28:33)


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

#998 2012-11-19 21:27:16

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

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

ivoarch wrote:

Ok thanks dude!!
I will see another way to make it.

I found out why the little border appears. The fix I use for not displaying a border in monocle mode, simply moves the border "out of display": the left, right and bottom border dissapear off-screen and the top border gets moved under the statusbar. The systray picks this up and displays it regardless.

When you use the single_window_no_border patch found on numerous places (OK100's GitHub, for example) it doesn't display a border under the system tray on monocle mode. However, I do have some other issues with this patch.

Is there a simple approach to just not draw any border only when in monocle mode, instead of drawing them off-screen? The single_window_no_border patch comes close, but also removes borders when there's one client in any other layout and when I remove those lines, it doesn't restore a border when I float the window or change layout from monocle. Who can help me fix that?

Last edited by Unia (2012-11-19 21:28:59)


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

#999 2012-11-19 21:41:51

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

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

Unia wrote:

Is there any way possible to not make the text transparent?

Not with transparent window hint method.  There are three (relevant) transparency methods each with pros and cons:
1) pseudotransparency, which we worked through over email.  This allows for the background to appear transparent while the text is full strenght.  But this takes more code to set up, and it is harder to implement semi-transparent effects.

2) Managed "True" transparency.  This is what you are currently using.  This is easy to set up, but requries a composite manager to be running and it makes everything (including text) transparent/translucent.

3) Client "True" transparency.  This is implemented through an alpha layer visual implemented within the client program (your dwm patch).  This takes a good bit more coding (AFAIK - I haven't used this method).  But this would allow for semi-transparent backgrounds but full strength text.


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

Offline

#1000 2012-11-19 21:43:22

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

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

^ I see. Other tilers (at least Awesome, and I think Subtle too) do allow transparent statusbars without making the text transparent too. Do you know which method they use?


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

Board footer

Powered by FluxBB