You are not logged in.

#1376 2014-09-04 20:25:15

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

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

Unia wrote:
ANOKNUSA wrote:

So I've been sloppily trying to get a couple things working, and my near-nonexistent C skills and knowledge have left me stumped. The first thing is this centerclock patch; I'd like the clock to be displayed on the far right of the statusbar---next to the status text---and leave the maximum width of the section at the number of characters in the clock text. I haven't quite figured out how to draw the clock text in its own section rather than replacing the status or window title text.

The second thing is to just change the window border color from dc.sel[ColBorder] to dc.norm[ColBG] in the monocle layout, to match the statusbar. This removes the visual distraction of the border, but leaves a few pixels of padding around the screen edge and below the statusbar text. If I've only got one window visible I'm in monocle mode anyway, so something like the better-borders and noborders patches seems like overkill. I've sort of figured out how this might work, but nothing reliable.  Like I said, I don't really grok C.

I'm using dwm 6.0. I've been fumbling around with this for two days, so if anyone's got some pointers, or is willing to make those modifications, I'd be grateful.

I could come up with something in the next week or so, maybe next two weeks. University is starting again on monday, so I have some others things to take care of first.

Thanks, Unia. I just started up class myself (hence my late reply), so I totally understand. tongue

Offline

#1377 2014-09-09 22:59:21

grimpirate
Member
Registered: 2011-10-26
Posts: 47

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

This patch basically enables transparent window moving/resizing. It was taken from here. I also further modified it to accept runtime parameters for the font and six colors, so as to allow runtime modification of the color scheme. Sloppy, because I'm not so well-versed in C.

--- dwm.c	2011-12-19 09:38:30.000000000 -0500
+++ dwm.c	2014-09-09 18:27:48.490434427 -0400
@@ -103,6 +103,7 @@
 	unsigned long sel[ColLast];
 	Drawable drawable;
 	GC gc;
+	GC invert_gc;
 	struct {
 		int ascent;
 		int descent;
@@ -178,6 +179,7 @@
 static Monitor *dirtomon(int dir);
 static void drawbar(Monitor *m);
 static void drawbars(void);
+static void drawoutline(int x, int y, int w, int h, int bw);
 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);
 static void enternotify(XEvent *e);
@@ -220,7 +222,7 @@
 static void setfullscreen(Client *c, Bool fullscreen);
 static void setlayout(const Arg *arg);
 static void setmfact(const Arg *arg);
-static void setup(void);
+static void setup(int argdcc, char *argdcv[]);
 static void showhide(Client *c);
 static void sigchld(int unused);
 static void spawn(const Arg *arg);
@@ -492,6 +494,7 @@
 	XUngrabKey(dpy, AnyKey, AnyModifier, root);
 	XFreePixmap(dpy, dc.drawable);
 	XFreeGC(dpy, dc.gc);
+	XFreeGC(dpy, dc.invert_gc);
 	XFreeCursor(dpy, cursor[CurNormal]);
 	XFreeCursor(dpy, cursor[CurResize]);
 	XFreeCursor(dpy, cursor[CurMove]);
@@ -774,6 +777,13 @@
 }
 
 void
