You are not logged in.

#826 2012-09-14 16:50:05

ArchLinux
Member
Registered: 2012-06-09
Posts: 15

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

After I start Firefox, it takes 4 seconds before it shows up. Is there a way/patch to get some feedback (like the title bar showing "Starting Mozilla Firefox...")? Because otherwise I might think it doesn't start, and start a second instance.

Offline

#827 2012-09-14 17:05:13

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

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

ArchLinux, DWM does not have anything to do with that (nor would any window manager).  That is entirely the responsibility of the application.  DWM presents a window when firefox maps it.  If firefox takes a long time to map a window, DWM has nothing to do.  In fact, DWM wouldn't even know firefox is starting until the app maps a window.

One thing you could do if you really want something like this is write a wrapper for firefox that would create a temporary dialog (zenity or xdialog for example) fbefore starting firefox and close the dialog after a few seconds.


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

Offline

#828 2012-09-14 19:01:02

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

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

Trilby wrote:

One thing you could do if you really want something like this is write a wrapper ...that would create a temporary dialog (zenity or xdialog for example)

I really like your idea Trilby . Can you point me somewhere appropriate to look at ? (any documentation etc.)
I am not much of a coder.


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

Offline

#829 2012-09-14 19:48:20

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

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

I've never done this, it was just an idea.  But if you change your keybinding from something like 'SHCMD("firefox")' to 'SHCMD("jumpstart firefox")' and create a script called jumpstart, it could contain something like the following:

#!/bin/bash

Xdialog --msgbox "Starting $1 ..." 100 100 &
$1 &
until pgrep $1; do sleep 0.25; done
killall Xdialog

This could be used to "jumpstart" any slow starting apps.  It will NOT, of course, make them faster.  But it will provide a quick dialog that will close once they start.

This seems a bit odd and ugly to me, but if you want such a thing, feel free to tweak it as desired.

Edit: sorry, you asked for documentation, not example... but the only real documentation I could suggest is `man Xdialog` or `man zenity`

Edit2: OK, I realized the first version I posted here was absolutely useless - sorry if anyone tried it.  This one too has a fatal flaw: I think pgrep will return true as soon as the firefox process starts, not waiting for the window to be ready.  But it's a start.  If nothing else, you could take out the pgrep loop and just sleep for a fixed time interval based on your estimate of how long it normally takes firefox to start up.

EDIT: turns out I think this is easier to do well in C.  Check out Jumpstart on github.  Jumpstart creates a "blank" window with the title "Loading <app> ..." until the command passed as a parameter loads a window.  Then jumpstart exits and gets out of the way.  This will only work if the application name is in the window name - but it does deal with capitalized titles ok.

Last edited by Trilby (2012-09-15 00:01:50)


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

Offline

#830 2012-09-15 09:37:15

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

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

Nice work Trilby , now I think I need to polish my "C" . You at least gave me a good base to start. Thanks...


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

Offline

#831 2012-09-15 19:18:06

ArchLinux
Member
Registered: 2012-06-09
Posts: 15

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

@Trilby: Thanks! I will take a look at Jumpstart. I thought there might be a patch for dwm, to do just that (because it seems simple).

Offline

#832 2012-09-16 03:26:42

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

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

A bit of request if anyone could ( Trilby gave a hint at it a few pages back ), I still haven't been able to get it to work, as I am still really new to all of this.

But I just wanted to know if anyone could help with adding a border to the bar. Should in theory be easy, but it seems to be over my head at this present point in time.


Registered Linux user #536591.

Offline

#833 2012-09-16 08:35:05

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

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

@Crunch
Try something like this

+void  
+draw_border(unsigned long col[ColLast])  {	
+    XGCValues gcv;
 	
+    XRectangle r = {dc.x, dc.y, dc.w, 2 };		
+    gcv.foreground = col[ColBorder];
+    XChangeGC(dpy, dc.gc, GCForeground, &gcv);	
+    XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1); 
  
void
drawbar(Monitor *m) { 
  
drawtext(tags[i], col, urg & 1 << i); 
 +draw_border(col); 

 drawtext(m->ltsymbol, dc.norm, False);
+draw_border(col);  
 
if(m == selmon) { /* status is only drawn on selected monitor */ 
dc.w = TEXTW(stext);  
 
drawtext(stext, dc.norm, False); 
+draw_border(col);   
  
if(m->sel) {
col = m == selmon ? dc.sel : dc.norm; 
drawtext(m->sel->name, col, False); 
+draw_border(col);  

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

Offline

#834 2012-09-16 11:07:00

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

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

Ooor ....  Just add two lines to the end of drawbar():

        drawsquare(m->sel->isfixed, m->sel->isfloating, col);
		}
		else
			drawtext(NULL, dc.colors[0], False);
	}
+	XSetForeground(dpy, dc.gc, dc.colors[0][ColBorder]);
+	XDrawRectangle(dpy,dc.drawable,dc.gc,0,0,m->ww-1,bh-1);
	XCopyArea(dpy, dc.drawable, m->barwin, dc.gc, 0, 0, m->ww, bh, 0, 0);
	XSync(dpy, False);
}

