Re: [dwm] wiki front

2007-11-11 Thread Anselm R. Garbe
On Sat, Nov 10, 2007 at 10:47:23PM +0100, y i y u s wrote:
 2007/11/10, Anselm R. Garbe [EMAIL PROTECTED]:
  Hi there,
 
  I plan to update the suckless.org website completely, before I'm
  going to continue the st development. So I ask if people know
  some sane and simple wiki/blog implementations, which I might
  consider?
 
  Actually there were reasons why I wrote diri a while ago, but it
  just feels too lowlevel and I more and more dislike the look and
  feel of the suckless.org diri pages.
 
  If there are no wikis which might gain my interest, I will
  rewrite diri from scratch using mainly C filter programs. The
  first thing is a simplified Markdown - html generator.
 
  I believe the basic principles and ideas in diri are right -
  using a tree structure for glueing related pages together,
  having a Markdown'ish wiki syntax which looks like
  well-formatted ASCII text files (but lacks tables ;() etc.
 
  But maybe in the meantime some rocky wiki appeared which I
  didn't noticed so far. Let me know!
 
  Regards,
  --
   Anselm R. Garbe  http://www.suckless.org/  GPG key: 0D73F361
 
 I sent you my markdown implementation in awk a while ago. I know it is
 not perfect but it could be improved. I had the idea of applying your
 suggestions (also what webrc people had to say), but you didn't look
 interested. Tell me if this has changed, I can work on it now.
 cheers,

I know your implementation and I had a look on it. From a
Markdown perspective it is quite well implemented. But what I
dislike about Markdown (which is not related to your awk
version) is that it has no higher-level features for tables and
that it recognizes different syntactical elements for the same
thing, e.g. you can define headlines differently with the same
result, where only one way should be allowed to make the format
consistent.

I.e. what I'd like to have is Markdown without embedded HTML
(html will be escaped as in your version, at least as far as
 discussed with Kris on IRC) but with the following table
syntax:


col | col | col
---
val | val | val
---
val | val | val

and with a couple of other simplifications.  I believe such
construct is quite context-sensitive and very hard to parse with
awk - hence I'm looking forward ;)

Another idea I'd prefer is having a simple reference element,
e.g.

---snip---
For further information about those problem refer (J.R. Hoare)[1].

...

References
--
[1] http://www.jrhoare.com/papers/1963/anatomy.ps
---snip---

What I have in mind is, that the markdown replacement should
add a link for the J.R. Hoare portion pointing to the site
referenced with the label 1. I believe that is heavily
context-sensitive and can only be done in two passes - so I see
heavy difficulties with awk here.

That might give you some ideas about the silence from my side
about your implementation and markdown lately.

Regards,
-- 
 Anselm R. Garbe  http://www.suckless.org/  GPG key: 0D73F361



Re: [dwm] wiki front

2007-11-11 Thread Anselm R. Garbe
On Sat, Nov 10, 2007 at 08:38:02PM +0100, Alessandro Dotti Contra wrote:
 On Sat, Nov 10, 2007 at 07:42:17PM +0100, Anselm R. Garbe wrote:
 |
 |I plan to update the suckless.org website completely, before I'm
 |going to continue the st development. So I ask if people know
 |some sane and simple wiki/blog implementations, which I might
 |consider?
 
 Try this one:
 
 http://ikiwiki.info/
 
 I'm feeling really comfortable with it.

Nico Golde also recommended me this in a privmail. I'll
definately have a look at this - what I disliked during a first
glance is the wiki syntax, but maybe that can be changed easily.

I will let you know later. I think it is a good idea to stick to
a 3rd party tool, that I have more time to develop the things
which I'm really interested in ;)

Regards,
-- 
 Anselm R. Garbe  http://www.suckless.org/  GPG key: 0D73F361



Re: [dwm] wiki front

2007-11-11 Thread Anselm R. Garbe
On Sun, Nov 11, 2007 at 11:33:13AM +0100, Anselm R. Garbe wrote:
 Nico Golde also recommended me this in a privmail. I'll
 definately have a look at this - what I disliked during a first
 glance is the wiki syntax, but maybe that can be changed easily.

Ahrgl, I'm a moron ;) I just have a deeper look on it, because
it supports markdown out of the box...

Regards,
-- 
 Anselm R. Garbe  http://www.suckless.org/  GPG key: 0D73F361



Re: [dwm] wiki front

2007-11-11 Thread y i y u s
2007/11/11, Anselm R. Garbe [EMAIL PROTECTED]:
 On Sat, Nov 10, 2007 at 10:47:23PM +0100, y i y u s wrote:
  2007/11/10, Anselm R. Garbe [EMAIL PROTECTED]:
   Hi there,
  
   I plan to update the suckless.org website completely, before I'm
   going to continue the st development. So I ask if people know
   some sane and simple wiki/blog implementations, which I might
   consider?
  
   Actually there were reasons why I wrote diri a while ago, but it
   just feels too lowlevel and I more and more dislike the look and
   feel of the suckless.org diri pages.
  
   If there are no wikis which might gain my interest, I will
   rewrite diri from scratch using mainly C filter programs. The
   first thing is a simplified Markdown - html generator.
  
   I believe the basic principles and ideas in diri are right -
   using a tree structure for glueing related pages together,
   having a Markdown'ish wiki syntax which looks like
   well-formatted ASCII text files (but lacks tables ;() etc.
  
   But maybe in the meantime some rocky wiki appeared which I
   didn't noticed so far. Let me know!
  
   Regards,
   --
Anselm R. Garbe  http://www.suckless.org/  GPG key: 0D73F361
 
  I sent you my markdown implementation in awk a while ago. I know it is
  not perfect but it could be improved. I had the idea of applying your
  suggestions (also what webrc people had to say), but you didn't look
  interested. Tell me if this has changed, I can work on it now.
  cheers,

 I know your implementation and I had a look on it. From a
 Markdown perspective it is quite well implemented. But what I
 dislike about Markdown (which is not related to your awk
 version) is that it has no higher-level features for tables and
 that it recognizes different syntactical elements for the same
 thing, e.g. you can define headlines differently with the same
 result, where only one way should be allowed to make the format
 consistent.

 I.e. what I'd like to have is Markdown without embedded HTML
 (html will be escaped as in your version, at least as far as
  discussed with Kris on IRC) but with the following table
 syntax:


 col | col | col
 ---
 val | val | val
 ---
 val | val | val

 and with a couple of other simplifications.  I believe such
 construct is quite context-sensitive and very hard to parse with
 awk - hence I'm looking forward ;)

 Another idea I'd prefer is having a simple reference element,
 e.g.

 ---snip---
 For further information about those problem refer (J.R. Hoare)[1].

 ...

 References
 --
 [1] http://www.jrhoare.com/papers/1963/anatomy.ps
 ---snip---

 What I have in mind is, that the markdown replacement should
 add a link for the J.R. Hoare portion pointing to the site
 referenced with the label 1. I believe that is heavily
 context-sensitive and can only be done in two passes - so I see
 heavy difficulties with awk here.

 That might give you some ideas about the silence from my side
 about your implementation and markdown lately.

 Regards,
 --
  Anselm R. Garbe  http://www.suckless.org/  GPG key: 0D73F361



Probably you are true and awk is not the best tool for such a parser,
but I'll probably give it a try as an exercise (I'm still learning awk
and I find it really interesting and... funny!). Anyway, I just wanted
to tell that the reference method you are proposing could be a pain
making modifications, i.e. you would have to change all the further
references if you add a new one. That's why I propose a name system
(you could use number as names if you want, but the parser would take
care of putting them in order later).
I will let you know if I give with something useful after some awk
experiments...

-- 


- yiyus || JGL .



Re: [dwm] wiki front

2007-11-11 Thread Alessandro Dotti Contra
On Sun, Nov 11, 2007 at 11:46:22AM +0100, Anselm R. Garbe wrote:
|
|Ahrgl, I'm a moron ;) I just have a deeper look on it, because
|it supports markdown out of the box...

Another good thing about ikiwiki is that you can restyle your web site
really easily by just changing a couple of template files. So if you get
bored of what your web site looks like - something that happens to me
quite frequently :) - you don't have to start again from scratch.

