Re: [dwm] [PATCH] An experiment with X resources

2007-09-25 Thread Anselm R. Garbe
On Mon, Sep 24, 2007 at 08:50:53PM +0100, Chris Webb wrote: Anselm R. Garbe [EMAIL PROTECTED] writes: it won't last long that the need arises to also configure the key bindings, and the terminal command, and the dmenu command, and what not using such capabilities. Actually... :-)

Re: [dwm] [PATCH] An experiment with X resources

2007-09-25 Thread Anselm R. Garbe
On Tue, Sep 25, 2007 at 08:04:54AM +0200, Anselm R. Garbe wrote: On Mon, Sep 24, 2007 at 08:50:53PM +0100, Chris Webb wrote: Anselm R. Garbe [EMAIL PROTECTED] writes: it won't last long that the need arises to also configure the key bindings, and the terminal command, and the dmenu

Re: [dwm] [PATCH] An experiment with X resources

2007-09-25 Thread Jan Christoph Ebersbach
On Tue 25-09-2007 11:41, WyrmSkull wrote: What about having some default bash scripts keybinding? MODKEY | ShiftMask, XK_(F1 to F10), spawn, exec bash_script_(01 to 10).sh 0 byte files don't take too much space, 0 LOC, and can be edited runtime. You can add edit_keybind_(F1 to F10) dmenu

Re: [dwm] [PATCH] An experiment with X resources

2007-09-25 Thread Anselm R. Garbe
On Tue, Sep 25, 2007 at 02:20:36PM +0200, Jan Christoph Ebersbach wrote: On Tue 25-09-2007 11:41, WyrmSkull wrote: What about having some default bash scripts keybinding? MODKEY | ShiftMask, XK_(F1 to F10), spawn, exec bash_script_(01 to 10).sh 0 byte files don't take too much space, 0

Re: [dwm] [PATCH] An experiment with X resources

2007-09-25 Thread WyrmSkull
Is there a way to make dwm execute commands at runtime through standard input? Would that be too complex? All functions should be there, it's just a matter of parsing user input. echo set_statusbar string | dwm normal behavior echo tag XTerm,1,2,5 | dwm XTerm gets tags 1,2,5 DWM restart

Re: [dwm] [PATCH] An experiment with X resources

2007-09-25 Thread WyrmSkull
Anselm R. Garbe wrote That's exactly the proposal I had sometime ago, but it scares me that it will bring unecessary complexity Rules already have to be written manually - instead of those you could use bash scripts. xterm -- echo tag Xterm,2 | dwm This could cut the rules parts out.

Re: [dwm] [PATCH] An experiment with X resources

2007-09-25 Thread Anselm R. Garbe
On Tue, Sep 25, 2007 at 03:40:04PM +0200, WyrmSkull wrote: Anselm R. Garbe wrote That's exactly the proposal I had sometime ago, but it scares me that it will bring unecessary complexity Rules already have to be written manually - instead of those you could use bash scripts. xterm -- echo

Re: [dwm] [PATCH] An experiment with X resources

2007-09-25 Thread Jan Christoph Ebersbach
On Tue 25-09-2007 14:34, Anselm R. Garbe wrote: I implemented tag/floating state preservation as prototype shortly before dwm 4.4 appeared. However it made the code too complex for my taste for a rarely used functionality. I prefer using hibernation technologies instead of restarting dwm. And

Re: [dwm] [PATCH] An experiment with X resources

2007-09-25 Thread Kurt H Maier
On 9/25/07, markus schnalke [EMAIL PROTECTED] wrote: That's information I read somewhere. I only tested, that .Xresources on it's own not gets interpreted a X init on my system (debian etch). That's debian's doing, not x.org's. X.org has always had both files; according to the X(7) man page,

Re: [dwm] [PATCH] An experiment with X resources

2007-09-25 Thread Kai Grossjohann
On Tue, Sep 25, 2007 at 10:58:40PM +0200, markus schnalke wrote: .Xresources just want to mention, that this file's name '.Xresources' has changed to '.Xdefaults' in newer versions of X ~/.Xdefaults is read by the client on startup. (This is important for remote clients -- the

[dwm] [PATCH] An experiment with X resources

2007-09-24 Thread Chris Webb
This morning I've been thinking about run time configuration of dwm. I've never especially liked the compile-time rules table in config.h. The fact that one or two programs I use happen to be broken and need a rule with isfloating = 1 doesn't seem like something that the dwm binary should be

Re: [dwm] [PATCH] An experiment with X resources

2007-09-24 Thread Chris Webb
Anselm R. Garbe [EMAIL PROTECTED] writes: The only questionable issue I don't like is the strsep(3) use, because of portability concerns. Failing all else, I guess a strsep() tokeniser while(tag = strsep(line, \t\n)) { if(!tag[0]) continue;

Re: [dwm] [PATCH] An experiment with X resources

2007-09-24 Thread Jukka Salmi
Chris Webb -- dwm (2007-09-24 14:30:23 +0100): This morning I've been thinking about run time configuration of dwm. [...] I only glanced at the code, but this seems to be a useful idea! +void * +erealloc(void *res, unsigned int size) { + if (!(res = res ? realloc(res, size) :

Re: [dwm] [PATCH] An experiment with X resources

2007-09-24 Thread Chris Webb
Jukka Salmi [EMAIL PROTECTED] writes: Hmm, why using the ternary operator? Are there systems where `realloc(NULL, size)' does not behave identically to `malloc(size)'? I remember some old unix systems that segfault if you pass realloc a null pointer! I haven't seen anything like that for a

Re: [dwm] [PATCH] An experiment with X resources

2007-09-24 Thread Sylvain Bertrand
http://www.opengroup.org/onlinepubs/009695399/functions/realloc.html 2007/9/24, Chris Webb [EMAIL PROTECTED]: Jukka Salmi [EMAIL PROTECTED] writes: Hmm, why using the ternary operator? Are there systems where `realloc(NULL, size)' does not behave identically to `malloc(size)'? I remember

Re: [dwm] [PATCH] An experiment with X resources

2007-09-24 Thread Chris Webb
Anselm R. Garbe [EMAIL PROTECTED] writes: it won't last long that the need arises to also configure the key bindings, and the terminal command, and the dmenu command, and what not using such capabilities. Actually... :-) What wasn't in that patch, but is in my tree, is a little convenience

Re: [dwm] [PATCH] An experiment with X resources

2007-09-24 Thread Kurt H Maier
For me, this gives a sweet spot between runtime configurability and keeping code complexity low, with compiled-in key bindings which are constant across all the systems I use, but runtime configurable colours, rules, tag names and commands, which vary from system to system. I did something