+drawoutline(int x, int y, int w, int h, int bw){
+	XDrawRectangle(dpy, root, dc.invert_gc,
+		x-bw, y-bw,
+		w+2*bw-1, h+2*bw-1);
+}
+
+void
 drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]) {
 	int x;
 
@@ -1221,6 +1231,7 @@
 void
 movemouse(const Arg *arg) {
 	int x, y, ocx, ocy, nx, ny;
+	Bool first;
 	Client *c;
 	Monitor *m;
 	XEvent ev;
@@ -1228,13 +1239,14 @@
 	if(!(c = selmon->sel))
 		return;
 	restack(selmon);
-	ocx = c->x;
-	ocy = c->y;
+	nx = ocx = c->x;
+	ny = ocy = c->y;
 	if(XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync,
 	None, cursor[CurMove], CurrentTime) != GrabSuccess)
 		return;
 	if(!getrootptr(&x, &y))
 		return;
+	first = True;
 	do {
 		XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev);
 		switch(ev.type) {
@@ -1244,6 +1256,10 @@
 			handler[ev.type](&ev);
 			break;
 		case MotionNotify:
+			if(!first){
+				drawoutline(nx, ny, c->w, c->h, c->bw); /* clear */
+				XUngrabServer(dpy);
+			}
 			nx = ocx + (ev.xmotion.x - x);
 			ny = ocy + (ev.xmotion.y - y);
 			if(nx >= selmon->wx && nx <= selmon->wx + selmon->ww
@@ -1260,11 +1276,20 @@
 				&& (abs(nx - c->x) > snap || abs(ny - c->y) > snap))
 					togglefloating(NULL);
 			}
-			if(!selmon->lt[selmon->sellt]->arrange || c->isfloating)
-				resize(c, nx, ny, c->w, c->h, True);
+			if(!selmon->lt[selmon->sellt]->arrange || c->isfloating){
+				if(!first) XSync(dpy, False);
+				XGrabServer(dpy);
+				drawoutline(nx, ny, c->w, c->h, c->bw);
+				first = False;
+			}
 			break;
 		}
 	} while(ev.type != ButtonRelease);
+	if(!first){
+		drawoutline(nx, ny, c->w, c->h, c->bw);	/* clear */
+		XUngrabServer(dpy);
+		if(nx != ocx || ny != ocy) resize(c, nx, ny, c->w, c->h, True);
+	}
 	XUngrabPointer(dpy, CurrentTime);
 	if((m = recttomon(c->x, c->y, c->w, c->h)) != selmon) {
 		sendmon(c, m);
@@ -1363,8 +1388,9 @@
 
 void
 resizemouse(const Arg *arg) {
-	int ocx, ocy;
+	int ocx, ocy, ocw, och;
 	int nw, nh;
+	Bool first;
 	Client *c;
 	Monitor *m;
 	XEvent ev;
@@ -1374,10 +1400,13 @@
 	restack(selmon);
 	ocx = c->x;
 	ocy = c->y;
+	ocw = nw = c->w;
+	och = nh = c->h;
 	if(XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync,
 	                None, cursor[CurResize], CurrentTime) != GrabSuccess)
 		return;
 	XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1);
+	first = True;
 	do {
 		XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev);
 		switch(ev.type) {
@@ -1387,6 +1416,10 @@
 			handler[ev.type](&ev);
 			break;
 		case MotionNotify:
+			if(!first){
+				drawoutline(c->x, c->y, nw, nh, c->bw);	/* clear */
+				XUngrabServer(dpy);
+			}
 			nw = MAX(ev.xmotion.x - ocx - 2 * c->bw + 1, 1);
 			nh = MAX(ev.xmotion.y - ocy - 2 * c->bw + 1, 1);
 			if(c->mon->wx + nw >= selmon->wx && c->mon->wx + nw <= selmon->wx + selmon->ww
@@ -1396,11 +1429,20 @@
 				&& (abs(nw - c->w) > snap || abs(nh - c->h) > snap))
 					togglefloating(NULL);
 			}
-			if(!selmon->lt[selmon->sellt]->arrange || c->isfloating)
-				resize(c, c->x, c->y, nw, nh, True);
+			if(!selmon->lt[selmon->sellt]->arrange || c->isfloating){
+				if(!first) XSync(dpy, False);
+				XGrabServer(dpy);
+				drawoutline(c->x, c->y, nw, nh, c->bw);
+				first = False;
+			}
 			break;
 		}
 	} while(ev.type != ButtonRelease);
+	if(!first){
+		drawoutline(c->x, c->y, nw, nh, c->bw);	/* clear */
+		XUngrabServer(dpy);
+		if(nw != ocw || nh != och) resize(c, c->x, c->y, nw, nh, True);
+	}
 	XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1);
 	XUngrabPointer(dpy, CurrentTime);
 	while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
@@ -1581,8 +1623,9 @@
 }
 
 void