ciao
alex

-- 
Alessandro Dotti Contra | email:  [EMAIL PROTECTED]
Bologna, Italy  | PGP Key ID: 0x9C84C3DA
http://www.hyboria.org/ | jabber: [EMAIL PROTECTED]
| gtalk:  [EMAIL PROTECTED]



Re: [dwm] wiki front

2007-11-11 Thread Anselm R. Garbe
Aaargl, it is no good idea to write a mail when there is someone
asking questions and interrupting me all the time, so here some
typo fixes of my last mail:

On Sun, Nov 11, 2007 at 01:19:05PM +0100, Anselm R. Garbe wrote:
 diri has been designed with my observation, that traditional
 wiki implementations suffer from a simple way to browse all
 pages. Mostly this thing is up to all authors of individual
 pages (they have to add links to other pages) - or to the author
 of a navigation page. In diri I replaced this whole process with
 dynamically creating the menu index depending on the path which
 is browsed. Hence an author must only think about a
 tree-grouping where his page fits best, e.g.
 dwm/pages/funky_new_patch

s/dwm\/pages\/dwm\/patches/

 I noticed that also in diri certain decisions suffer from
 drawbacks. Actually diri doesn't stores files in a version
 control system, which I like about diri. Besides this, diri

s/I like about diri/I like about ikiwiki/

