Re: [dev] color-scheme

2011-07-26 Thread Petr Sabata
On Mon, Jul 25, 2011 at 06:22:58PM +0200, ilf wrote:
 What's your favorite color-scheme? I just came across this one:
 http://ethanschoonover.com/solarized
 
 While this may not be suckless core, we are pretty terminal focused.
 Also we did touch the topic before. I just hope, this won't get too
 religious.

Yep, I've been using Solarized for a few months now.  For me, it's the best
scheme I've tried so far...

The contrast's okay and my eyes don't hurt even after 16 hours coding.  The
downside is its author pretty much ignores everybody [1].

[1] https://github.com/altercation/solarized/issues

-- 
# Petr Sabata


pgpTjy6Mk0YYK.pgp
Description: PGP signature


Re: [dev] Re: color-scheme

2011-07-26 Thread hiro
My doctor forbid me to click this, sorry.

On Mon, Jul 25, 2011 at 20:24, Christian Neukirchen
chneukirc...@gmail.com wrote:
 hiro 23h...@googlemail.com writes:

 Good thing I don't know if this is a joke or meant seriously

 It's not.

 http://imgur.com/KPmDX.png

 --
 Christian Neukirchen  chneukirc...@gmail.com  http://chneukirchen.org






Re: [dev] dwm 5.9 small patch for non xinerama users

2011-07-26 Thread mauro tonon
2011/7/25 Thomas Dahms thmsd...@googlemail.com:
 Hi,

 2011/7/22 mauro tonon tono...@gmail.com:
 I noted that if i disable Xinerama, i don't use also the following
 functions: dirtomon, focusmon, tagmon.
 So, i think it is possible to hold all these functions between #ifdef
 XINERAMA ... #endif.
 The difference in the final binary file size is very little but...
 A possible patch is attached...

 What about prefixing these functions with something like xinerama_?
 They would then be all after another and a single ifdef would suffice
 instead of three.

 --
 Thomas Dahms



Right.
I think there will be no difference in the final binary file, but the
code would be simpler to read...
I propose these substitutions in the name of the functions:

dirtomon  - xr_dirtotom
focusmon  - xr_focusmon
tagmon  - xr_tagmon
isuniqegeom  - xr_isuniquegeom

and so it's possible to enclose all them between a single #ifdef ... #endif.

By the way, where is the declaration of the isuniquegeom boolean function?



Re: [dev] dwm 5.9 small patch for non xinerama users

2011-07-26 Thread Jacob Todd
Grep is your friend.
On Jul 26, 2011 9:10 AM, mauro tonon tono...@gmail.com wrote:
 2011/7/25 Thomas Dahms thmsd...@googlemail.com:
 Hi,

 2011/7/22 mauro tonon tono...@gmail.com:
 I noted that if i disable Xinerama, i don't use also the following
 functions: dirtomon, focusmon, tagmon.
 So, i think it is possible to hold all these functions between #ifdef
 XINERAMA ... #endif.
 The difference in the final binary file size is very little but...
 A possible patch is attached...

 What about prefixing these functions with something like xinerama_?
 They would then be all after another and a single ifdef would suffice
 instead of three.

 --
 Thomas Dahms



 Right.
 I think there will be no difference in the final binary file, but the
 code would be simpler to read...
 I propose these substitutions in the name of the functions:

 dirtomon - xr_dirtotom
 focusmon - xr_focusmon
 tagmon - xr_tagmon
 isuniqegeom - xr_isuniquegeom

 and so it's possible to enclose all them between a single #ifdef ...
#endif.

 By the way, where is the declaration of the isuniquegeom boolean
function?



Re: [dev] dwm 5.9 small patch for non xinerama users

2011-07-26 Thread Connor Lane Smith
Hey,

On 26 July 2011 14:36, mauro tonon tono...@gmail.com wrote:
 Sorry, i didn't mean the declaration but the pre-declaration or the
 prototype or how it is called...

Yeah, it's missing.