-setup(void) {
+setup(int argdcc, char *argdcv[]) {
 	XSetWindowAttributes wa;
+	XGCValues gv;
 
 	/* clean up any zombies immediately */
 	sigchld(0);
@@ -1590,7 +1633,10 @@
 	/* init screen */
 	screen = DefaultScreen(dpy);
 	root = RootWindow(dpy, screen);
-	initfont(font);
+	if(argdcc == 8)
+		initfont(argdcv[1]);
+	else
+		initfont(font);
 	sw = DisplayWidth(dpy, screen);
 	sh = DisplayHeight(dpy, screen);
 	bh = dc.h = dc.font.height + 2;
@@ -1612,17 +1658,32 @@
 	cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing);
 	cursor[CurMove] = XCreateFontCursor(dpy, XC_fleur);
 	/* init appearance */
-	dc.norm[ColBorder] = getcolor(normbordercolor);
-	dc.norm[ColBG] = getcolor(normbgcolor);
-	dc.norm[ColFG] = getcolor(normfgcolor);
-	dc.sel[ColBorder] = getcolor(selbordercolor);
-	dc.sel[ColBG] = getcolor(selbgcolor);
-	dc.sel[ColFG] = getcolor(selfgcolor);
+	if(argdcc == 8) {
+		dc.norm[ColBorder] = getcolor(argdcv[2]);
+		dc.norm[ColBG] = getcolor(argdcv[3]);
+		dc.norm[ColFG] = getcolor(argdcv[4]);
+		dc.sel[ColBorder] = getcolor(argdcv[5]);
+		dc.sel[ColBG] = getcolor(argdcv[6]);
+		dc.sel[ColFG] = getcolor(argdcv[7]);
+	} else {
+		dc.norm[ColBorder] = getcolor(normbordercolor);
+		dc.norm[ColBG] = getcolor(normbgcolor);
+		dc.norm[ColFG] = getcolor(normfgcolor);
+		dc.sel[ColBorder] = getcolor(selbordercolor);
+		dc.sel[ColBG] = getcolor(selbgcolor);
+		dc.sel[ColFG] = getcolor(selfgcolor);
+	}
 	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);
 	if(!dc.font.set)
 		XSetFont(dpy, dc.gc, dc.font.xfont->fid);
+
+	gv.function = GXinvert;
+	gv.subwindow_mode = IncludeInferiors;
+	gv.line_width = 1;	/* opt_bw */
+	dc.invert_gc = XCreateGC(dpy, root, GCFunction | GCSubwindowMode | GCLineWidth, &gv);
+
 	/* init bars */
 	updatebars();
 	updatestatus();
@@ -2130,14 +2191,14 @@
 main(int argc, char *argv[]) {
 	if(argc == 2 && !strcmp("-v", argv[1]))
 		die("dwm-"VERSION", © 2006-2011 dwm engineers, see LICENSE for details\n");
-	else if(argc != 1)
-		die("usage: dwm [-v]\n");
+	else if(argc != 1 && argc != 8)
+		die("usage: dwm [-v]\n       dwm [fn nr nb nf sr sb sf]\n");
 	if(!setlocale(LC_CTYPE, "") || !XSupportsLocale())
 		fputs("warning: no locale support\n", stderr);
 	if(!(dpy = XOpenDisplay(NULL)))
 		die("dwm: cannot open display\n");
 	checkotherwm();
-	setup();
+	setup(argc, argv);
 	scan();
 	run();
 	cleanup();

Offline

#1378 2014-09-10 20:32:54

fixles
Member
Registered: 2012-09-15
Posts: 101

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

Hello, Does anyone have a dwm 6.0 patch that will patch cleanly against dwm.c? I've been searching for 2 days and it's driving me crazy.

Offline

#1379 2014-09-10 21:20:53

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

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

fixles wrote:

Hello, Does anyone have a dwm 6.0 patch that will patch cleanly against dwm.c?

You'll have to clarify. This doesn't make any sense.

Offline

#1380 2014-09-10 21:48:05

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

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

Indeed, saying *what* patch you want that is patched against 6.0 would be a minimum requirement.  But in most cases, I'd bet you could find it on Unia's github page.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#1381 2014-09-11 18:46:42

nenesse
Member
Registered: 2011-11-19
Posts: 10
Website

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

config.h

#define DEFAULT_TAG             1 << 3
#define SEL_TARGET_TAG          Yes

dwm.c

--- /usr/local/src/dwm-6.0/dwm.def.c    2011-12-19 16:02:46.000000000 +0100
+++ /usr/local/src/dwm-6.0/dwm.c        2014-09-11 19:54:04.068324442 +0200
@@ -322,7 +322,17 @@
                XFree(ch.res_class);
        if(ch.res_name)
                XFree(ch.res_name);
-       c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : c->mon->tagset[c->mon->seltags];
+
+        #ifdef DEFAULT_TAG
+                c->tags = c->tags == 0 ? DEFAULT_TAG
+                        : c->tags & TAGMASK ? c->tags & TAGMASK : c->mon->tagset[c->mon->seltags];
+        #else
+                c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : c->mon->tagset[c->mon->seltags];
+        #endif
+
+        #ifdef SEL_TARGET_TAG
+                c->mon->tagset[c->mon->seltags] = c->tags;
+        #endif
 }
 
 Bool

