[dwm] Basic dwm usage question

2007-06-06 Thread James Turner
Hello list,

I've recently switched over to dwm full time.  I run it on OpenBSD 4.1
-release and couldn't be happier.  I just have a simple question about
how dwm quits.  I use the following command in my .xinitrc to start dwm:

while true
do
echo [ B: `/usr/sbin/apm -l`% T: `/sbin/sysctl hw.sensors.aps0.temp0 \
| sed 's/hw.sensors.aps0.temp0=//g' | sed 's/.00//g' | awk '{print \
$1}'`C ] [ `uptime | perl -e ' =~ \
/\s+([0-9.]+),\s+([0-9.]+),\s+([0-9.]+)/;print qq[$1, $2, $3];'` ] [ \
`date +%m/%d/%y %H:%M` ]
  sleep 60
done | dwm

As you can see I have the echo command sleep for 60 seconds.  I was
using 1 second, but found my load nearly doubles.  My problem is when I
run Alt + Shift + q to quit dwm I find X hangs for awhile before
existing.  I assume it hangs for as long as the time is left for the
sleep command, depending where it is when i quit dwm.  I was wondering
if there is away to kill sleep as soon as I quit dwm?  Thanks for the
help as I imagine it's not dwm specific.

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



Re: [dwm] Basic dwm usage question

2007-06-06 Thread James Turner
On Wed, Jun 06, 2007 at 11:28:52PM +0200, Anydot wrote:
 On (06/06/07 17:03), James Turner wrote:
  As you can see I have the echo command sleep for 60 seconds.  I was
  using 1 second, but found my load nearly doubles.  My problem is when I
  run Alt + Shift + q to quit dwm I find X hangs for awhile before
  existing.  I assume it hangs for as long as the time is left for the
  sleep command, depending where it is when i quit dwm.  I was wondering
  if there is away to kill sleep as soon as I quit dwm?  Thanks for the
  help as I imagine it's not dwm specific.
 
 You can look on snippet of my ~/.Xsession file:
   http://na.srck.net/dwm/Xsession-snippet
 
 it updates datetime every second, but load and diskcpu temperature
 only each 15 seconds.
 Also there is outer BIG loop so I am able to reload dwm (via dwm
 quit). To end the session I can use c-a-backspace (- Xserver quits and
 all the program it was running too).
 
 -- 
 Premysl Anydot Hruby  http://na.srck.net 

Thanks for everyone hints.  I'd rather not have to run c-a-backspace
(which I do now).  I'd prefer dwm to quit and the xsession to terminate
normally.  I did find this posting:
http://www.suckless.org/pipermail/dwm/2006-July/19.html and am
following it now.  I believe it to be the answer to my problem.

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



Re: [dwm] Basic dwm usage question

2007-06-06 Thread James Turner
Alright, after browsing the archive I was able to whip up a working
solution.  In my .xinitrc I have:

[ -p .dwm-status ] || mkfifo $HOME/.dwm-status
$HOME/.dwm.in 
exec dwm  $HOME/.dwm-status

In .dmw.in I have:

#!/bin/sh

while true
do
echo [ B: `/usr/sbin/apm -l`% T: `/sbin/sysctl hw.sensors.aps0.temp0 \
| sed 's/hw.sensors.aps0.temp0=//g' | sed 's/.00//g' | awk '{print \
$1}'`C ] [ `uptime | perl -e ' =~ \
/\s+([0-9.]+),\s+([0-9.]+),\s+([0-9.]+)/;print qq[$1, $2, $3];'` ] [ \
`date +%m/%d/%y %H:%M` ]  ~/.dwm-status
  sleep 60
done

I'm now able to use alt+shift+q and dwm and the xsession exits like I
would expect!
-- 
James Turner
BSD Group Consulting
http://www.bsdgroup.org



Re: [dwm] Feature request for changing master window's height.

2007-06-15 Thread James Turner
Does anybody know if there is an updated patch for bottomstack?  It
fails it two places while patching.  Thanks.

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



Re: [dwm] Feature request for changing master window's height.

2007-06-15 Thread James Turner
On Sat, Jun 16, 2007 at 04:06:44AM +0200, Engin Tola wrote:
 
 Can you tell at which places it fail ? 
 I just recently *manually* patched it. Maybe I can assist.
 
 
 James Turner [EMAIL PROTECTED] writes:
 
  Does anybody know if there is an updated patch for bottomstack?  It
  fails it two places while patching.  Thanks.
 
  --
  James Turner
  BSD Group Consulting
  http://www.bsdgroup.org
 
 
 -- 
 engin tola - http://cvlab.epfl.ch/~tola/
 emacs  - http://www.gnu.org/software/emacs/tour/

Sure, below is the output of running patch -p1 inside my dwm-4.2 dir.

Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--
|--- /usr/local/src/dwm/dwm-4.1-virgin/layout.c 2007-05-21
20:59:45.0 -0400
|+++ layout.c   2007-05-22 16:06:19.0 -0400
--
Patching file layout.c using Plan A...
Hunk #1 failed at 14.
Hunk #2 failed at 38.
Hunk #3 succeeded at 81 (offset 12 lines).
Hunk #4 succeeded at 194 (offset -4 lines).
Hunk #5 succeeded at 232 (offset 12 lines).
Hunk #6 failed at 341.
3 out of 6 hunks failed--saving rejects to layout.c.rej
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--
|--- /usr/local/src/dwm/dwm-4.1-virgin/config.default.h 2007-05-21
20:59:45.0 -0400
|+++ config.default.h   2007-05-21 21:33:42.0 -0400
--
Patching file config.default.h using Plan A...
Hunk #1 succeeded at 29 (offset -2 lines).
done

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



Re: [dwm] Feature request for changing master window's height.

2007-06-15 Thread James Turner
On Sat, Jun 16, 2007 at 04:50:45AM +0200, Engin Tola wrote:
 James Turner [EMAIL PROTECTED] writes:
 
  On Sat, Jun 16, 2007 at 04:06:44AM +0200, Engin Tola wrote:
 
  Can you tell at which places it fail ?
  I just recently *manually* patched it. Maybe I can assist.
 
   Does anybody know if there is an updated patch for bottomstack?  It
   fails it two places while patching.  Thanks.
  
  Sure, below is the output of running patch -p1 inside my dwm-4.2 dir.
 
  Hmm...  Looks like a unified diff to me...
  The text leading up to this was:
  --
  |--- /usr/local/src/dwm/dwm-4.1-virgin/layout.c 2007-05-21
  20:59:45.0 -0400
  |+++ layout.c   2007-05-22 16:06:19.0 -0400
  --
  Patching file layout.c using Plan A...
  Hunk #1 failed at 14.
  Hunk #2 failed at 38.
  Hunk #3 succeeded at 81 (offset 12 lines).
  Hunk #4 succeeded at 194 (offset -4 lines).
  Hunk #5 succeeded at 232 (offset 12 lines).
  Hunk #6 failed at 341.
  3 out of 6 hunks failed--saving rejects to layout.c.rej
  Hmm...  The next patch looks like a unified diff to me...
  The text leading up to this was:
  --
  |--- /usr/local/src/dwm/dwm-4.1-virgin/config.default.h 2007-05-21
  20:59:45.0 -0400
  |+++ config.default.h   2007-05-21 21:33:42.0 -0400
  --
  Patching file config.default.h using Plan A...
  Hunk #1 succeeded at 29 (offset -2 lines).
  done
 
 this is pretty much illegible with only line numbers. I suggest you to
 open the diff file and layout.c. It is pretty much easy to follow the
 diff file and make the necessary changes. I also attach my own layout.c 
 so that you can adapt yours appropriately. (if you haven't edited your
 layout file before, then you should have this layout in the end actually.)

Thanks for attaching your layout.c.  Sorry the provided output wasn't
any help.  I will just patch it by hand, I was really just curious if
the patch was still being maintained.

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



Re: [dwm] Feature request for changing master window's height.

2007-06-15 Thread James Turner
On Sat, Jun 16, 2007 at 04:50:45AM +0200, Engin Tola wrote:
 James Turner [EMAIL PROTECTED] writes:
 
  On Sat, Jun 16, 2007 at 04:06:44AM +0200, Engin Tola wrote:
 
  Can you tell at which places it fail ?
  I just recently *manually* patched it. Maybe I can assist.
 
   Does anybody know if there is an updated patch for bottomstack?  It
   fails it two places while patching.  Thanks.
  
  Sure, below is the output of running patch -p1 inside my dwm-4.2 dir.
 
  Hmm...  Looks like a unified diff to me...
  The text leading up to this was:
  --
  |--- /usr/local/src/dwm/dwm-4.1-virgin/layout.c 2007-05-21
  20:59:45.0 -0400
  |+++ layout.c   2007-05-22 16:06:19.0 -0400
  --
  Patching file layout.c using Plan A...
  Hunk #1 failed at 14.
  Hunk #2 failed at 38.
  Hunk #3 succeeded at 81 (offset 12 lines).
  Hunk #4 succeeded at 194 (offset -4 lines).
  Hunk #5 succeeded at 232 (offset 12 lines).
  Hunk #6 failed at 341.
  3 out of 6 hunks failed--saving rejects to layout.c.rej
  Hmm...  The next patch looks like a unified diff to me...
  The text leading up to this was:
  --
  |--- /usr/local/src/dwm/dwm-4.1-virgin/config.default.h 2007-05-21
  20:59:45.0 -0400
  |+++ config.default.h   2007-05-21 21:33:42.0 -0400
  --
  Patching file config.default.h using Plan A...
  Hunk #1 succeeded at 29 (offset -2 lines).
  done
 
 this is pretty much illegible with only line numbers. I suggest you to
 open the diff file and layout.c. It is pretty much easy to follow the
 diff file and make the necessary changes. I also attach my own layout.c 
 so that you can adapt yours appropriately. (if you haven't edited your
 layout file before, then you should have this layout in the end actually.)
 

While running dwm with the bstackportrait(TTT) layout, there is a small
gap between the master and the other windows.  This gap is only present
in the bstackportrait(TTT) layout and not in any of the default layouts
or those added by the bottomstack patch.  Does anyone have a fix? 

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



[dwm] Updated bottomstack patch for 4.2

2007-06-16 Thread James Turner
Attached is a patch to add the bottomstack layouts to a clean 4.2 install.
I also changed somethings in the portrait layout in order to remove the
gap between the master and other windows.

-- 
James Turner
BSD Group Consulting
http://www.bsdgroup.org
--- layout.cWed May 30 06:20:42 2007
+++ layout.cSat Jun 16 10:16:28 2007
@@ -28,7 +28,7 @@ unban(Client *c) {
 }
 
 static void
