[wiki] [sites] wiki updated
changeset: 377:e17abe0c0b2e
tag: tip
user: Stefan Mark <0mark_AT_unserver.de>
date: Tue Nov 24 23:55:23 2009 +0100
files: dwm.suckless.org/patches/dwm-transparency.diff dwm.suckless.org/patches/transparency.md
description:
added transparency patch
diff -r 5cd3a9537ee0 -r e17abe0c0b2e dwm.suckless.org/patches/dwm-transparency.diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm.suckless.org/patches/dwm-transparency.diff Tue Nov 24 23:55:23 2009 +0100
_AT_@ -0,0 +1,115 @@
+diff -up -x '.*' ../../dwm-upstream/config.def.h ./config.def.h
+--- ../../dwm-upstream/config.def.h 2009-11-10 00:08:09.000000000 +0100
++++ ./config.def.h 2009-11-24 22:59:19.000000000 +0100
+_AT_@ -10,6 +10,7 @@ static const char selbgcolor[] = "#
+ static const char selfgcolor[] = "#ffffff";
+ static const unsigned int borderpx = 1; /* border pixel of windows */
+ static const unsigned int snap = 32; /* snap pixel */
++static const double shade = 0.6; /* opacity of unfocussed clients */
+ static const Bool showbar = True; /* False means no bar */
+ static const Bool topbar = True; /* False means bottom bar */
+
+_AT_@ -17,9 +18,10 @@ static const Bool topbar = Tr
+ static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
+
+ static const Rule rules[] = {
+- /* class instance title tags mask isfloating monitor */
+- { "Gimp", NULL, NULL, 0, True, -1 },
+- { "Firefox", NULL, NULL, 1 << 8, False, -1 },
++ /* class instance title tags mask isfloating monitor opacity */
++ { "Gimp", NULL, NULL, 0, True, -1, -1 },
++ { "Firefox", NULL, NULL, 1 << 8, False, -1, -1 },
++ { "URxvt", NULL, NULL, 0, False, -1, 0.95 },
+ };
+
+ /* layout(s) */
+diff -up -x '.*' ../../dwm-upstream/dwm.c ./dwm.c
+--- ../../dwm-upstream/dwm.c 2009-11-10 00:08:09.000000000 +0100
++++ ./dwm.c 2009-11-24 23:29:22.000000000 +0100
+_AT_@ -57,7 +57,7 @@
+ /* enums */
+ enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
+ enum { ColBorder, ColFG, ColBG, ColLast }; /* color */
+-enum { NetSupported, NetWMName, NetLast }; /* EWMH atoms */
++enum { NetSupported, NetWMName, NetWMWindowOpacity, NetLast }; /* EWMH atoms */
+ enum { WMProtocols, WMDelete, WMState, WMLast }; /* default atoms */
+ enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle,
+ ClkClientWin, ClkRootWin, ClkLast }; /* clicks */
+_AT_@ -91,6 +91,7 @@ struct Client {
+ Client *snext;
+ Monitor *mon;
+ Window win;
++ double opacity;
+ };
+
+ typedef struct {
+_AT_@ -147,6 +148,7 @@ typedef struct {
+ unsigned int tags;
+ Bool isfloating;
+ int monitor;
++ double opacity;
+ } Rule;
+
+ /* function declarations */
+_AT_@ -176,6 +178,7 @@ static void drawsquare(Bool filled, Bool
+ static void drawtext(const char *text, unsigned long col[ColLast], Bool invert);
+ static void enternotify(XEvent *e);
+ static void expose(XEvent *e);
++static void window_opacity_set(Client *c, double opacity);
+ static void focus(Client *c);
+ static void focusin(XEvent *e);
+ static void focusmon(const Arg *arg);
+_AT_@ -297,6 +300,7 @@ applyrules(Client *c) {
+ && (!r->instance || strstr(instance, r->instance)))
+ {
+ c->isfloating = r->isfloating;
++ c->opacity = r->opacity;
+ c->tags |= r->tags;
+ for(m = mons; m && m->num != r->monitor; m = m->next);
+ if(m)
+_AT_@ -811,7 +815,20 @@ expose(XEvent *e) {
+ }
+
+ void
++window_opacity_set(Client *c, double opacity)
++{
++ if(opacity >= 0 && opacity <= 1)
++ {
++ unsigned long real_opacity[] = { opacity * 0xffffffff };
++ XChangeProperty(dpy, c->win, netatom[NetWMWindowOpacity], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)real_opacity, 1);
++ }
++ else
++ XDeleteProperty(dpy, c->win, netatom[NetWMWindowOpacity]);
++}
++
++void
+ focus(Client *c) {
++ if(selmon->sel) window_opacity_set(selmon->sel, shade);
+ if(!c || !ISVISIBLE(c))
+ for(c = selmon->stack; c && !ISVISIBLE(c); c = c->snext);
+ if(selmon->sel)
+_AT_@ -831,6 +848,7 @@ focus(Client *c) {
+ XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
+ selmon->sel = c;
+ drawbars();
++ if(c) window_opacity_set(c, c->opacity);
+ }
+
+ void
+_AT_@ -1100,6 +1118,7 @@ manage(Window w, XWindowAttributes *wa)
+ updatetitle(c);
+ if(XGetTransientForHint(dpy, w, &trans))
+ t = wintoclient(trans);
++ c->opacity=-1;
+ if(t) {
+ c->mon = t->mon;
+ c->tags = t->tags;
+_AT_@ -1493,6 +1512,7 @@ setup(void) {
+ wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False);
+ netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False);
+ netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False);
++ netatom[NetWMWindowOpacity] = XInternAtom(dpy, "_NET_WM_WINDOW_OPACITY", False);
+ /* init cursors */
+ cursor[CurNormal] = XCreateFontCursor(dpy, XC_left_ptr);
+ cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing);
+Nur in ./: transp.diff.
diff -r 5cd3a9537ee0 -r e17abe0c0b2e dwm.suckless.org/patches/transparency.md
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm.suckless.org/patches/transparency.md Tue Nov 24 23:55:23 2009 +0100
_AT_@ -0,0 +1,17 @@
+# transparency
+
+## Description
+
+This patch provides rudimentary experimentel transparency (xcompmgr needed).
+Opacity is set for every not focused client, and also for focused client
+when a rule is found.
+
+This patch is very experimental. There are Bugs.
+
+## Download
+
+ * [dwm-transparency.diff](dwm-transparency.diff) (dwm 5.7.2) (20091124)
+
+## Author
+
+ * Stefan Mark - <0mark_AT_unserver.de>
Received on Tue Nov 24 2009 - 23:54:24 CET
This archive was generated by hypermail 2.3.0
: Thu Sep 13 2012 - 19:31:00 CEST