Regards,
-- 
 Anselm R. Garbe  http://www.suckless.org/  GPG key: 0D73F361



Re: [dwm] wiki front

2007-11-11 Thread Anselm R. Garbe
On Sun, Nov 11, 2007 at 01:19:05PM +0100, Anselm R. Garbe wrote:
 On Sun, Nov 11, 2007 at 12:13:28PM +0100, Alessandro Dotti Contra wrote:
  On Sun, Nov 11, 2007 at 11:46:22AM +0100, Anselm R. Garbe wrote:
  |
  |Ahrgl, I'm a moron ;) I just have a deeper look on it, because
  |it supports markdown out of the box...
  
  Another good thing about ikiwiki is that you can restyle your web site
  really easily by just changing a couple of template files. So if you get
  bored of what your web site looks like - something that happens to me
  quite frequently :) - you don't have to start again from scratch.
 
 I gave ikiwiki a try and it was quite easy to convert all diri
 pages in a couple of minutes. However, ikiwiki seems to be quite
 complex for the purpose it does (approx. 10kSLOC). It does
 various things right, but the implementation is really
 questionable from my perspective.

Well, given the fact that I need something which works for the
meantime, I'd consider using ikiwiki, with the exception that
there needs to be something like a diri plugin, which creates
the directory structure as is. Anyone knows if such stuff
already exists?

Regards,
-- 
 Anselm R. Garbe  http://www.suckless.org/  GPG key: 0D73F361



Re: [dwm] wiki front

2007-11-11 Thread Anselm R. Garbe
On Sun, Nov 11, 2007 at 04:32:54PM +0300, Alexander Polakov wrote:
 what about bashwiki?
 http://dokucode.de/cgi-bin/show.sh?path=/Projects/BashWiki

I don't like the ^ba in that ;) Also, the haserl dependency.

Regards,
-- 
 Anselm R. Garbe  http://www.suckless.org/  GPG key: 0D73F361



Re: [dwm] idxoftag and tag names

2007-11-11 Thread Anselm R. Garbe
On Sun, Nov 11, 2007 at 07:39:54PM +0330, Ali Gholami Rudi wrote:
 idxoftag(x) fails if x is a tag name; it compares the pointers and
 not the strs.
 
 -- Ali

 diff --git a/dwm.c b/dwm.c
 --- a/dwm.c
 +++ b/dwm.c
 @@ -863,7 +863,7 @@ idxoftag(const char *tag) {
  idxoftag(const char *tag) {
   unsigned int i;
  
 - for(i = 0; (i  LENGTH(tags))  (tags[i] != tag); i++);
 + for(i = 0; (i  LENGTH(tags))  cmp(tags[i], tag); i++);
   return (i  LENGTH(tags)) ? i : 0;
  }

Actually it is intended that idxoftag() makes a pointer
comparision, because it assumes that always the specific
tags-array entry is used. I see no reason why one should do a
string comparision which is more expensive and would lead to at
least an additional waste of memory through allocating some
extra space for x instead of re-using tags[3] for instance.

Regards,
-- 
 Anselm R. Garbe  http://www.suckless.org/  GPG key: 0D73F361



Re: [dwm] wiki front

2007-11-11 Thread Anselm R. Garbe
On Sun, Nov 11, 2007 at 05:01:20PM +0100, Anselm R. Garbe wrote:
 On Sun, Nov 11, 2007 at 01:19:05PM +0100, Anselm R. Garbe wrote:
  On Sun, Nov 11, 2007 at 12:13:28PM +0100, Alessandro Dotti Contra wrote:
   On Sun, Nov 11, 2007 at 11:46:22AM +0100, Anselm R. Garbe wrote:
   |
   |Ahrgl, I'm a moron ;) I just have a deeper look on it, because
   |it supports markdown out of the box...
   
   Another good thing about ikiwiki is that you can restyle your web site
   really easily by just changing a couple of template files. So if you get
   bored of what your web site looks like - something that happens to me
   quite frequently :) - you don't have to start again from scratch.
  
  I gave ikiwiki a try and it was quite easy to convert all diri
  pages in a couple of minutes. However, ikiwiki seems to be quite
  complex for the purpose it does (approx. 10kSLOC). It does
  various things right, but the implementation is really
  questionable from my perspective.
 
 Well, given the fact that I need something which works for the
 meantime, I'd consider using ikiwiki, with the exception that
 there needs to be something like a diri plugin, which creates
 the directory structure as is. Anyone knows if such stuff
 already exists?