-tile(void) {
+_tile(const Bool right) {
unsigned int i, n, nx, ny, nw, nh, mw, mh, tw, th;
Client *c;
 
@@ -49,6 +49,8 @@ tile(void) {
nx = wax;
ny = way;
if(i  nmaster) {
+if(!right)
+  nx += tw;
ny += i * mh;
nw = mw - 2 * c-border;
nh = mh;
@@ -57,7 +59,8 @@ tile(void) {
nh -= 2 * c-border;
}
else {  /* tile window */
-   nx += mw;
+if(right)
+ nx += mw;
nw = tw - 2 * c-border;
if(th  2 * c-border) {
ny += (i - nmaster) * th;
@@ -78,6 +81,83 @@ tile(void) {
restack();
 }
 
+static void
+_bstack(const Bool portrait) {
+ unsigned int i, n, nx, ny, nw, nh, mw, mh, tw, th;
+ Client *c;
+
+ for(n = 0, c = nexttiled(clients); c; c = nexttiled(c-next))
+   n++;
+ /* window geoms */
+ mh = (n  nmaster) ? ((wah * masterw) / 1000) / nmaster : wah / (n  0 ? n : 
1);
+ mw = waw;
+ th = (n  nmaster) ? ((wah * (1000 - masterw)) / 1000) / (portrait ? 1 : n - 
nmaster) : 0;
+ tw = (n  nmaster) ? waw / (portrait ? n - nmaster : 1) : 0;
+
+ for(i = 0, c = clients; c; c = c-next)
+   if(isvisible(c)) {
+ if(c-isbanned)
+   XMoveWindow(dpy, c-win, c-x, c-y);
+ c-isbanned = False;
+ if(c-isfloating)
+   continue;
+ c-ismax = False;
+ nx = wax;
+ ny = way;
+ if(i  nmaster) {
+   ny += i * mh;
+   nw = mw - 2 * c-border;
+   nh = mh - 2 * c-border;
+ }
+ else if(portrait) { /* portrait bstack tiles */
+   nx += (i - nmaster) * tw;
+   ny += mh * nmaster;
+   nw = tw - 2 * c-border;
+   nh = th - 2 * c-border + 1;
+ } else { /* landscape bstack tiles */
+   ny += mh * nmaster;
+   nw = tw - 2 * c-border;
+   if(th  2 * c-border) {
+ ny += (i - nmaster) * th;
+ nh = th - 2 * c-border;
+ if (i == n - 1)
+   nh += (n  nmaster) ? wah - mh - th * (n - nmaster) : 0;
+   }
+   else /* fallback if th = 2 * c-border */
+ nh = wah - 2 * c-border;
+ }
+ resize(c, nx, ny, nw, nh, False);
+ i++;
+   }
+   else {
+ c-isbanned = True;
+ XMoveWindow(dpy, c-win, c-x + 2 * sw, c-y);
+   }
+ if(!sel || !isvisible(sel)) 
+   focus(c);
+ restack();
+}
+
+static void
+tile(void) {
+ _tile(True);
+}
+
+static void
+tileleft(void) {
+ _tile(False);
+}
+
+static void
+bstackportrait(void) {
+ _bstack(True);
+}
+
+static void
+bstacklandscape(void) {
+ _bstack(False);
+}
+
 LAYOUTS
 
 /* extern */
@@ -126,7 +206,7 @@ focusclient(const char *arg) {
 void
 incmasterw(const char *arg) {
int i;
-   if(lt-arrange != tile)
+   if(lt-arrange == floating)
return;
if(!arg)
masterw = MASTERWIDTH;
@@ -148,7 +228,7 @@ incnmaster(const char *arg) {
nmaster = NMASTER;
else {
i = atoi(arg);
-   if((lt-arrange != tile) || (nmaster + i  1)
+   if((lt-arrange == floating) || (nmaster + i  1)
|| (wah / (nmaster + i) = 2 * BORDERPX))
return;
nmaster += i;
--- config.default.hWed May 30 06:20:42 2007
+++ config.default.hFri Jun 15 23:03:30 2007
@@ -29,6 +29,9 @@ static Rule rule[] = { \
 static Layout layout[] = { \
/* symbol   function */ \
{ []=,tile }, /* first entry is default */ \
+  { =[],tileleft }, \
+  { TTT,bstackportrait }, \
+  { ===,bstacklandscape }, \
{ ,floating }, \
 };
 #define MASTERWIDTH600 /* master width per thousand */


Re: [dwm] Updated bottomstack patch for 4.2

2007-06-16 Thread James Turner
On Sat, Jun 16, 2007 at 07:44:18PM +0200, Anydot wrote:
 On (16/06/07 10:26), James Turner wrote:
  Attached is a patch to add the bottomstack layouts to a clean 4.2 install.
  I also changed somethings in the portrait layout in order to remove the
  gap between the master and other windows.
  
 
 please, use ban/unban functions to ban/unban client. See tile() for
 example of use :)
 
 -- 
 Premysl Anydot Hruby  http://na.srck.net 

Thanks, attached is a new diff.  Hopefully I made the correct fixes.
I'm sure if the original patch created released a new diff it would be
ten times better then mine :).

-- 
James Turner
BSD Group Consulting
http://www.bsdgroup.org
--- layout.cWed May 30 06:20:42 2007
+++ layout.cSat Jun 16 15:50:31 2007
@@ -28,7 +28,7 @@ unban(Client *c) {
 }
 
 static void
-tile(void) {
+_tile(const Bool right) {
unsigned int i, n, nx, ny, nw, nh, mw, mh, tw, th;
Client *c;
 
@@ -49,6 +49,8 @@ tile(void) {
nx = wax;
ny = way;
if(i  nmaster) {
+if(!right)
+  nx += tw;
ny += i * mh;
nw = mw - 2 * c-border;
nh = mh;
@@ -57,7 +59,8 @@ tile(void) {
nh -= 2 * c-border;
}
else {  /* tile window */
-   nx += mw;
+if(right)
+ nx += mw;
nw = tw - 2 * c-border;
if(th  2 * c-border) {
ny += (i - nmaster) * th;
@@ -78,6 +81,85 @@ tile(void) {
restack();
 }
 
+static void
+_bstack(const Bool portrait) {
+ unsigned int i, n, nx, ny, nw, nh, mw, mh, tw, th;
+ Client *c;
+
+ for(n = 0, c = nexttiled(clients); c; c = nexttiled(c-next))
+   n++;
+ /* window geoms */
+ mh = (n  nmaster) ? ((wah * masterw) / 1000) / nmaster : wah / (n  0 ? n : 
1);
+ mw = waw;
+ th = (n  nmaster) ? ((wah * (1000 - masterw)) / 1000) / (portrait ? 1 : n - 
nmaster) : 0;
+ tw = (n  nmaster) ? waw / (portrait ? n - nmaster : 1) : 0;
+
+ for(i = 0, c = clients; c; c = c-next)
+   if(isvisible(c)) {
+ if(c-isbanned)
+   XMoveWindow(dpy, c-win, c-x, c-y);
+ /*c-isbanned = False;*/
+ unban(c);
+ if(c-isfloating)
+   continue;
+ c-ismax = False;
+ nx = wax;
+ ny = way;
+ if(i  nmaster) {
+   ny += i * mh;
+   nw = mw - 2 * c-border;
+   nh = mh - 2 * c-border;
+ }
+ else if(portrait) { /* portrait bstack tiles */
+   nx += (i - nmaster) * tw;
+   ny += mh * nmaster;
+   nw = tw - 2 * c-border;
+   nh = th - 2 * c-border + 1;
+ } else { /* landscape bstack tiles */
+   ny += mh * nmaster;
+   nw = tw - 2 * c-border;
+   if(th  2 * c-border) {
+ ny += (i - nmaster) * th;
+ nh = th - 2 * c-border;
+ if (i == n - 1)
+   nh += (n  nmaster) ? wah - mh - th * (n - nmaster) : 0;
+   }
+   else /* fallback if th = 2 * c-border */
+ nh = wah - 2 * c-border;
+ }
+ resize(c, nx, ny, nw, nh, False);
+ i++;
+   }
+   else {
+ /*c-isbanned = True;*/
+ ban(c);
+ XMoveWindow(dpy, c-win, c-x + 2 * sw, c-y);
+   }
+ if(!sel || !isvisible(sel)) 
+   focus(c);
+ restack();
+}
+
+static void
+tile(void) {
+ _tile(True);
+}
+
+static void
+tileleft(void) {
+ _tile(False);
+}
+
+static void
+bstackportrait(void) {
+ _bstack(True);
+}
+
+static void
+bstacklandscape(void) {
+ _bstack(False);
+}
+
 LAYOUTS
 
 /* extern */
@@ -126,7 +208,7 @@ focusclient(const char *arg) {
 void
 incmasterw(const char *arg) {
int i;
-   if(lt-arrange != tile)
+   if(lt-arrange == floating)
return;
if(!arg)
masterw = MASTERWIDTH;
@@ -148,7 +230,7 @@ incnmaster(const char *arg) {
nmaster = NMASTER;
else {
i = atoi(arg);
-   if((lt-arrange != tile) || (nmaster + i  1)
+   if((lt-arrange == floating) || (nmaster + i  1)
|| (wah / (nmaster + i) = 2 * BORDERPX))
return;
nmaster += i;
--- config.default.hWed May 30 06:20:42 2007
+++ config.default.hFri Jun 15 23:03:30 2007
@@ -29,6 +29,9 @@ static Rule rule[] = { \
 static Layout layout[] = { \
/* symbol   function */ \
{ []=,tile }, /* first entry is default */ \
+  { =[],tileleft }, \
+  { TTT,bstackportrait }, \
+  { ===,bstacklandscape }, \
{ ,floating }, \
 };
 #define MASTERWIDTH600 /* master width per thousand */


Re: [dwm] about dwm's quit and Xorg's quit

2007-06-17 Thread James Turner
On Sun, Jun 17, 2007 at 03:39:18PM +0200, Philipp K??hler wrote:
 If i use dwms MOD+shift+Q i dont really exit dwm... just a blank
 screen. but i dont return to gdm.
 
 right now i use MOD+shift+Q to quit dwm and then i use Ctrl-Alt-BS to
 restart X and get into gdm. is there a easier/better method?!
 
 thx a lot
 
 On 6/12/07, Christian Garbs [EMAIL PROTECTED] wrote:
 On Mon, Jun 11, 2007 at 09:14:14AM +0800, anhnmncb wrote:
 
  what's the difference between dwm's quit using Alt-Shift-Q by
  default and Xorg's quit using Ctrl-Alt-BS, which one is better for
  quit?
 
 The former quits the dwm process while the latter kills the whole X
 server.  Depending on your setup, these can be two very different
 things.
 
 For example, when you are modifing dwm, you could run it in an endless
 loop, so that you can just do a compile, kill dwm and the freshly
 recompiled dwm will restart _without_ killing your whole X session.
 (Personally, I prefer the dwm restart patch for this situation.)
 
 If you run dwm from your .Xsession and quitting dwm also ends your X
 session, then both variants are nearly identical.  Although a proper
 shutdown of your X session might be favored to just killing the X
 server.
 
 Redards,
 Christian
 --
 Christian.Garbs.http://www.cgarbs.de
 
 Wird Neuling jetzt eigentlich standartm??ssig Newbee geschrieben?

You can try my solution here:
http://www.suckless.org/pipermail/dwm/2007-June/002768.html.  I dont use
a display manager like gdm, but my xsession does shutdown cleanly as it
should when I a-shift-q to quit dwm.

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



Re: [dwm] bottomstacking patch works with dwm-4.3

2007-07-15 Thread James Turner
You can also find the bottom stack patch here: http://calminferno.net/ 
files/dwm-4.2-bstack.diff.  Also, here: http://calminferno.net/files/ 
dwm-4.2-main.diff is a diff to use strlcpy instead of strcpy if you  
run OpenBSD.


Feel free to attach the patch to the current bottom stack entry in  
the wiki.

--
James Turner



Re: [dwm] bottomstacking patch works with dwm-4.3

2007-07-15 Thread James Turner

Here are the links again, if they didn't come through.

http://calminferno.net/files/dwm-4.2-bstack.diff
http://calminferno.net/files/dwm-4.2-main.diff

On Jul 15, 2007, at 7:47 PM, James Turner wrote:

You can also find the bottom stack patch here: http:// 
calminferno.net/files/dwm-4.2-bstack.diff.  Also, here: http:// 
calminferno.net/files/dwm-4.2-main.diff is a diff to use strlcpy  
instead of strcpy if you run OpenBSD.


Feel free to attach the patch to the current bottom stack entry in  
the wiki.

--
James Turner






Re: [dwm] OpenBSD 4.1 issues with DWM

2007-07-28 Thread James Turner
Amit,

I just did a fresh install of OpenBSD 4.1 release and dwm 4.3 within
parallels on my mac.  I also applied my various patches and everything
works great.  I would take Tobias suggestions and look into the X driver
you are using.  It seem to be more hardware related or possibly a miss
configuration.  Good luck.

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



Re: [dwm] uxterm - no syntax highlighting in vi

2007-08-07 Thread James Turner
On Tue, Aug 07, 2007 at 10:57:40AM -0600, A A wrote:
 Greetings everyone!
 
 I'd like to write a script which will open up a bunch of uxterms  vim but
 for some reason I don't get any colors?  I've check all environment
 variables and in vim syntax on won't work.
 Anyone have any ideas or is there a better to do this?
 
 
 #get file list
 #open all files with:
 
 uxterm -bg '#00' -fg '#ee' -cr '#ff' +sb -e vim SOMEFILE (perl,
 c++, etc...)
 
 
 
 
 
 Thanks everyone!
 
 
 Regards,
 -Al

You need to do something like uxterm -e bash -l -c vim SOMEFILE.  This
will start bash as a login shell and then execute vim within it, which
should provide you with syntax hilighting.

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



[dwm] Update: bottomstack patch for latest 4.4 tip

2007-08-11 Thread James Turner
I've gone ahead and updated the bottom stack patch to work with the new
4.4 tip.  I just ported the portrait layout since that's all I use.
Please test this against the latest tip.  One question for you C
hackers, how to I get the incmaster and zoom functions with in the
tile.c to work with my new bstack.c?  Also any suggestions ore always
welcome.

Patch here: http://calminferno.net/files/dwm-4.4-bstack.diff and
attached.

-- 
James Turner
BSD Group Consulting
http://www.bsdgroup.org
--- bstack.cWed Dec 31 19:00:00 1969
+++ bstack.cSat Aug 11 14:40:27 2007
@@ -0,0 +1,56 @@
+/* See LICENSE file for copyright and license details. */
+#include dwm.h
+
+/* static */
+
+static double master = MASTER;
+
+/* extern */
+
+void
+bstack(void) {
+   unsigned int i, n, nx, ny, nw, nh, mw, mh, tw, th;
+   Client *c;
+
+   for(n = 0, c = nexttiled(clients); c; c = nexttiled(c-next))
+   n++;
+
+   /* window geoms */
+  mh = (n  1) ? (wah * master) / 1 : wah / (n  0 ? n : 1);
+  mw = waw; 
+  th = (n  1) ? (wah * (1 - master)) / 1 : 0;
+  tw = (n  1) ? waw / (n - 1) : 0;
+
+  for(i = 0, c = clients; c; c = c-next)
+if(isvisible(c)) {
+  unban(c);
+  if(c-isfloating)
+continue;
+  c-ismax = False;
+  nx = wax;
+  ny = way;  
+  if(i  1) {
+ny += i * mh;
+nw = mw - 2 * c-border;
+nh = mh - 2 * c-border;
+  }
+  else {
+nx += (i - 1) * tw;
+ny += mh * 1;
+if(i + 1 == n) { /* remainder */
+  nw = (wax + waw) - nx - 2 * c-border;
+}
+else {
+  nw = tw - 2 * c-border;
+}
+nh = th - 2 * c-border + 1;
+  }
+  resize(c, nx, ny, nw, nh, False);
+  i++;
+}
+else
+  ban(c);
+  if(!sel || !isvisible(sel))
+focus(NULL);
+  restack();
+}
--- bstack.hWed Dec 31 19:00:00 1969
+++ bstack.hSat Aug 11 13:30:37 2007
@@ -0,0 +1,4 @@
+/* See LICENSE file for copyright and license details. */
+
+/* bstack.c */
+void bstack(void); /* arranges all windows bottom stacked 
*/
--- config.arg.hSat Aug 11 11:38:26 2007
+++ config.arg.hSat Aug 11 12:00:41 2007
@@ -26,11 +26,13 @@ static Rule rule[] = { \
 /* layout(s) */
 #include tile.h
 #include float.h
+#include bstack.h
 #define LAYOUTS \
 static Layout layout[] = { \
/* symbol   function */ \
{ []=,tile }, /* first entry is default */ \
{ ,floating }, \
+  { TTT,bstack }, \
 };
 #define MASTER 0.6 /* 0.1 .. 0.9 */
 #define SNAP   32  /* snap pixel */
--- config.default.hSat Aug 11 11:38:26 2007
+++ config.default.hSat Aug 11 12:00:19 2007
@@ -27,11 +27,13 @@ static Rule rule[] = { \
 /* layout(s) */
 #include tile.h
 #include float.h
+#include bstack.h
 #define LAYOUTS \
 static Layout layout[] = { \
/* symbol   function */ \
{ []=,tile }, /* first entry is default */ \
{ ,floating }, \
+  { TTT,bstack }, \
 };
 #define MASTER 0.6 /* 0.1 .. 0.9 */
 #define SNAP   32  /* snap pixel */
--- config.mk   Sat Aug 11 11:38:26 2007
+++ config.mk   Sat Aug 11 11:59:46 2007
@@ -4,7 +4,7 @@ VERSION = 4.4
 # Customize below to fit your system
 
 # layouts
-SRC = float.c tile.c
+SRC = float.c tile.c bstack.c
 
 # paths
 PREFIX = /usr/local


Re: [dwm] Update: bottomstack patch for latest 4.4 tip

2007-08-11 Thread James Turner
Well the zoom function seems to work, but increasing the master area  
does not.  I changed part of the incmaster function within tile.c to  
if(lt-arrange == floating) return; but I still can't increase the  
master in the bottom stack layout mode.  Any ideas?


On Aug 11, 2007, at 6:58 PM, James Turner wrote:

Quick note just in case, use patch -p0  dwm-4.4-bstack.diff within  
the dwm source dir to apply.


On Aug 11, 2007, at 6:53 PM, James Turner wrote:

I've gone ahead and updated the bottom stack patch to work with  
the new

4.4 tip.  I just ported the portrait layout since that's all I use.
Please test this against the latest tip.  One question for you C
hackers, how to I get the incmaster and zoom functions with in the
tile.c to work with my new bstack.c?  Also any suggestions ore always
welcome.

Patch here: http://calminferno.net/files/dwm-4.4-bstack.diff and
attached.

--
James Turner
BSD Group Consulting
http://www.bsdgroup.org
dwm-4.4-bstack.diff


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





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





Re: [dwm] Update: bottomstack patch for latest 4.4 tip

2007-08-12 Thread James Turner
On Sun, Aug 12, 2007 at 12:53:46PM +0200, Anselm R. Garbe wrote:
 On Sat, Aug 11, 2007 at 08:09:54PM -0400, James Turner wrote:
  Well the zoom function seems to work, but increasing the master area  
  does not.  I changed part of the incmaster function within tile.c to  
  if(lt-arrange == floating) return; but I still can't increase the  
  master in the bottom stack layout mode.  Any ideas?
 
 
 Well I decided against making master global. I pushed a
 changeset recently with following decisions:
 
 MASTER is renamed to MWFACT (master width factor) - which is
 more precise.
 
 master in tile.c is renamed to mwfact, incmaster is renamed to
 addtomwfact - which is also more precise.
 
 So this change also points out, that your bstack patch should
 contain something like MHFACT (master height factor) as counter
 part. Except of zoom(), which you can re-use from tile, I
 propose you clone the addtomwfact() behavior as follows for
 bstack:
 
 
 /* static */
 
 static double mhfact = MHFACT;
 
 /* extern */
 
 void
 addtomhfact(const char *arg) {
   double delta;
 
   if(lt-arrange != bstack)
   return;
 
   /* arg handling, manipulate mhfact */
   if(arg  (1 == sscanf(arg, %lf, delta))) {
   if(delta + mhfact  0.1  delta + mhfact  0.9)
   mhfact += delta;
   }
   lt-arrange();
 }
 
 
 And in config.h you add something like this (besides cloning
 MHFACT similiar to MWFACT):
 
 
 { MODKEY,   XK_h, addtomwfact,-0.05 }, \
 { MODKEY,   XK_l, addtomhfact,0.05 } , \
 { MODKEY,   XK_h, addtomwfact,-0.05 }, \
 { MODKEY,   XK_l, addtomhfact,0.05 } , \
 
 
 This is somewhat cumbersome for bstack, but the only other
 option would be to design bstack as patch to tile.c.
 
 Regards,
 -- 
  Anselm R. Garbe  http://www.suckless.org/  GPG key: 0D73F361

Because of the nature of bstack, would it make more sense to just patch
tile.c rather than make it it's own layout and clone the addtowfact
function?  Since changes are still happening I would like to take this
time to make sure the patch is done the so called correct way.
Thanks.

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



Re: [dwm] dwm-4.4

2007-08-23 Thread James Turner
On Thu, Aug 23, 2007 at 12:45:47PM -0400, Jeremy O'Brien wrote:
 On Thu, Aug 23, 2007 at 06:19:13PM +0200, Anselm R. Garbe wrote:
  Hi there,
  
  I created dwm-4.4, you can download it from
  
http://www.suckless.org/download/dwm-4.4.tar.gz
  
  This release contains certain bug fixes, a lot of code polishing
  and some removed features.
  
  I refer to the mailing list archives for details.
  
  Regards,
  -- 
   Anselm R. Garbe  http://www.suckless.org/  GPG key: 0D73F361
  
 
 Hopefully the wonderful patches out for dwm-4.3 will be ported up to
 this new version :)
 -- 
  Jeremy O'Brien aka neutral_insomniac
  GPG key: 0xB1140FDB http://pohl.ececs.uc.edu/~jeremy/jeremy.asc
  Linux ambelina 2.6.22.1 ppc 7447A, altivec supported PowerBook5,8 GNU/Linux

Speaking of patches, you can get the updated bstack and main (openbsd
only) patch from http://calminferno.net/files/.  I only ported the
bstack portrait layout since thats all I use.  Enjoy, and feel free to
post any issues.

-- 
James Turner
BSD Group Consulting
http://www.bsdgroup.org
--- config.default.hTue Aug 21 18:09:46 2007
+++ config.default.hTue Aug 21 18:10:27 2007
@@ -31,6 +31,7 @@ static Layout layouts[] = { \
/* symbol   function */ \
{ []=,tile }, /* first entry is default */ \
{ ,floating }, \
+   { TTT,bstack }, \
 };
 #define MWFACT 0.6 /* master width factor [0.1 .. 0.9] */
 #define SNAP   32  /* snap pixel */
--- tile.c  Tue Aug 21 18:09:46 2007
+++ tile.c  Tue Aug 21 18:17:00 2007
@@ -12,7 +12,7 @@ void
 setmwfact(const char *arg) {
double delta;
 
-   if(!isarrange(tile))
+   if(!isarrange(tile)  !isarrange(bstack))
return;
/* arg handling, manipulate mwfact */
if(arg == NULL)
@@ -71,10 +71,49 @@ tile(void) {
 }
 
 void
+bstack(void) {
+   unsigned int i, n, nx, ny, nw, nh, mw, mh, tw, th;
+   Client *c;
+
+   for(n = 0, c = nexttiled(clients); c; c = nexttiled(c-next))
+   n++;
+
+   /* window geoms */
+   mh = (n  1) ? (wah * mwfact) / 1 : wah / (n  0 ? n : 1);
+   mw = waw;
+   th = (n  1) ? (wah * (1 - mwfact)) / 1 : 0;
+   tw = (n  1) ? waw / (n - 1) : 0;
+
+   for(i = 0, c = nexttiled(clients); c; c = nexttiled(c-next)) {
+   c-ismax = False;
+   nx = wax;
+   ny = way;
+   if(i  1) {
+   ny += i * mh;
+   nw = mw - 2 * c-border;
+   nh = mh - 2 * c-border;
+   }
+   else {
+   nx += (i - 1) * tw;
+   ny += mh * 1;
+   if(i + 1 == n) { /* remainder */
+   nw = (wax + waw) - nx - 2 * c-border;
+   }
+   else {
+   nw = tw - 2 * c-border;
+   }
+   nh = th - 2 * c-border + 1;
+   }
+   resize(c, nx, ny, nw, nh, False);
+   i++;
+   }
+} 
+
+void
 zoom(const char *arg) {
Client *c;
 
-   if(!sel || !isarrange(tile) || sel-isfloating)
+   if(!sel || (!isarrange(tile)  !isarrange(bstack)) || sel-isfloating)
return;
if((c = sel) == nexttiled(clients))
if(!(c = nexttiled(c-next)))
--- tile.h  Tue Aug 21 18:09:46 2007
+++ tile.h  Tue Aug 21 18:10:55 2007
@@ -3,4 +3,5 @@
 /* tile.c */
 void setmwfact(const char *arg);   /* sets master width factor */
 void tile(void);   /* arranges all windows tiled */
+void bstack(void); /* arranges all windows bottom stacked 
*/
 void zoom(const char *arg);/* zooms the focused client to master 
area, arg is ignored */
--- main.c  Thu Aug 23 12:11:41 2007
+++ main.c  Thu Aug 23 09:15:10 2007
@@ -221,7 +221,7 @@
XDefineCursor(dpy, barwin, cursor[CurNormal]);
updatebarpos();
XMapRaised(dpy, barwin);
-   strcpy(stext, dwm-VERSION);
+   strlcpy(stext, dwm-VERSIONi, sizeof(stext));
/* pixmap for everything */
dc.drawable = XCreatePixmap(dpy, root, sw, bh, DefaultDepth(dpy, 
screen));
dc.gc = XCreateGC(dpy, root, 0, 0);


[dwm] Updated bottom stack patch

2007-09-15 Thread James Turner
I've updated the bottom stack patch to work with the new micromizied
version of dwm.  It includes my previous main patch as well, so if your
operating system doesn't support strlcpy you will need to remove that
part from the patch.  Let me know if you experience any issues.

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



Re: [dwm] Updated bottom stack patch

2007-09-15 Thread James Turner
On Sat, Sep 15, 2007 at 06:24:35PM -0400, James Turner wrote:
 I've updated the bottom stack patch to work with the new micromizied
 version of dwm.  It includes my previous main patch as well, so if your
 operating system doesn't support strlcpy you will need to remove that
 part from the patch.  Let me know if you experience any issues.
 
 -- 
 James Turner
 BSD Group Consulting
 http://www.bsdgroup.org

Oops, forgot to attach the actual patch.

-- 
James Turner
BSD Group Consulting
http://www.bsdgroup.org
--- config.hSat Sep 15 18:10:36 2007
+++ config.hSat Sep 15 18:12:32 2007
@@ -26,6 +26,7 @@ static Layout layouts[] = {
/* symbol   function */
{ []=,tile }, /* first entry is default */
{ ,floating },
+{ TTT,bstack },
 };
 #define RESIZEHINTSTrue/* False - respect size hints in tiled 
resizals */
 #define MWFACT 0.6 /* master width factor [0.1 .. 0.9] */
--- dwm.c   Sat Sep 15 18:10:36 2007
+++ dwm.c   Sat Sep 15 17:53:58 2007
@@ -177,6 +177,7 @@ static void tag(const char *arg);
 static unsigned int textnw(const char *text, unsigned int len);
 static unsigned int textw(const char *text);
 static void tile(void);
+static void bstack(void);
 static void togglebar(const char *arg);
 static void togglefloating(const char *arg);
 static void togglemax(const char *arg);
@@ -479,7 +480,7 @@ initbar(void) {
XDefineCursor(dpy, barwin, cursor[CurNormal]);
updatebarpos();
XMapRaised(dpy, barwin);
-   strcpy(stext, dwm-VERSION);
+   strlcpy(stext, dwm-VERSION, sizeof(stext));
dc.drawable = XCreatePixmap(dpy, root, sw, bh, DefaultDepth(dpy, 
screen));
dc.gc = XCreateGC(dpy, root, 0, 0);
XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
@@ -1723,7 +1724,7 @@ static void
 setmwfact(const char *arg) {
double delta;
 
-   if(!isarrange(tile))
+   if(!isarrange(tile)  !isarrange(bstack))
return;
/* arg handling, manipulate mwfact */
if(arg == NULL)
@@ -1780,11 +1781,48 @@ tile(void) {
}
 }
 
+void
+bstack(void) {
+unsigned int i, n, nx, ny, nw, nh, mh, tw, th;
+Client *c;
+
+for(n = 0, c = nexttiled(clients); c; c = nexttiled(c-next))
+n++;
+
+/* window geoms */
+mh = (n  1) ? (wah * mwfact) / 1 : wah / (n  0 ? n : 1);
+th = (n  1) ? (wah * (1 - mwfact)) / 1 : 0;
+tw = (n  1) ? waw / (n - 1) : 0;
+
+for(i = 0, c = nexttiled(clients); c; c = nexttiled(c-next), i++) {
+c-ismax = False;
+nx = wax;
+ny = way;
+if(i  1) {
+ny += i * mh;
+nw = waw - 2 * c-border;
+nh = mh - 2 * c-border;
+}
+else {
+nx += (i - 1) * tw;
+ny += mh * 1;
+if(i + 1 == n) { /* remainder */
+nw = (wax + waw) - nx - 2 * c-border;
+}
+else {
+nw = tw - 2 * c-border;
+}
+nh = th - 2 * c-border + 1;
+}
+resize(c, nx, ny, nw, nh, RESIZEHINTS);
+}
+}
+
 static void
 zoom(const char *arg) {
Client *c;
 
-   if(!sel || !isarrange(tile) || sel-isfloating)
+   if(!sel || (!isarrange(tile)  !isarrange(bstack)) || sel-isfloating)
return;
if((c = sel) == nexttiled(clients))
if(!(c = nexttiled(c-next)))


Re: [dwm] Updated bottom stack patch

2007-09-16 Thread James Turner
On Sun, Sep 16, 2007 at 01:18:24PM +0200, Anselm R. Garbe wrote:
 Hi James,
 
 cool, I want to give an example how your patch should be
 reorganized that it works with less of a hassle beginning with dwm-4.5:

[snip]

Thanks for the great example, that will especially make things
easier while the code is still being changed.  I think before 4.4 was
released I probably rewrote my patch at least a dozen times to work with
the changing source tree.  This of course will eliminate that need all
together.

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



Re: [dwm] Proper way of monitoring battery level in DWM

2007-09-16 Thread James Turner

On Sep 16, 2007, at 4:34 PM, Amit wrote:


Thank you for all the responses.

Actually right now, I am using apm. I am not sure if acpi is supported
on my notebook. This is an old PowerBook G4 500MHz. I will try
modifying the scripts to use apm instead of acpi.

Amit


I just use something like this echo `/usr/sbin/apm -l`%.  If all  
you want is

the remaining percentage it does the trick nicely.

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




[dwm] Bottom stack update

2007-09-22 Thread James Turner
Attached is an updated patch for the bottom stack layout.  The setmhfact
and bzoom functions can be removed once the normal setmwfact and zoom
function are updated to use isarrange(floating) mentioned in a previous
email.  Let me know of any issues.

-- 
James Turner
BSD Group Consulting
http://www.bsdgroup.org
--- bstack.cWed Dec 31 19:00:00 1969
+++ bstack.cSat Sep 22 15:10:39 2007
@@ -0,0 +1,73 @@
+void
+bstack(void) {
+unsigned int i, n, nx, ny, nw, nh, mh, tw, th;
+Client *c;
+
+for(n = 0, c = nexttiled(clients); c; c = nexttiled(c-next))
+n++;
+
+/* window geoms */
+mh = (n  1) ? (wah * mwfact) / 1 : wah / (n  0 ? n : 1);
+th = (n  1) ? (wah * (1 - mwfact)) / 1 : 0;
+tw = (n  1) ? waw / (n - 1) : 0;
+
+for(i = 0, c = nexttiled(clients); c; c = nexttiled(c-next), i++) {
+c-ismax = False;
+nx = wax;
+ny = way;
+if(i  1) {
+ny += i * mh;
+nw = waw - 2 * c-border;
+nh = mh - 2 * c-border;
+}
+else {
+nx += (i - 1) * tw;
+ny += mh * 1;
+if(i + 1 == n) { /* remainder */
+nw = (wax + waw) - nx - 2 * c-border;
+}
+else {
+nw = tw - 2 * c-border;
+}
+nh = th - 2 * c-border + 1;
+}
+resize(c, nx, ny, nw, nh, RESIZEHINTS);
+}
+}
+
+void
+setmhfact(const char *arg) {
+double delta;
+
+if(!isarrange(bstack))
+return;
+/* arg handling, manipulate mwfact */
+if(arg == NULL)
+mwfact = MWFACT;
+else if(1 == sscanf(arg, %lf, delta)) {
+if(arg[0] == '+' || arg[0] == '-')
+mwfact += delta;
+else
+mwfact = delta;
+if(mwfact  0.1)
+mwfact = 0.1;
+else if(mwfact  0.9)
+mwfact = 0.9;
+}
+arrange();
+}
+
+void
+bzoom(const char *arg) {
+Client *c;
+
+if(!sel || !isarrange(bstack) || sel-isfloating)
+return; 
+if((c = sel) == nexttiled(clients))
+if(!(c = nexttiled(c-next)))
+return;
+detach(c);
+attach(c);
+focus(c);
+arrange();
+}
--- config.hSat Sep 22 03:11:13 2007
+++ config.hSat Sep 22 15:11:09 2007
@@ -21,14 +21,16 @@ Rule rules[] = {
{ Acroread,   NULL,   True },
 };
 
+#define RESIZEHINTS True/* False - respect size hints in tiled 
resizals */
+#define MWFACT  0.6 /* master width factor [0.1 .. 0.9] */
 /* layout(s) */
+#include bstack.c
 Layout layouts[] = {
/* symbol   function */
{ []=,tile }, /* first entry is default */
{ ,floating },
+{ TTT,bstack },
 };
-#define RESIZEHINTSTrue/* False - respect size hints in tiled 
resizals */
-#define MWFACT 0.6 /* master width factor [0.1 .. 0.9] */
 #define SNAP   32  /* snap pixel */
 
 /* key definitions */
@@ -47,8 +49,11 @@ Key keys[] = { \
{ MODKEY,   XK_k,   focusprev,  NULL }, 
\
{ MODKEY,   XK_h,   setmwfact,  -0.05 
}, \
{ MODKEY,   XK_l,   setmwfact,  +0.05 
}, \
+{ MODKEY,   XK_h,   setmhfact,  -0.05 }, \
+{ MODKEY,   XK_l,   setmhfact,  +0.05 }, \
{ MODKEY,   XK_m,   togglemax,  NULL }, 
\
{ MODKEY,   XK_Return,  zoom,   NULL }, 
\
+{ MODKEY,   XK_Return,  bzoom,   NULL }, \
{ MODKEY|ShiftMask, XK_space,   togglefloating, NULL }, 
\
{ MODKEY|ShiftMask, XK_c,   killclient, NULL }, 
\
{ MODKEY,   XK_0,   view,   NULL }, 
\


Re: [dwm] NMASTER in dwm-4.5 (was a follow up to Tuncer)

2007-09-22 Thread James Turner
I forgot this one, but fixed in hg tip.

I pushed a change which introduces the ISTILE macro, which can
be extended with all layout functions, which should be enabled
to reuse setmwfact and zoom.

Could you give an example on how I might extend ISTILE so setmwfact and
zoom would work with both tile and bstack?  I tried a number of ways but
I can only get it to work with one or the other not both.

Examples:
ISTILE  isarrange(tile)  isarrange(bstack)
ISTILE  (isarrange(tile)  isarrange(bstack))

I use both tile and bstack layouts and would like to be able to use
both without changing ISTILE to either isarrange(tile) or
isarrange(bstack) each time.  Thanks.

ps. Anyone have a good book for a beginner learning c?

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



[dwm] Wiki password

2007-09-23 Thread James Turner
I'm trying to update the bottom stack patch wiki entry but can't seem to
find the password on the list anywhere.  If anyone would be willing to
email me it off list it would be greatly appreciated.

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



[dwm] Compiling with pcc

2007-10-16 Thread James Turner
So OpenBSD not so recently imported pcc into their tree.  I myself
recently compiled it and tried to compile dwm with it.  I was able to
compile dwm successfully but receive 4 warnings related to
XSetErrorHandler.  I realize this compiler is still in development and
these warning issues might not be dwm's fault but rather a bug in the
compiler, but I thought I'd post something and see if anyone might have
any suggestions where I might look to fix whatever is causing the
warnings.  Thanks.

dwm.c, line 362: warning: implicit conversion of argument 1 due to \
prototype
dwm.c, line 371: warning: implicit conversion of argument 1 due to \
prototype
dwm.c, line 1696: warning: implicit conversion of argument 1 due to \
prototype
dwm.c, line 1707: warning: implicit conversion of argument 1 due to \
prototype

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



Re: [dwm] Compiling with pcc

2007-10-16 Thread James Turner
On Tue, Oct 16, 2007 at 11:28:12PM +0200, Szabolcs Nagy wrote:
 On 10/16/07, James Turner [EMAIL PROTECTED] wrote:
  dwm.c, line 362: warning: implicit conversion of argument 1 due to \
  prototype
 
 looking into pcc src it is highly probable to be a compiler defect
 (after typechecking the arguments, this is the default error message
 when prototype cannot be matched to the arguments)
 
 also note that XSetErrorHandler is defined hideously (in Xlib.h) as
 
 typedef int (*XErrorHandler) (  /* WARNING, this type not in Xlib
 spec */
 Display*/* display */,
 XErrorEvent*/* error_event */
 );
 
 extern XErrorHandler XSetErrorHandler (
 XErrorHandler   /* handler */
 );
 
 
 
 ironnically i coulnd't compile the portable c compiler on linux to
 test it because of bsd dependencies..

Thanks for taking a look at it.  Yeah, from looking at Xlib.h and dwm.c
from my understanding everything is being done correct, int and so
forth.  Since I didn't get any response from the #pcc chan on freenode,
I think I'll send something to the pcc mailing list. 

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



Re: [dwm] Compiling with pcc

2007-10-17 Thread James Turner
Sorry about breaking the thread, I suck at keeping email.  Anyways, it
was an issue with pcc, for those interested, a patch can be found at
http://marc.info/?l=pcc-listm=119263171313410w=2.  dwm now compiles
perfect without any warnings using pcc.

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



Re: [dwm] dwm-4.6 / dmenu-3.4

2007-10-25 Thread James Turner
On Thu, Oct 25, 2007 at 08:39:20PM +0200, Anselm R. Garbe wrote:
 Hi there,
 
 I'm glad to announce new releases:
 
   http://www.suckless.org/download/dwm-4.6.tar.gz
   http://www.suckless.org/download/dmenu-3.4.tar.gz
 
 Many thanks go to all contributors, developers, testers, and the
 dwm/dmenu community for their great work and help! Without you
 all dwm won't be what it is already!!!
 
 Special thanks go to Eric Mertens who sanitized the aspect
 ratio handling!
 
 Regards,
 -- 
  Anselm R. Garbe  http://www.suckless.org/  GPG key: 0D73F361

Thanks for another great release of both dwm and dmenu.

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



Re: [dwm] dwm-4.6 / dmenu-3.4

2007-10-25 Thread James Turner
On Thu, Oct 25, 2007 at 09:43:02PM +0200, Pieter Verberne wrote:
 On Thu, Oct 25, 2007 at 03:39:19PM -0400, James Turner wrote:
  On Thu, Oct 25, 2007 at 08:39:20PM +0200, Anselm R. Garbe wrote:
   Hi there,
   
   I'm glad to announce new releases:
   
 http://www.suckless.org/download/dwm-4.6.tar.gz
 http://www.suckless.org/download/dmenu-3.4.tar.gz
   
   Many thanks go to all contributors, developers, testers, and the
   dwm/dmenu community for their great work and help! Without you
   all dwm won't be what it is already!!!
   
   Special thanks go to Eric Mertens who sanitized the aspect
   ratio handling!
   
   Regards,
   -- 
Anselm R. Garbe  http://www.suckless.org/  GPG key: 0D73F361
  
  Thanks for another great release of both dwm and dmenu.
 
 Where can I find a changelog?

Look between Added tag 4.5 and tag 4.6!

http://www.suckless.org/hg.rc/dwm/shortlog/1044

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



Re: [dwm] bottomstack updated for 4.7

2007-11-02 Thread James Turner
Fixed some layout bugs from 4.6 and 4.7.  Should perform even better
with resizehints.

http://bsdgroup.org/files/dwm-4.7-bstack.diff

-- 
James Turner
BSD Group Consulting
http://www.bsdgroup.org
--- bstack.cWed Dec 31 19:00:00 1969
+++ bstack.cFri Nov  2 19:22:07 2007
@@ -0,0 +1,39 @@
+void
+bstack(void) {
+unsigned int i, n, nx, ny, nw, nh, mh, tw;
+Client *c, *mc;
+
+domwfact = dozoom = True;
+for(n = 0, c = nexttiled(clients); c; c = nexttiled(c-next))
+n++;
+
+mh = (n == 1) ? wah : mwfact * wah;
+tw = (n  1) ? waw / (n - 1) : 0;
+
+nx = wax;
+ny = way;
+nh = 0;
+for(i = 0, c = mc = nexttiled(clients); c; c = nexttiled(c-next), i++) {
+c-ismax = False;
+if(i == 0) {
+nh = mh - 2 * c-border;
+nw = waw - 2 * c-border;
+}
+else {
+if(i == 1) {
+nx = wax;
+ny += mc-h + 2 * mc-border;
+nh = (way + wah) - ny - 2 * c-border;
+}
+if(i + 1 == n)
+nw = (wax + waw) - nx - 2 * c-border;
+else
+nw = tw - 2 * c-border;
+}
+resize(c, nx, ny, nw, nh, RESIZEHINTS);
+if((RESIZEHINTS)  ((c-h  bh) || (c-h  nh) || (c-w  bh) || 
(c-w  nw)))
+resize(c, nx, ny, nw, nh, False);
+if(n  1  tw != waw)
+nx = c-x + c-w + 2 * c-border;
+}
+}
--- config.def.hFri Nov  2 19:21:54 2007
+++ config.def.hFri Nov  2 19:22:15 2007
@@ -30,10 +30,12 @@
 #define MWFACT 0.6 /* master width factor [0.1 .. 0.9] */
 #define RESIZEHINTSTrue/* False - respect size hints in tiled 
resizals */
 #define SNAP   32  /* snap pixel */
+#include bstack.c
 Layout layouts[] = {
/* symbol   function */
{ []=,tile }, /* first entry is default */
{ ,floating },
+{ TTT,bstack },
 };
 
 /* key definitions */


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



Re: [dwm] Updated bottom stack patch

2008-01-14 Thread James Turner
Opps, there was a minor offset issue with the second part of the  
patch, it should still patch cleanly but just in case a new patch is  
available at http://bsdgroup.org/files/dwm-4.8-bstack.diff or attached  
once again.


dwm-4.8-bstack.diff
Description: Binary data




On Jan 14, 2008, at 10:33 PM, James Turner wrote:


Hi all,

Although I don't have more than one monitor, I've added xinerama  
support to the bottom stack patch.  Again, I worked off of the built  
in tile layout.  Those of you with multiple monitors please feel  
free to give the patch a go and let me know if you run into any  
problems, thanks.  You can find the patch at http://bsdgroup.org/files/dwm-4.8-bstack.diff 
 or attached.

dwm-4.8-bstack.diff




Re: [dwm] dwm-5.0 + bstack

2008-05-27 Thread James Turner
On Tue, May 27, 2008 at 10:08:54AM +0200, Anselm R. Garbe wrote:
 On Tue, May 27, 2008 at 10:06:51AM +0200, Szabolcs Nagy wrote:
  On 5/26/08, James Turner [EMAIL PROTECTED] wrote:
   I've updated the bottom stack patch for dwm-5.0.  From what I can tell
   domwfact is no longer present so I had to create the bsetmfact function
  
  this separate bsetmfact is not very nice
  imho setmfact should not check for (lt-arrange == tile)
 
 Ok I'm willing to change this int lt-arrange
 
 Kind regards,
 -- 
  Anselm R. Garbe  http://www.suckless.org/  GPG key: 0D73F361

I'll update the bottom stack patch and repost once the change arg is
referring to hit hg.

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



Re: [dwm] Bottom Stack for 4.9

2008-05-28 Thread James Turner
On Wed, May 28, 2008 at 05:55:29PM -0700, Jonny Gerold wrote:
 Hello,
 I was wondering if there is a bottom stack patch for 4.9? All I see is a
  patch for 5.0, and was wondering if the only place I can get 5.0 is from 
 hg?

 Thanks, Jonny

I personally never released a patch for 4.9.  I believe you can get this
functionality by changing DEFGEOM.  I'm still using 4.7 myself, since I
didn't like the way dwm was headed with xinerama.  If you search the
archives I vaguely remember someone posting an example DEFGEOM that
accomplished bottom stack.  Personally, once 5.0 is released I'll switch
to running it full time, so expect the patch for it and hopefully future
releases to stay up to date.

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



Re: [dwm] dwm-5.0 + bstack

2008-05-30 Thread James Turner
On Tue, May 27, 2008 at 10:08:54AM +0200, Anselm R. Garbe wrote:
 On Tue, May 27, 2008 at 10:06:51AM +0200, Szabolcs Nagy wrote:
  On 5/26/08, James Turner [EMAIL PROTECTED] wrote:
   I've updated the bottom stack patch for dwm-5.0.  From what I can tell
   domwfact is no longer present so I had to create the bsetmfact function
  
  this separate bsetmfact is not very nice
  imho setmfact should not check for (lt-arrange == tile)
 
 Ok I'm willing to change this int lt-arrange
 
 Kind regards,
 -- 
  Anselm R. Garbe  http://www.suckless.org/  GPG key: 0D73F361

Anselm,

Is the lt-arrange behavior in setmfact going to get changed before 5.0
is released so we don't need to basically recreate the function in our
layout patches?

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



Re: [dwm] dwm-5.0 + bstack

2008-05-31 Thread James Turner
On Sat, May 31, 2008 at 06:06:34PM +0200, Anselm R. Garbe wrote:
 On Fri, May 30, 2008 at 07:48:09PM -0400, James Turner wrote:
  Is the lt-arrange behavior in setmfact going to get changed before 5.0
  is released so we don't need to basically recreate the function in our
  layout patches?
 
 Yes I changed it, see hg tip.
 
 Kind regards,
 -- 
  Anselm R. Garbe  http://www.suckless.org/  GPG key: 0D73F361

Thanks for updating hg, however, after pulling the latest changes and
removing my bsetmfact function, I am still unable to resize the master
area with modkey+h and modkey+l, am I still missing something? Thanks.

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



Re: [dwm] dwm-5.0 + bstack

2008-05-31 Thread James Turner
On Sat, May 31, 2008 at 12:16:24PM -0400, James Turner wrote:
 On Sat, May 31, 2008 at 06:06:34PM +0200, Anselm R. Garbe wrote:
  On Fri, May 30, 2008 at 07:48:09PM -0400, James Turner wrote:
   Is the lt-arrange behavior in setmfact going to get changed before 5.0
   is released so we don't need to basically recreate the function in our
   layout patches?
  
  Yes I changed it, see hg tip.
  
  Kind regards,
  -- 
   Anselm R. Garbe  http://www.suckless.org/  GPG key: 0D73F361
 
 Thanks for updating hg, however, after pulling the latest changes and
 removing my bsetmfact function, I am still unable to resize the master
 area with modkey+h and modkey+l, am I still missing something? Thanks.
 
 -- 
 James Turner
 BSD Group Consulting
 http://www.bsdgroup.org

I think it should be if(!d || !lt-arrange) not if(!d || lt-arrange)?
If that is the case, then attached is an updated bstack patch without
the bsetmfact function.  Also available here [0].

[0] http://bsdgroup.org/files/dwm-5.0-bstack.diff

-- 
James Turner
BSD Group Consulting
http://www.bsdgroup.org
--- bstack.cWed Dec 31 19:00:00 1969
+++ bstack.cSat May 31 12:11:38 2008
@@ -0,0 +1,33 @@
+void
+bstack(void) {
+   int x, y, h, w, mh;
+   uint i, n;
+   Client *c;
+
+   for(n = 0, c = nexttiled(clients); c; c = nexttiled(c-next), n++);
+   if(n == 0)
+   return;
+
+   /* master */
+   c = nexttiled(clients);
+   mh = mfact * wh;
+   resize(c, wx, wy, ww - 2 * c-bw, ((n == 1) ? wh : mh) - 2 * c-bw, 
resizehints);
+
+   if(--n == 0)
+   return;
+
+   /* tile stack */
+   x = wx;
+   y = (wy + mh  c-y + c-h) ? c-y + c-h + 2 * c-bw : wh - mh;
+   w = ww / n;
+   h = (wy + mh  c-y + c-h) ? wy + wh - y : wh - mh;
+   if(h  bh)
+   h = wh;
+
+   for(i = 0, c = nexttiled(c-next); c; c = nexttiled(c-next), i++) {
+   resize(c, x, y, /* remainder */ ((i + 1 == n) ? (wx + ww) - x
+  : w) - 2 * c-bw, h - 2 * c-bw, resizehints);
+   if(w != ww)
+   x = c-x + c-w + 2 * c-bw;
+   }
+}
--- config.def.hSat May 31 12:10:31 2008
+++ config.def.hSat May 31 12:11:52 2008
@@ -26,10 +26,13 @@ Rule rules[] = {
 double mfact   = 0.55;
 Bool resizehints   = True; /* False means respect size hints in tiled 
resizals */
 
+#include bstack.c
+
 Layout layouts[] = {
/* symbol arrange function */
{ []=,  tile }, /* first entry is default */
{ ,  NULL }, /* no layout function means floating behavior */
+   { TTT,  bstack },
 };
 
 /* key definitions */


Re: [dwm] dwm-5.0 + bstack

2008-05-31 Thread James Turner
On Sat, May 31, 2008 at 06:38:10PM +0200, Anselm R. Garbe wrote:
 On Sat, May 31, 2008 at 12:20:59PM -0400, James Turner wrote:
  I think it should be if(!d || !lt-arrange) not if(!d || lt-arrange)?
 
 Oh, what a disaster! Sorry for the inconvenience! Fixed in hg
 tip.
 
 Kind regards,
 -- 
  Anselm R. Garbe  http://www.suckless.org/  GPG key: 0D73F361

Not a big deal, thanks for fixing it :)

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



[dwm] dmenu directory test

2008-06-14 Thread James Turner
I just cloned the latest tip for dwm and dmenu.  I'm happy to report
everything is working great for me.  On that note, I was wondering if it
would make sense to add a test in dmenu_path to make sure the directory
actually exists before trying to cd into it?  I know I have $HOME/bin in
my $PATH, but on my current machine I don't have that directory created.
Attached is a simple tweak to dmenu_path to test if the directory
exists.  Thanks.

-- 
James Turner
BSD Group Consulting
http://www.bsdgroup.org
--- dmenu_path  Sat Jun 14 15:24:14 2008
+++ dmenu_path  Sat Jun 14 15:25:27 2008
@@ -14,6 +14,7 @@ if ! uptodate
 then
for dir in $PATH
do
+   test -d $dir 
cd $dir 
for file in *
do


Re: [dwm] dmenu directory test

2008-06-15 Thread James Turner
On Sun, Jun 15, 2008 at 11:39:38AM +0200, Sander van Dijk wrote:
 On 6/14/08, James Turner [EMAIL PROTECTED] wrote:
  Doesn't it make more sense to do a test, then just redirect error
  output?
 
 Then you'd have to test more than your patch does: right now, your
 patch only tests if we're dealing with a directory; whether or not the
 user running the script has permission to cd into that directory is
 not taken in consideration. I agree with the others here that the cd
 itself is the safest test.

Thanks for the info guys.  I see your point, I suppose cd is the best
test.

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



Re: [dwm] st on OpenBSD

2008-06-17 Thread James Turner
On Tue, Jun 17, 2008 at 09:53:36AM +0200, Matthias-Christian Ott wrote:
 James Turner [EMAIL PROTECTED] wrote:
 
  Has anyone tried to run st on OpenBSD?  OpenBSD doesn't support the
  posix_openpt functions, I was wondering if anyone has tried to implement
  openpty(3) instead?
 
 For the new version of st I implemented platform-independent pty
 handling. I attached the file.
 
 Regards
 Matthias-Christian

Great, thanks. I will definitely give this a try tonight after work.

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



Re: [dwm] Hide Inactive Mouse Pointer?

2008-07-08 Thread James Turner
On Tue, Jul 08, 2008 at 07:58:17PM -0500, Kevin Monceaux wrote:
 DWM Fans,

 Has anyone ever attempted, or would it even be possible, to create a patch 
 that hides the mouse pointer after a period of inactivity.  I've seen some 
 programs do it.  For example, if I run xine in fullscreen mode the mouse 
 pointer vanishes shortly after xine starts.  If the mouse, or in my case 
 trackball, is moved, the pointer reappears.  And if it's not moved for a 
 short period of time, it vanishes again.  I'd love to have similar 
 functionality with DWM itself.  I frequently move the mouse pointer to the 
 lower right hand side of the screen where it's barely visible.




 Kevin
 http://www.RawFedDogs.net
 http://www.WacoAgilityGroup.org
 Bruceville, TX

 Si hoc legere scis nimium eruditionis habes.
 Longum iter est per praecepta, breve et efficax per exempla!!!

You might want to check out unclutter [0].

[0] http://www.ibiblio.org/pub/X11/contrib/utilities/unclutter-8.tar.gz

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



Re: [dwm] Hide Inactive Mouse Pointer?

2008-07-08 Thread James Turner
On Tue, Jul 08, 2008 at 08:35:13PM -0500, Kevin Monceaux wrote:
 James,

 On Tue, 8 Jul 2008, James Turner wrote:

 You might want to check out unclutter [0].

 [0] http://www.ibiblio.org/pub/X11/contrib/utilities/unclutter-8.tar.gz

 Many thanks  That seems to be exactly what I was looking for.  As an 
 added bonus I found a port for unclutter available in my FreeBSD ports 
 tree.  It took just a few moments to install and works like a charm!!

Glad you find it useful, I too have been using it ever since I discovered
it in the OpenBSD ports tree :)

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



Re: [dwm] [bgs] - back ground setter

2008-07-13 Thread James Turner
On Sun, Jul 13, 2008 at 02:07:53PM +0200, Enno Gottox Boland wrote:
 Hi!
 
 I wrote a small replacement for feh to set my desktop background. It
 uses imlib2, is Xinerama and Xrandr aware and its size is only about
 230sloc.
 
 Link:
 http://s01.de/~gottox/index.cgi/proj_bgs
 Mercurial:
 http://s01.de/~gottox/hg/bgs
 Tarball:
 http://s01.de/~gottox/files/bgs/bgs-0.1.tar.gz
 
 Have fun.
 
 Gottox
 
 -- 
 http://www.gnuffy.org - Real Community Distro
 http://www.gnuffy.org/index.php/GnuEm - Gnuffy on Ipaq (Codename Peggy)

Hey, I'm really liking bgs, I have been using xsetbg (xloadimage) up
until now.  One question tho, why does bgs need to stay running after it
sets the background?  If I kill it after setting the background the
image stays set just fine.  I rather not have it running in the
background if it doesn't need to be.  Thanks.

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



Re: [dwm] [bgs] - back ground setter

2008-07-13 Thread James Turner
On Sun, Jul 13, 2008 at 04:16:16PM +0200, Enno Gottox Boland wrote:
 I'm considering to introduce a switch to disable updating if it's not 
 necessary.
 
 2008/7/13, Enno Gottox Boland [EMAIL PROTECTED]:
  Hi!
 
   It does this, because bgs needs to rearrange the background images
   when the Xinerama setup is changed. I simply use bgs image  in my
   .xinitrc.
 
   regards
   Gottox

Ah ok, I disabled Xinerama had compile time.  How about putting that
part of the code if a #ifdef XINERAMA or something?  I guess tho if you
want the behavior to be the same then a switch would be good.

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



[dwm] dmenu unused variable

2008-07-16 Thread James Turner
In the latest dmenu tip I get:

dmenu.c: In function `setup':
dmenu.c:589: warning: unused variable `n'

Since n is only used for the xinerama stuff, and I don't compile
xinerama support, what do you think about moving int n into the #if
XINERAMA check?

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



Re: [dwm] Border hater, border lover

2008-08-03 Thread James Turner
Sunnan,

Do you only see the strange bstack behavior with your patch applied?
After reading your post I went back and looked at the patch, I noticed a
minor diff between bstack and tile ( - instead of a + in one line ). I
just pushed a new diff you can either get it here [0]. If you saw this
issue without your patch let me know if this fixes it. It should be
pretty much in line with the current tile now. Thanks.

[0] http://bsdgroup.org/files/dwm-5.1-bstack.diff

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



[dwm] dwm hg

2008-08-29 Thread James Turner
Hey, when I do a fresh clone of dwm, I don't see any of the changes
marked as merge in the web interface. Am I doing something wrong?

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



Re: [dwm] dwm hg

2008-08-30 Thread James Turner
On Sat, Aug 30, 2008 at 08:39:05AM +0100, Filippo Erik Negroni wrote:
 From looking at the log, Anselm apparently has been working on branch
 'merge', but forgot to integrate back into default ever since.
 
 When you clone, you are by default placed in the 'default' branch, which you
 can identify using
 
 $ hg identify
 
 Until Anselm integrates 'merge' into 'default', you can do either of two
 things:
 
 $ hg up merge
 
 or
 
 $ hg up -r tip
 
 Ever since I started using mercurial, there has been a debate whether named
 branches are a good thing. Mercurial originally was only supporting
 branching by cloning, which is what I always do (apart from using MQueues).
 
 -- 
 Cheers,
 Filippo

Thanks for the hg lesson, it was very helpful.

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



Re: [dwm] dwm-5.2 / dmenu-3.9

2008-09-09 Thread James Turner
On Wed, Sep 10, 2008 at 12:01:09AM +0400, Michael wrote:
 On Tue, Sep 09, 2008 at 08:58:47PM +0100, Anselm R Garbe wrote:
  I'm glad to announce dwm-5.2 and dmenu-3.9. You can download the new
  releases from:
 
 Always wondered if there anything like changelog for releases?
 Thanks anyway, great work!

Take a look at http://code.suckless.org/hg/dwm/log/e4bcaca8e6ef

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



Re: [dwm] cycling through tags?

2008-11-18 Thread James Turner
Epic fail on the diff, left some stuff in there that shouldn't be. Try
the new attached one.

-- 
James Turner
BSD Group Consulting
http://www.bsdgroup.org
--- config.def.hTue Sep  9 15:46:17 2008
+++ config.def.hTue Nov 18 19:26:53 2008
@@ -61,6 +61,8 @@ static Key keys[] = {
{ MODKEY,   XK_l,  setmfact,   {.f = +0.05} 
},
{ MODKEY,   XK_Return, zoom,   {0} },
{ MODKEY,   XK_Tab,view,   {0} },
+   { MODKEY,   XK_Right,  viewnext,   {0} },
+   { MODKEY,   XK_Left,   viewprevious,   {0} },
{ MODKEY|ShiftMask, XK_c,  killclient, {0} },
{ MODKEY,   XK_t,  setlayout,  {.v = 
layouts[0]} },
{ MODKEY,   XK_f,  setlayout,  {.v = 
layouts[1]} },
--- dwm.c   Tue Sep  9 15:46:17 2008
+++ dwm.c   Tue Nov 18 19:31:55 2008
@@ -198,6 +198,8 @@ static void updatesizehints(Client *c);
 static void updatetitle(Client *c);
 static void updatewmhints(Client *c);
 static void view(const Arg *arg);
+static void viewnext(const Arg *arg);
+static void viewprevious(const Arg *arg);
 static int xerror(Display *dpy, XErrorEvent *ee);
 static int xerrordummy(Display *dpy, XErrorEvent *ee);
 static int xerrorstart(Display *dpy, XErrorEvent *ee);
@@ -1667,6 +1669,40 @@ view(const Arg *arg) {
if(arg-ui  TAGMASK)
tagset[seltags] = arg-ui  TAGMASK;
clearurgent();
+   arrange();
+}
+
+void
+viewnext(const Arg *arg) {
+   unsigned int i;
+
+   for(i = 0; i  LENGTH(tags); i++) {
+   if((1  i  TAGMASK) == tagset[seltags]) {
+   seltags ^= 1;
+   if(i == LENGTH(tags) - 1)
+   tagset[seltags] = 1  0  TAGMASK;
+   else
+   tagset[seltags] = 1  (i + 1)  TAGMASK;
+   break;
+   }
+   }
+   arrange();
+}
+
+void
+viewprevious(const Arg *arg) {
+   unsigned int i;
+
+   for(i = 0; i  LENGTH(tags); i++) {
+   if((1  i  TAGMASK) == tagset[seltags]) {
+   seltags ^= 1;
+   if(i == 0)
+   tagset[seltags] = 1  (LENGTH(tags) - 1)  
TAGMASK;
+   else
+   tagset[seltags] = 1  (i - 1)  TAGMASK;
+   break;
+   }
+   }
arrange();
 }
 


Re: [dwm] dwm-5.3

2008-12-04 Thread James Turner
 Great! Thank you for dwm-5.3. I think that it's needed to #include
 signal.h, infact without it I couldn't compile on NetBSD.

#include signal.h is also required on OpenBSD.

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



Re: [dwm] plan for dwm

2008-12-12 Thread James Turner
On Fri, Dec 12, 2008 at 07:15:55PM +, Anselm R Garbe wrote:
 Hi,
 
 here is the plan:
 
 slock-1.1 will be released soon containing Ali's patch with some minor
 modifications.
 
 dwm-5.4 will also be released soon containing the transition patch
 with the proposed x property based status reporting, and Neale's spawn
 patch again, and possibly some other minor patches ;)
 
 After that 5.5 could contain a more advanced approach for multihead
 support (though I think I need to investigate further and experiment
 more into this direction, before agreeing on the final approach). It
 should also contain a cleaned up usage of the HEIGHT/WIDTH macros
 besides the reduction of the ugly 2 * c-bw occurrences throughout
 the code (I plan to move these border deductions to resize).
 
 Then there will be something else soon as well...
 
 Kind regards,
 --Anselm

I look forward to all the above mentioned changes, as well as this
mystery item :)

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



Re: [dwm] dwm-5.3

2008-12-12 Thread James Turner
After taking some time and looking at the different signal headers on
OpenBSD only #include sys/signal.h is required, no need to #include
signal.h which contains additional functions.

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



Re: [dwm] Re: dwm-5.4 stdin; cycle tags

2008-12-13 Thread James Turner
On Sat, Dec 13, 2008 at 06:09:11PM +0100, henry atting wrote:
 Zitat - Anselm R Garbe * Sa Dez 13 2008 um 17:54 -
 
  2008/12/13 henry atting nspm...@literaturlatenight.de:
  2008/12/13 henry atting nspm...@literaturlatenight.de:
  The tagging approach didn't change between 5.2 and 5.4, so I assume
  it's just a matter of making the 5.2 patch applying to the 5.4
  codebase.
 
  Mmh, I am not very familiar with patching, I did it this way:
 
  ,
  | do! patch -p1  dwm-5.2-arrownav.diff
  | missing header for unified diff at line 3 of patch
  | can't find file to patch at input line 3
  | Perhaps you used the wrong -p or --strip option?
  | The text leading up to this was:
  | --
  | |--- config.def.h   Tue Sep  9 15:46:17 2008
  | |+++ config.def.h   Tue Nov 18 19:26:53 2008
  | --
  | File to patch: config.def.h
  | patching file config.def.h
  | Hunk #1 succeeded at 62 (offset 1 line).
  | missing header for unified diff at line 14 of patch
  | can't find file to patch at input line 14
  | Perhaps you used the wrong -p or --strip option?
  | The text leading up to this was:
  | --
  | |--- dwm.c  Tue Sep  9 15:46:17 2008
  | |+++ dwm.c  Tue Nov 18 19:31:55 2008
  | --
  | File to patch: dwm.c
  | patching file dwm.c
  | Hunk #1 succeeded at 197 (offset -1 lines).
  | Hunk #2 FAILED at 1668.
  | 1 out of 2 hunks FAILED -- saving rejects to file dwm.c.rej
  `
 
  Well as I said, you will need to patch it manually, since the lines
  have changed and the heuristic approach supported by patch(1) isn't
  succeeding either.
 
  Kind regards,
  --Anselm
 
 I see, great thanks
 henry

Henry,

Attached is an updated arrownav patch [0] that should apply to dwm tip
cleanly.

[0] http://bsdgroup.org/files/dwm-5.4-arrownav.diff

-- 
James Turner
BSD Group Consulting
http://www.bsdgroup.org
--- config.def.hSat Dec 13 12:39:14 2008
+++ config.def.hSat Dec 13 12:36:21 2008
@@ -62,6 +62,8 @@ static Key keys[] = {
{ MODKEY,   XK_l,  setmfact,   {.f = +0.05} 
},
{ MODKEY,   XK_Return, zoom,   {0} },
{ MODKEY,   XK_Tab,view,   {0} },
+   { MODKEY,   XK_Right,  viewnext,   {0} },
+   { MODKEY,   XK_Left,   viewprevious,   {0} },
{ MODKEY|ShiftMask, XK_c,  killclient, {0} },
{ MODKEY,   XK_t,  setlayout,  {.v = 
layouts[0]} },
{ MODKEY,   XK_f,  setlayout,  {.v = 
layouts[1]} },
--- dwm.c   Sat Dec 13 12:39:15 2008
+++ dwm.c   Sat Dec 13 12:38:48 2008
@@ -198,6 +198,8 @@ static void updatestatus(void);
 static void updatetitle(Client *c);
 static void updatewmhints(Client *c);
 static void view(const Arg *arg);
+static void viewnext(const Arg *arg);
+static void viewprevious(const Arg *arg);
 static int xerror(Display *dpy, XErrorEvent *ee);
 static int xerrordummy(Display *dpy, XErrorEvent *ee);
 static int xerrorstart(Display *dpy, XErrorEvent *ee);
@@ -1631,6 +1633,40 @@ view(const Arg *arg) {
seltags ^= 1; /* toggle sel tagset */
if(arg-ui  TAGMASK)
tagset[seltags] = arg-ui  TAGMASK;
+   arrange();
+}
+
+void
+viewnext(const Arg *arg) {
+   unsigned int i;
+
+   for(i = 0; i  LENGTH(tags); i++) {
+   if((1  i  TAGMASK) == tagset[seltags]) {
+   seltags ^= 1;
+   if(i == LENGTH(tags) - 1)
+   tagset[seltags] = 1  0  TAGMASK;
+   else
+   tagset[seltags] = 1  (i + 1)  TAGMASK;
+   break;
+   }
+   }
+   arrange();
+}
+
+void
+viewprevious(const Arg *arg) {
+   unsigned int i;
+
+   for(i = 0; i  LENGTH(tags); i++) {
+   if((1  i  TAGMASK) == tagset[seltags]) {
+   seltags ^= 1;
+   if(i == 0)
+   tagset[seltags] = 1  (LENGTH(tags) - 1)  
TAGMASK;
+   else
+   tagset[seltags] = 1  (i - 1)  TAGMASK;
+   break;
+   }
+   }
arrange();
 }
 


Re: [dwm] dwm-5.3

2008-12-13 Thread James Turner
On Sat, Dec 13, 2008 at 10:34:28AM -0700, Neale Pickett wrote:
 James Turner ja...@bsdgroup.org writes:
 
  After taking some time and looking at the different signal headers on
  OpenBSD only #include sys/signal.h is required, no need to #include
  signal.h which contains additional functions.
 
 My man page (Linux) says to #include signal.h.  I don't have any of my
 books nearby, nor do I have access to any of my older boxen (SunOS,
 HP/UX, etc.) but I suspect signal.h is the portable way to do it.
 
 I'm not sure what the motivation is for changing this.  If the concern
 is size of the compiled binary, consider that including prototypes for
 additional functions shouldn't change anything about the output binary;
 it still links against libc6, and since #define is just a C preprocessor
 directive, unused #defines won't affect the binary either.
 
 Neale

man signal on OpenBSD also states to #include signal.h, it's just
signal.h includes sys/signal.h and for the function used by dwm
sys/signal.h is all that is required on OpenBSD. I don't run any other
systems so if signal.h is more portable then go with it.

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



Re: [dwm] Horizontal tiling

2008-12-19 Thread James Turner
On Fri, Dec 19, 2008 at 07:50:22AM -0500, thierry beauquier wrote:
 Hi Antony,
 
 Yes, it is what I was looking for. Do you know if the 5.3 patch can be
 applied on 5.3.1?
 
 Thanks
 Thierry
 

Yes, the 5.3 patch should apply fine to 5.3.1. I also just put out a
patch for 5.4 that includes the noborder stuff.

 On Thu, Dec 18, 2008 at 10:34 PM, Antony Jepson anton...@gmail.com wrote:
 
  Dear Thierry,
 
  On 2008-12-18, thierry beauquier wrote:
   I am looking for a patch to have horizontal tiling instead of vertical
  (like
 
  Are you referring to something similar to the bottomstack patch?
 
  Sincerely,
  --
  Antony Jepson /  anton...@gmail.com / GPG Key: 0xFA10ED80

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



Re: [dwm] Horizontal tiling

2008-12-19 Thread James Turner
On Fri, Dec 19, 2008 at 11:08:12AM -0500, thierry beauquier wrote:
 Hi Antony,
 I installed the patch and compile it successfully however it does not seems
 to work. It is still using the vertical option
 
 I have to say that I got some issue to apply the patch using #patch -p1 
 patch. It seems that I was missing bstack.c so I have created an empty file
 to get it to work
 
 Any clue
 Thierry
 

First off, patch -p0  dwm-5.3-bstack.diff within the dwm should be
enough to make it patch cleaning. Secondly the patch does not make it
the default layout, you either need to reorder your layouts in config.h
or manually switch to it once you start dwm (this may require an
additional line in config.h to bind the layout to a key combo).

 On Fri, Dec 19, 2008 at 8:28 AM, James Turner ja...@bsdgroup.org wrote:
 
  On Fri, Dec 19, 2008 at 07:50:22AM -0500, thierry beauquier wrote:
   Hi Antony,
  
   Yes, it is what I was looking for. Do you know if the 5.3 patch can be
   applied on 5.3.1?
  
   Thanks
   Thierry
  
 
  Yes, the 5.3 patch should apply fine to 5.3.1. I also just put out a
  patch for 5.4 that includes the noborder stuff.
 
   On Thu, Dec 18, 2008 at 10:34 PM, Antony Jepson anton...@gmail.com
  wrote:
  
Dear Thierry,
   
On 2008-12-18, thierry beauquier wrote:
 I am looking for a patch to have horizontal tiling instead of
  vertical
(like
   
Are you referring to something similar to the bottomstack patch?
   
Sincerely,
--
Antony Jepson /  anton...@gmail.com / GPG Key: 0xFA10ED80
 
  --
  James Turner
  BSD Group Consulting
  http://www.bsdgroup.org

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



Re: [dwm] Bottom Stack Patch

2009-02-09 Thread James Turner
On Mon, Feb 09, 2009 at 02:01:03PM -0500, thierry beauquier wrote:
 Hi,
 
 Is there a patch to have pure horizontal tiling?
 
 Meaning:
 
 +--+
 ||
 +--+
 ||
 +--+
 ||
 +--+
 
 Regards
 Thierry
 
 On Sun, Feb 8, 2009 at 10:29 AM, James Turner ja...@bsdgroup.org wrote:
 
  On Sun, Feb 08, 2009 at 10:25:41AM -0500, David Neu wrote:
   Hi,
  
   I was just about to download the bottom stack patch for dwm-5.4.1 from,
  
   http://www.suckless.org/dwm/patches/bottom_stack.html
  
   but noticed it's dated 20081217.  Is this correct?
  
   Many thanks!
  
   Cheers,
   David
 
  Hello there, I create a new bottom stack patch against hg the minute
  something changes and tag it for the up coming release. It should apply
  fine to 5.4.1 as well but I havent tested it. Let me know if you have
  issues.
 
  --
  James Turner
  BSD Group Consulting
  http://www.bsdgroup.org

I believe the original bottom stack patch did support that, when I kind
of took over keeping it up to date I dropped that support since I didn't
use it. You might be able to find an older patch via google that still
has the behavior and bring it up to date.

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



Re: [dwm] Suckess Code Management

2009-03-12 Thread James Turner
openbsd, dwm, xterm, nvi, opencvs, tmux, mutt, irssi

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



Re: [dwm] Suckess Code Management

2009-03-12 Thread James Turner
I'm also running 0.4a from packages on openbsd 4.4 without any issues. I
haven't seen any characters get eaten. What $TERM are you running? How
often do your chars get eaten? What do you mean by eaten? You type and
half don't ever make it to the screen?

On Thu, Mar 12, 2009 at 07:29:29PM +0100, Martin Oppegaard wrote:
 Hi!
 
 On Thu, Mar 12, 2009 at 12:30:02PM -0400, James Turner wrote:
  openbsd, dwm, xterm, nvi, opencvs, tmux, mutt, irssi
 
 How are tmux and nvi going along at your place?  Here, tmux eat the 
 characters,
 seemingly at random.  mg and vim are not affected.
 
 I've tried tmux 0.4a precompiled, and 0.7 from HEAD of ports.
 
 On topic: openbsd, dwm, xterm, nvi, tmux/screen, mutt, ircII/bitlbee,
 mpd/mpc, mplayer, opera.
 
 - Martin

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



Re: [dwm] Slightly OT: Looking for decent graphics card

2009-04-14 Thread James Turner
On Tue, Apr 14, 2009 at 03:49:38PM -0500, Kurt H Maier wrote:
 FWIW the Intel cards are the first batch to support the kernel
 modesetting stuff in 2.6.29, specifically the i915 driver.
 # Kurt H Maier

http://www.fsf.org/resources/hw/video

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



Re: [dwm] Keybinding to jump to next/prev tag?

2009-04-15 Thread James Turner
On Wed, Apr 15, 2009 at 10:37:55PM +0200, Preben Randhol wrote:
 Hi
 
 I have one more question. I'm used to keybindings from going to the
 next or previous workspace (tag). Is there any that has a working
 patch/function so that one can f.ex bind Mod4-Shift-j/k to go to
 next/prev tag? I can of course use the Mod4-number to jump, but
 sometimes it is nice to just be able to jump to the next or prev tag
 (apart from Mod4-Tab of course)
 
 Thanks in advance
 
 Preben

This might be what your looking for, currently it's setup to use Mod +
arrow left and right. Not sure if this is the best way to do it but it
worked for a friend who was looking for it's behavior.

http://bsdgroup.org/files/dwm-5.4-arrownav.diff

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