(grep says it's the only prototype missing, btw.)

cls



Re: [dev] color-scheme

2011-07-26 Thread matus,
On Mon, Jul 25, 2011 at 07:13:53PM +0200, hiro wrote:
 I was in a museum a few days ago and one couldn't read the
 descriptions because of some artist's dumb low-contrast color choice.
 There should be a law against this! You guys are the reason stupid
 choleric persons invented genocides.

I use molokai http://www.vim.org/scripts/script.php?script_id=2340
(screenshots at http://winterdom.com/2008/08/molokaiforvim ).
It has some low contrast elements, but most stuff is pretty high
contrast, and I'm one of those people that really like 256 color
terminals; this might be too angry fruit salad for some.

(The lowest contrast thing are comments, which I think aids readability.
Unfortunately, by default, quoted text in email is also low contrast.
Anyway, its color contrasts are vastly greater than, say, zenburn's.)



[dev] [dwm] code cleanup

2011-07-26 Thread anonymous
Style fixes, removed

missing = NULL;

line.  XCreateFontSet do it for you at the beginning of function [1].
Added missing blank line, still 5 lines removed.

dwm page [2] says dwm is only a single binary, and its source code is
intended to never exceed 2000 SLOC.  wc -l says there are 2077 lines
(2072 with patch).  Some code should be removed or rewritten or dwm will
grow over 2100 lines soon.

[1] 
http://www.openbsd.org/cgi-bin/cvsweb/xenocara/lib/libX11/src/FSWrap.c?rev=1.3
[2] http://dwm.suckless.org/




Re: [dev] [dwm] code cleanup

2011-07-26 Thread Lukas Fleischer
On Tue, Jul 26, 2011 at 11:16:30PM +0400, anonymous wrote:
 Style fixes, removed
 
   missing = NULL;
 
 line.  XCreateFontSet do it for you at the beginning of function [1].
 Added missing blank line, still 5 lines removed.
 
 dwm page [2] says dwm is only a single binary, and its source code is
 intended to never exceed 2000 SLOC.  wc -l says there are 2077 lines
 (2072 with patch).  Some code should be removed or rewritten or dwm will
 grow over 2100 lines soon.
 

The output `wc -l` is a bad measure for the actual SLOC. It counts
comments, empty lines, wrapped lines etc. sloccount(1) says dwm.c from
the 5.9 release tarball has 1836 SLOC which is fine.

 [1] 
 http://www.openbsd.org/cgi-bin/cvsweb/xenocara/lib/libX11/src/FSWrap.c?rev=1.3
 [2] http://dwm.suckless.org/



Re: [dev] [dwm] code cleanup

2011-07-26 Thread Peter Hartlich
Hi,

  void
  grabkeys(void) {
 + unsigned int i, j;
 + unsigned int modifiers[] = { 0, LockMask, numlockmask, 
 numlockmask|LockMask };
 + KeyCode code;
 +
   updatenumlockmask();
 - {
 - unsigned int i, j;
 - unsigned int modifiers[] = { 0, LockMask, numlockmask, 
 numlockmask|LockMask };
 - KeyCode code;

That would break the numlockmask stuff.

Regards,
Peter



Re: [dev] [dwm] code cleanup

2011-07-26 Thread anonymous
On Tue, Jul 26, 2011 at 11:54:14PM +0200, Peter Hartlich wrote:
 Hi,
 
   void
   grabkeys(void) {
  +   unsigned int i, j;
  +   unsigned int modifiers[] = { 0, LockMask, numlockmask, 
  numlockmask|LockMask };
  +   KeyCode code;
  +
  updatenumlockmask();
  -   {
  -   unsigned int i, j;
  -   unsigned int modifiers[] = { 0, LockMask, numlockmask, 
  numlockmask|LockMask };
  -   KeyCode code;
 
 That would break the numlockmask stuff.
 
 Regards,
 Peter
 
Fixed patch attached.
diff -r 701f651eaecc dwm.c
--- a/dwm.c Sun Jul 24 10:41:43 2011 +0100
+++ b/dwm.c Wed Jul 27 01:22:44 2011 +0300
@@ -433,9 +433,9 @@
}
if(ev-window == selmon-barwin) {
i = x = 0;
-   do {
+   do
x += TEXTW(tags[i]);
-   } while(ev-x = x  ++i  LENGTH(tags));
+   while(ev-x = x  ++i  LENGTH(tags));
if(i  LENGTH(tags)) {
click = ClkTagBar;
arg.ui = 1  i;
@@ -720,12 +720,10 @@
if(!(m = selmon-next))
m = mons;
}
-   else {
-   if(selmon == mons)
-   for(m = mons; m-next; m = m-next);
-   else
-   for(m = mons; m-next != selmon; m = m-next);
-   }
+   else if(selmon == mons)
+   for(m = mons; m-next; m = m-next);
+   else
+   for(m = mons; m-next != selmon; m = m-next);
return m;
 }
 
@@ -1017,12 +1015,11 @@
KeyCode code;
 
XUngrabKey(dpy, AnyKey, AnyModifier, root);
-   for(i = 0; i  LENGTH(keys); i++) {
+   for(i = 0; i  LENGTH(keys); i++)
if((code = XKeysymToKeycode(dpy, keys[i].keysym)))
for(j = 0; j  LENGTH(modifiers); j++)
XGrabKey(dpy, code, keys[i].mod | 
modifiers[j], root,
 True, GrabModeAsync, 
GrabModeAsync);
-   }
}
 }
 
@@ -1031,7 +1028,6 @@
char *def, **missing;
int n;
 
-   missing = NULL;
dc.font.set = XCreateFontSet(dpy, fontstr, missing, n, def);
if(missing) {
while(n--)
@@ -1311,6 +1307,7 @@
return m;
return selmon;
 }
+
 void
 quit(const Arg *arg) {
running = False;
@@ -1415,10 +1412,9 @@
XEvent ev;
/* main event loop */
XSync(dpy, False);
-   while(running  !XNextEvent(dpy, ev)) {
+   while(running  !XNextEvent(dpy, ev))
if(handler[ev.type])
handler[ev.type](ev); /* call handler */
-   }
 }
 
 void