If not (I know there is Tuomo's sidebar, but I don't like it
because it is created statically), what I have in mind from a UI
perspective is the following:

http://www.suckless.org/newpage/index.html

Instead of displaying the complete tree for the current browse
path, I'd like to display the path similiar to ikiwiki in a
first line, and display the contents in the current path in the
menu on the right side (no garantuee that this works with IE, I
only tested it with firefox).

The path and the menu contents will be generated dynamically.

Regards,
-- 
 Anselm R. Garbe  http://www.suckless.org/  GPG key: 0D73F361



Re: [dwm] [patch] pertag

2007-11-11 Thread Jan Christoph Ebersbach
On Tue 06-11-2007 15:27 -0500, Jeremy O'Brien wrote:

 I just found a bug. Your patch gets confused if you try any
 viewprevtag() magic. For example, turn the bar off on tag 1, and
 viewprevtag(). The bar stays magically turned off. Probably not the
 intended behavior. :) Thank you otherwise for your patch!

I fixed the bug and updated float-border, moveresize, nmaster and tagall
to 4.7.

Good night.
-- 
Jan Christoph Ebersbach
Fear God and keep his commandments, for this is the whole duty of man.
Eccl 12,13
diff -r ac233c362502 dwm.c
--- a/dwm.c	Sat Sep 22 21:55:19 2007 +0200
+++ b/dwm.c	Sun Sep 23 01:42:54 2007 +0200
@@ -169,6 +169,7 @@ void setup(void);
 void setup(void);
 void spawn(const char *arg);
 void tag(const char *arg);
+void tagall(const char *arg);
 unsigned int textnw(const char *text, unsigned int len);
 unsigned int textw(const char *text);
 void tile(void);
@@ -1549,6 +1550,30 @@ tag(const char *arg) {
 	arrange();
 }
 