This is assuming you have the colorstatus patch (I'm not sure if a border would make sense without colors).  But if you don't you can just change the 3rd parameter to XSetForeground to an appropriate color.


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

Offline

#835 2012-09-17 02:05:25

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

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

Doh! Seems so easy now... sad

Thanks Trilby!


Registered Linux user #536591.

Offline

#836 2012-10-02 21:16:20

JLloyd13
Member
Registered: 2012-06-24
Posts: 107

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

does anyone here have a working status colors patch for 6.0? been looking though this thread and found one but the link is broken. thanks!

Offline

#837 2012-10-02 21:19:51

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

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

JLloyd13 wrote:

does anyone here have a working status colors patch for 6.0? been looking though this thread and found one but the link is broken. thanks!

I haven't tried it, but Unia has some dwm 6.0 patches: https://github.com/Unia/DWM

Offline

#838 2012-10-02 22:40:53

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

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

Yep, mine work. Watch the queu tho, if you want to apply in a different order you might have to hand patch them first.

EDIT: ah, I see statuscolors is the first in the queu, so it should work on a vanilla dwm.c

Last edited by Unia (2012-10-02 22:43:11)


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

#839 2012-10-03 00:10:58

JLloyd13
Member
Registered: 2012-06-24
Posts: 107

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

karol wrote:
JLloyd13 wrote:

does anyone here have a working status colors patch for 6.0? been looking though this thread and found one but the link is broken. thanks!

I haven't tried it, but Unia has some dwm 6.0 patches: https://github.com/Unia/DWM

thanks!

Offline

#840 2012-10-04 11:26:45

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

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

Hi,

it is pretty hard going through these 34 pages of this thread...hence I want to ask if there is a patch like the "dwm-6.0-single_window_no_border.diff" which removes borders for every application being started. The mentioned patch is to find here and just removes the border of a single running client. Adding a second ,i.e. terminal, the border appears again and shows up this unlikely gap at the bottom of the screen.

Thanks,

L-K

Offline

#841 2012-10-04 13:26:55

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

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

linux-ka wrote:

Hi,

it is pretty hard going through these 34 pages of this thread...hence I want to ask if there is a patch like the "dwm-6.0-single_window_no_border.diff" which removes borders for every application being started. The mentioned patch is to find here and just removes the border of a single running client. Adding a second ,i.e. terminal, the border appears again and shows up this unlikely gap at the bottom of the screen.

Thanks,

L-K

Can't you set border width to 0?


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

#842 2012-10-04 14:08:59

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

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

ok...how ? should this be like

static const unsigned int border_width      = 0;

?

Offline

#843 2012-10-04 14:33:13

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

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

^ I guess..


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

#844 2012-10-04 15:07:15

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

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

nope, this has no visible effect. At the bottom there is still this stupid gap, which simply occupies expensive space of the display....any other idea ?

Offline

#845 2012-10-04 15:16:58

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

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

linux-ka wrote:

nope, this has no visible effect. At the bottom there is still this stupid gap, which simply occupies expensive space of the display....any other idea ?

If this happens (mostly) with terminal emulators, try setting this in config.h:

static const Bool resizehints = False; // True means respect size hints in tiled resizals

Last edited by Unia (2012-10-04 15:17:30)


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

#846 2012-10-04 15:30:49

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

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

brilliant :-) this works perfect. It is quite sad that the source code is not that much commented/explained.  C is in general not the problem, but it is a big mess understanding all these variables and constants necessary to tinker a bit the dwm...

Offline

#847 2012-10-04 17:33:41

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

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

linux-ka wrote:

brilliant :-) this works perfect. It is quite sad that the source code is not that much commented/explained.  C is in general not the problem, but it is a big mess understanding all these variables and constants necessary to tinker a bit the dwm...

https://wiki.archlinux.org/index.php/Dw … al_windows


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#848 2012-10-04 19:08:42

Shogun
Member
Registered: 2012-10-04
Posts: 1

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

Hello,
I am new to Linux and would like to know... If I want install windows manager (DWM, awesome, monsterwm ) do I need install xfce or kde also? or just windows manager dynamic?

Thanks smile

Offline

#849 2012-10-04 19:10:55

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

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

Just WM is fine.

Offline

#850 2012-10-15 17:31:21

kalle97
Member
Registered: 2012-07-18
Posts: 80

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

Hi, is there any attachaside patch for 6.1? I only found one for 5.7 and 5.6( http://dwm.suckless.org/patches/attachaside )...

Offline

Board footer

Powered by FluxBB