Hello,

If you do not set DEFAULT_TAG and SEL_TARGET_TAG, this patch does not change the module, just the source program.

DEFAULT_TAG used to start all programs without rules on the same tag, not on the current tag.
SEL_TARGET_TAG switches to the target tag, when you assign rules to run a command or DEFAULT_TAG is not the current tag.

example:
I run an android-like menu with lots of icons on the tag 1, applications are on others tags. DWM becomes usable by end users.

I hope I did it the right way.

Last edited by nenesse (2014-09-11 19:08:51)

Offline

#1382 2014-09-12 19:23:01

i_love_penguins
Member
From: Germany
Registered: 2010-03-30
Posts: 46
Website

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

Silly question: why are there patches for version 6.1 if the latest official version is 6.0?

Offline

#1383 2014-09-12 19:27:47

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

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

6.1 will be the release of the code that is now available on github: http://git.suckless.org/dwm/

@ANOKNUSA: Sorry, it's going to take longer sad I literally have zero free time on my hands, and it's likely to remain the same for the coming eight weeks. I'll whip something up as soon as I can, perhaps I can squeeze in a little time in a lunch break or something.

Last edited by Unia (2014-09-12 19:29: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

#1384 2014-09-20 11:49:12

defer
Member
From: Finland
Registered: 2013-06-25
Posts: 46
Website

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

Is it possible to set dwm to change next or previous tag on MODKEY+XK_Left or MODKEY+XK_Right?

Offline

#1385 2014-09-20 18:05:33

Vain
Member
Registered: 2008-10-19
Posts: 179
Website

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

`nextprev` or `shiftview` might be what you're looking for:

http://dwm.suckless.org/patches/nextprev

Offline

#1386 2014-09-20 19:27:18

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

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

@Unia: Don't go out of your way on my account. It's not like these are essential features I need or anything; they're both basically cosmetic. Like I said, I understand your situation; I myself am on page #13 of the twenty or so pages I need to have written for university by Monday. wink

Offline

#1387 2014-09-20 19:47:46

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

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

ANOKNUSA wrote:

@Unia: Don't go out of your way on my account. It's not like these are essential features I need or anything; they're both basically cosmetic. Like I said, I understand your situation; I myself am on page #13 of the twenty or so pages I need to have written for university by Monday. wink

I'm making programming sessions till 1 or 2 AM to make my deadline by sunday. At the same time I'm three chapters behind with math... Busy weeks!


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

#1388 2014-09-20 20:24:37

defer
Member
From: Finland
Registered: 2013-06-25
Posts: 46
Website

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

Vain wrote:

`nextprev` or `shiftview` might be what you're looking for:

http://dwm.suckless.org/patches/nextprev

Thanks! shiftview does exactly what i want. smile

Offline

#1389 2014-09-20 21:40:39

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

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

Unia wrote:

I'm three chapters behind with math...

You have my sympathies. tongue

Offline

#1390 2014-09-23 14:25:01

defer
Member
From: Finland
Registered: 2013-06-25
Posts: 46
Website

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

Is there any other tiling layouts for dwm-git? I couldn't find bottom stack path for dwm-git w/ pertag.

Offline

#1391 2014-09-23 17:34:47

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

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

The dwm version mentioned in the patch name refers more relevantly to the version of dwm against which the patch was made, than it does the version with which the patch works. Most layout patches add code rather than modifying existing code, so they'll probably work with 6.1 regardless of the version in the patch name (and there are some 6.1 patches that work fine with 6.0). Aside from the reimplemented graphics drawing code in 6.1, dwm hasn't really changed in the last couple years. Just back up your config (or stash your changes using Git) and try the patches out.

Offline

#1392 2014-10-02 08:54:55

linux-ka
Member
From: ADL
Registered: 2010-05-07
Posts: 232

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

Hi,

I am actually using DWM with two monitors. Is it somehow possible to jump to active windows on the other monitor as it is possible via Mod-Tab on the very same monitor?

Cheers,

L-K

Offline

#1393 2014-10-02 14:24:28

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

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

No. Each monitor uses its own independent tag set. If windows aren't in a monitor's tag set, they can't be shown on that monitor, and the window manager can't interact with them.

Offline

#1394 2014-10-06 10:32:15

Buumi
Member
Registered: 2010-05-04
Posts: 2

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

I already asked this on IRC but didn't receive a answer.
I'm trying DWM and I'm wondering if there's a simple way to highlight a tag when there's some activity in it. Like if Firefox opened a new tab then that tag would turn into some different colour. For example in Awesome tag turns into red in that case. I found http://jasonwryan.com/blog/2011/01/25/s … ts-in-dwm/ this but I think it only works for cli programs sending a bell. Is there some obvious way / patch I'm missing to make it work (in which case I'm sorry for the stupid question) or is that simply something not easily done in DWM?

Last edited by Buumi (2014-10-06 10:33:08)

Offline

#1395 2014-10-06 15:03:41

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

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

The urgency hints are what you are looking for, however I'm not sure Firefox sets it. Perhaps you need to query for another event? I know Skype (i.e. Qt) uses its own, one that the standard urgency patch does not do. You can find the patch on how to include it here: https://github.com/Unia/dwm-patches/blo … ntion.diff

That, in combination with the patch you linked to, should give you urgency hints for Qt applications. It shouldn't be too hard to also include Firefox's hint, you just have to find out how it sets it.


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

#1396 2015-01-14 22:53:43

wildfowl
Banned
Registered: 2014-10-16
Posts: 82

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

Just a quick query about coloring the text on the dwm bar via the shell syntax. This person's apperantly managed to do it without applying any patches.
I wish to follow the same procedure (without patching) as applying the patches breaks too many things in my config.

http://lists.suckless.org/dev/1105/7925.html

I've added the struct to the config.h file.

But if I try and invoke the color via \x02 or \x03 say I simply get a font change.

Here's my shell file.

#! /bin/bash

export DISPLAY=:0

while true; do

#BATT=$( acpi -b | sed 's/.*[charging|unknown], \([0-9]*\)%.*/\1/gi' )
#STATUS=$( acpi -b | sed 's/.*: \([a-zA-Z]*\),.*/\1/gi' )

CPU=$( grep 'cpu ' /proc/stat | awk '{printf("%.0f%%"), ($2+$3+$4+$6+$7+$8)*100/($2+$3+$4+$5+$6+$7+$8)}' )
MEM=$( free | grep Mem | awk '{printf("%.0f%%"),  $3/$2 * 100.0}' )
SWAPFS=$( cat /proc/swaps | grep -o [0-9]* | head -3 | tail -1 | awk '{GB=$1/=1048576; printf "%0.2fGB\n", $1}' )
ROOTFS=$( df | grep rootfs | grep -o [0-9]*% )
HOMEFS=$( df | grep '/home$' | grep -o [0-9]*% )
TMPFS=$( df | grep '/tmp' | grep -o [0-9]*% | head -n1 )
ESSID=$( /sbin/iwconfig wlan0 | grep -o \".*\" )
LINKQUALITY=$(grep 'wlan0' /proc/net/wireless | awk '{print $3}' | sed s/\\./%/)
IP=$( wget -q -O - http://ip.tupeux.com | tail)
#DOWNTOTAL=$(/sbin/ifconfig wlan0 | grep 'RX bytes' | awk '{print $3$4}')
#UPTOTAL=$(/sbin/ifconfig wlan0 | grep 'RX bytes' | awk '{print $7$8}')
DOWNTOTAL=$(grep 'wlan0' /proc/net/dev | awk '{printf("(%.1fG)"), $2/1024/1024/1024}')
UPTOTAL=$(grep 'wlan0' /proc/net/dev | awk '{printf("(%.1fG)"), $10/1024/1024/1024}')
RATE=$( awk '{if(l1){print $2-l1,$10-l2} else{l1=$2; l2=$10;}}' <(grep wlan0 /proc/net/dev) <(sleep 1; grep wlan0 /proc/net/dev))
DOWNRATE=$(echo $RATE | awk '{printf("%.0fK"), $1/1024}')
UPRATE=$(echo $RATE | awk '{printf("%.0fK"), $2/1024}')
BATT=$( acpi -b | grep -o [0-9]*% )
VOLSTATE=$( amixer sget Master | grep -o [[0-9][a-z]*] )
VOLLEVEL=$( amixer sget Master | grep -o [0-9]*% )

STRING="\u00c8 \x02 $CPU\
        \u00de $MEM\
        \u00c5 $SWAPFS\
        /$ROOTFS\
        ~$HOMEFS\
        /tmp $TMPFS\
        \u00c0 $ESSID ($LINKQUALITY) $IP\
        \u00d0 $DOWNRATE $DOWNTOTAL\
        \u00d1 $UPRATE $UPTOTAL\
        \u00c4 $BATT\
        \u00d5 $(date +"%l:%M %a %d %b")"

if [ $VOLSTATE == '[off]' ]; then
        STRING="$STRING \u00d4\u00d7"

else    STRING="$STRING \u00d4 $VOLLEVEL" 
fi

xsetroot -name "`echo -e $STRING`"

sleep 5

done &

Last edited by wildfowl (2015-01-14 22:56:56)

Offline

#1397 2015-01-15 10:17:33

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

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

wildfowl wrote:

Just a quick query about coloring the text on the dwm bar via the shell syntax. This person's apperantly managed to do it without applying any patches.
I wish to follow the same procedure (without patching) as applying the patches breaks too many things in my config.

The status bar text is printed without any processing using XDrawString (or XmbDrawString). As far as i know, neither supports color changing.  But your script fits to this patch:
http://dwm.suckless.org/patches/statuscolors
which allows to select from a small list of predefined colors. There are at least two other patches which allow for arbitrary color selection.


Ceterum autem censeo Systemdinem esse delendam

Offline

#1398 2015-01-22 10:39:35

jralphur
Member
Registered: 2013-03-04
Posts: 3

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

unia's statusbarcolors patch shifts the text whenever you change colors.

Offline

#1399 2015-01-22 16:59:50

botika
Member
Registered: 2013-07-12
Posts: 34

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

What do you think this, first spoke Castilian and my English is terrible so I apologize in advance and I'm working with git version.
Second the function incnmaster, has no control over selmon.master values, i.e., if we increase one we must subtract one to return to original and if we increased 200 we subtract those 200 to return to the original but have 2 windows. The problem is only to increase to decrease the MAX solve the problem. Then if you press 32769  times modkey + L, we have a nice error in execution.
I've thought about doing cyclical, as focusstack, and the number of stacks and number of positions are linear except for the case of one single, is n + 1 positions where n are the stacks. Therefore a mod (n + 1) we could do. But one problem arises, the tags do not have the same number of stacks. Therefore would have to change this value in view, toggleview ... or have one for each tag.
Just ask your review before putting it in the devmail suckless.
It is sufficient to increase the complexity? More solutions? Let me your opinions. Regards.

Offline

#1400 2015-02-08 13:05:00

spupy
Member
Registered: 2009-08-12
Posts: 218

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

Anyone heard of patch that introduces a jump list for tags? Similar to vim's jump list where I can press <C-o> to jump backwards in a list of visited positions. Right now I have a key for switching between the current and the last visited tag, but it's a bit uncomfortable to use with too many tags.


There are two types of people in this world - those who can count to 10 by using their fingers, and those who can count to 1023.

Offline

Board footer

Powered by FluxBB