+void
+tagall(const char *arg) {
+	if (!clients)
+		return;
+	int floating_only = arg  arg[0] == 'F' ? 1 : 0;
+	int tag = arg ? atoi(arg + floating_only) : 0;
+	int j;
+	Client* c;
+	if(tag = 0  tag  LENGTH(tags))
+		for(c = clients; c; c = c-next)
+		{
+			if(!floating_only || c-isfloating)
+for(j = 0; j  LENGTH(tags); j++)
+{
+	if(c-tags[j]  seltags[j])
+	{
+		c-tags[j] = !c-tags[j];
+		c-tags[tag-1] = True;
+	}
+}
+		}
+	arrange();
+}
+
 unsigned int
 textnw(const char *text, unsigned int len) {
 	XRectangle r;
diff -r 767e76426fda dwm.c
--- a/dwm.c	Sat Nov 10 20:21:22 2007 +0100
+++ b/dwm.c	Sun Nov 11 22:38:11 2007 +0100
@@ -125,6 +125,7 @@ void configure(Client *c);
 void configure(Client *c);
 void configurenotify(XEvent *e);
 void configurerequest(XEvent *e);
+void deinitpertag(void);
 void destroynotify(XEvent *e);
 void detach(Client *c);
 void detachstack(Client *c);
@@ -194,11 +195,11 @@ void zoom(const char *arg);
 
 /* variables */
 char stext[256];
-double mwfact;
 int screen, sx, sy, sw, sh, wax, way, waw, wah;
 int (*xerrorxlib)(Display *, XErrorEvent *);
-unsigned int bh, bpos;
+unsigned int bh;
 unsigned int blw = 0;
+unsigned int csel = 0;
 unsigned int numlockmask = 0;
 void (*handler[LASTEvent]) (XEvent *) = {
 	[ButtonPress] = buttonpress,
@@ -229,6 +230,11 @@ Layout *layout = NULL;
 Layout *layout = NULL;
 Window barwin, root;
 Regs *regs = NULL;
+
+unsigned int *bpos;
+unsigned int *ltidxs;
+unsigned int *nmasters;
+double *mwfacts;
 
 /* configuration, allows nested code to access above variables */
 #include config.h
@@ -276,7 +282,7 @@ arrange(void) {
 			unban(c);
 		else
 			ban(c);
-	layout-arrange();
+	layouts[ltidxs[csel]].arrange();
 	focus(NULL);
 	restack();
 }
@@ -337,20 +343,20 @@ buttonpress(XEvent *e) {
 		if(CLEANMASK(ev-state) != MODKEY)
 			return;
 		if(ev-button == Button1) {
-			if((layout-arrange == floating) || c-isfloating)
+			if((layouts[ltidxs[csel]].arrange == floating) || c-isfloating)
 restack();
 			else
 togglefloating(NULL);
 			movemouse(c);
 		}
 		else if(ev-button == Button2) {
-			if((floating != layout-arrange)  c-isfloating)
+			if((floating != layouts[ltidxs[csel]].arrange)  c-isfloating)
 togglefloating(NULL);
 			else
 zoom(NULL);
 		}
 		else if(ev-button == Button3  !c-isfixed) {
-			if((floating == layout-arrange) || c-isfloating)
+			if((floating == layouts[ltidxs[csel]].arrange) || c-isfloating)
 restack();
 			else
 togglefloating(NULL);
@@ -395,6 +401,7 @@ cleanup(void) {
 	XFreeCursor(dpy, cursor[CurMove]);
 	XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime);
 	XSync(dpy, False);
+	deinitpertag();
 }
 
 void
@@ -466,7 +473,7 @@ configurerequest(XEvent *e) {
 		c-ismax = False;
 		if(ev-value_mask  CWBorderWidth)
 			c-border = ev-border_width;
-		if(c-isfixed || c-isfloating || (floating == layout-arrange)) {
+		if(c-isfixed || c-isfloating || (floating == layouts[ltidxs[csel]].arrange)) {
 			if(ev-value_mask  CWX)
 c-x = ev-x;
 			if(ev-value_mask  CWY)
@@ -499,6 +506,15 @@ configurerequest(XEvent *e) {
 		XConfigureWindow(dpy, ev-window, ev-value_mask, wc);
 	}
 	XSync(dpy, False);
+}
+
+void
+deinitpertag(void)
+{
+	free(bpos);
+	free(ltidxs);
+	free(mwfacts);
+	free(nmasters);
 }
 
 void
@@ -547,7 +563,7 @@ drawbar(void) {
 		dc.x += dc.w;
 	}
 	dc.w = blw;
-	drawtext(layout-symbol, dc.norm);
+	drawtext(layouts[ltidxs[csel]].symbol, dc.norm);
 	x = dc.x + dc.w;
 	dc.w = textw(stext);
 	dc.x = sw - dc.w;
@@ -1264,9 +1280,9 @@ restack(void) {
 	drawbar();
 	if(!sel)
 		return;
-	if(sel-isfloating || (layout-arrange == floating))
+	if(sel-isfloating || (layouts[ltidxs[csel]].arrange == floating))
 		XRaiseWindow(dpy, sel-win);
-	if(layout-arrange != floating) {
+	if(layouts[ltidxs[csel]].arrange != floating) {
 		wc.stack_mode = Below;
 		wc.sibling = barwin;
 		if(!sel-isfloating) {
@@ -1384,8 +1400,8 @@ setlayout(const char *arg) {
 	unsigned int i;
 
 	if(!arg) {
-		if(++layout == layouts[LENGTH(layouts)])
-			layout 

Re: [dwm] DWM 4.6 Using 45% CPU on idle???

2007-11-11 Thread fernanbolando
Maybe it's your startup script?

-Original Message-
From: Jonny Gerold [EMAIL PROTECTED]
To: dwm@suckless.org
Date: Sun, 11 Nov 2007 18:29:06 -0800
Subject: [dwm] DWM 4.6 Using 45% CPU on idle???

 Hello,
 I have a big problem. I have a brand new Thinkpad X61, and I'm using
 DWM 
 4.6 on Archlinux, and on idle something uses 45% of my CPU. And it's 
 only when I use dwm. I tried starting up fluxbox, and there is no
 issue? 
 I have an intel core duo, and I don't know what might be causing the 
 problem. Any help would be much appreciated.
 Thanks, Jonny
 
 





Re: [dwm] DWM 4.6 Using 45% CPU on idle???

2007-11-11 Thread James Turner
On Sun, Nov 11, 2007 at 06:29:06PM -0800, Jonny Gerold wrote:
 Hello,
 I have a big problem. I have a brand new Thinkpad X61, and I'm using DWM 
 4.6 on Archlinux, and on idle something uses 45% of my CPU. And it's only 
 when I use dwm. I tried starting up fluxbox, and there is no issue? I have 
 an intel core duo, and I don't know what might be causing the problem. Any 
 help would be much appreciated.
 Thanks, Jonny

Are you using a while loop to print the date and other information every
second?  This might have something to do with it.  Try to increase the
sleep amount or remove the statusbar updates all together and see if that
might be the cause.

-- 
James Turner
BSD Group Consulting
http://www.bsdgroup.org