Re: [dev] [dwm] How to place window automatically?

2012-12-17 Thread Bogdan Ionuț
On Mon, Dec 17, 2012 at 1:30 AM, Martti Kühne mysat...@gmail.com wrote:
 On Sun, Dec 16, 2012 at 8:43 PM, Hugues Moretto-Viry
 hugues.more...@gmail.com wrote:
 2012/12/16 Christoph Lohmann 2...@r-36.net

 If  you  have  the  control over the size of the first window, then just
 calculate the fixed position of the second one and run it there.


 Sincerely,

 Christoph Lohmann


 I tried this with the urxvt -geometry 80x23+200+0 but it doesn't work. I'm
 using a patch which center floating windows. I think it inhibits urxvt
 window management.
 I'm a bit stuck...

 Personally I set up a little script in my home directory which starts
 a second instance of st with a different window title, for which I
 match in the title column in dwm's config.h.

 Further down the road to what may actually help you, since your
 center-floating patch may keep interfering you could improve it or
 consider devilspie.

 cheers!
 mar77i

Sincer I'm the author of the center-floating, I can only suggest using
a rule in your config to disable this feature for any particular app.



Re: [dev] bug in revision 1578

2012-07-12 Thread Bogdan Ionuț
On Thu, Jul 12, 2012 at 2:28 PM, Marcin Szamotulski msza...@gmail.comwrote:

 Hello,

 The revision 1578 (of hg sources of dwm) introduces a bug, I think. I get
 the
 following error while compiling dwm:

 dwm.c: In function ‘createmon’:
 dwm.c:669:15: error: ‘nmaster’ undeclared (first use in this function)
 dwm.c:669:15: note: each undeclared identifier is reported only once for
 each
 function it appears in
 dwm.c: In function ‘keypress’:
 dwm.c:1087:2: warning: ‘XKeycodeToKeysym’ is deprecated (declared at
 /usr/include/X11/Xlib.h:1695)
 dwm.c: At top level:
 dwm.c:1030:1: warning: ‘incnmaster’ defined but not used
 make: *** [dwm.o] Error 1


 Best,
 Marcin Szamotulski

 Update your config.h too. :)


Re: [dev] [dwm] Crazy Window Behavior

2011-09-06 Thread Bogdan Ionuț
On Tue, Sep 6, 2011 at 11:29, Bastien Dejean esch...@gmail.com wrote:

 Bogdan Ionuț a écrit :
  On Mon, Sep 5, 2011 at 17:10, Bastien Dejean esch...@gmail.com wrote:
don't know if it's a known bug, but I stumble upon this crazy window
   behavior happening in floating layout.
  
   In the following video, I try to move and resize the window, then I hit
   MODKEY+space which is bound, in my config.h, to togglefloating, at this
  
  I can bet that it's uselessgap patch related.

 Indeed.
 Is there a rock solid version of that patch floating around?

 --
 Bastien


Try the patch attached.
--- a/config.def.h	2011-07-10 23:24:25.0 +0300
+++ b/config.def.h	2011-09-06 11:52:50.092771712 +0300
@@ -9,6 +9,7 @@ static const char selbordercolor[]  = #
 static const char selbgcolor[]  = #0066ff;
 static const char selfgcolor[]  = #ff;
 static const unsigned int borderpx  = 1;/* border pixel of windows */
+static const unsigned int gappx = 6;/* gap pixel between windows */
 static const unsigned int snap  = 32;   /* snap pixel */
 static const Bool showbar   = True; /* False means no bar */
 static const Bool topbar= True; /* False means bottom bar */
@@ -27,10 +28,10 @@ static const float mfact  = 0.55; /*
 static const Bool resizehints = True; /* True means respect size hints in tiled resizals */
 
 static const Layout layouts[] = {
-	/* symbol arrange function */
-	{ []=,  tile },/* first entry is default */
-	{ ,  NULL },/* no layout function means floating behavior */
-	{ [M],  monocle },
+	/* symbol gaps   arrange function */
+	{ []=,  True,  tile },/* first entry is default */
+	{ ,  False, NULL },/* no layout function means floating behavior */
+	{ [M],  False, monocle },
 };
 
 /* key definitions */
--- a/dwm.c	2011-07-10 23:24:25.0 +0300
+++ b/dwm.c	2011-09-06 11:52:12.212769335 +0300
@@ -119,6 +119,7 @@ typedef struct {
 
 typedef struct {
 	const char *symbol;
+	Bool addgaps;
 	void (*arrange)(Monitor *);
 } Layout;
 
@@ -470,7 +471,7 @@ checkotherwm(void) {
 void
 cleanup(void) {
 	Arg a = {.ui = ~0};
-	Layout foo = { , NULL };
+	Layout foo = { , False, NULL };
 	Monitor *m;
 
 	view(a);
@@ -1317,11 +1318,12 @@ resize(Client *c, int x, int y, int w, i
 void
 resizeclient(Client *c, int x, int y, int w, int h) {
 	XWindowChanges wc;
+	unsigned int gap = c-isfloating ? 0 : c-mon-lt[c-mon-sellt]-addgaps ? gappx : 0;
 
-	c-oldx = c-x; c-x = wc.x = x;
-	c-oldy = c-y; c-y = wc.y = y;
-	c-oldw = c-w; c-w = wc.width = w;
-	c-oldh = c-h; c-h = wc.height = h;
+	c-oldx = c-x; c-x = wc.x = x + gap;
+	c-oldy = c-y; c-y = wc.y = y + gap;
+	c-oldw = c-w; c-w = wc.width = w - (gap ? (x + w + (c-bw * 2) == c-mon-mx + c-mon-mw ? 2 : 1) * gap : 0);
+	c-oldh = c-h; c-h = wc.height = h - (gap ? (y + h + (c-bw * 2) == c-mon-my + c-mon-mh ? 2 : 1) * gap : 0);
 	wc.border_width = c-bw;
 	XConfigureWindow(dpy, c-win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, wc);
 	configure(c);


Re: [dev] [dwm] Crazy Window Behavior

2011-09-06 Thread Bogdan Ionuț
On Tue, Sep 6, 2011 at 11:29, Bastien Dejean esch...@gmail.com wrote:

 Bogdan Ionuț a écrit :
  On Mon, Sep 5, 2011 at 17:10, Bastien Dejean esch...@gmail.com wrote:
don't know if it's a known bug, but I stumble upon this crazy window
   behavior happening in floating layout.
  
   In the following video, I try to move and resize the window, then I hit
   MODKEY+space which is bound, in my config.h, to togglefloating, at this
  
  I can bet that it's uselessgap patch related.

 Indeed.
 Is there a rock solid version of that patch floating around?

 --
 Bastien

 Try the patch attached.
--- a/config.def.h	2011-07-10 23:24:25.0 +0300
+++ b/config.def.h	2011-09-06 11:52:50.092771712 +0300
@@ -9,6 +9,7 @@ static const char selbordercolor[]  = #
 static const char selbgcolor[]  = #0066ff;
 static const char selfgcolor[]  = #ff;
 static const unsigned int borderpx  = 1;/* border pixel of windows */
+static const unsigned int gappx = 6;/* gap pixel between windows */
 static const unsigned int snap  = 32;   /* snap pixel */
 static const Bool showbar   = True; /* False means no bar */
 static const Bool topbar= True; /* False means bottom bar */
@@ -27,10 +28,10 @@ static const float mfact  = 0.55; /*
 static const Bool resizehints = True; /* True means respect size hints in tiled resizals */
 
 static const Layout layouts[] = {
-	/* symbol arrange function */
-	{ []=,  tile },/* first entry is default */
-	{ ,  NULL },/* no layout function means floating behavior */
-	{ [M],  monocle },
+	/* symbol gaps   arrange function */
+	{ []=,  True,  tile },/* first entry is default */
+	{ ,  False, NULL },/* no layout function means floating behavior */
+	{ [M],  False, monocle },
 };
 
 /* key definitions */
--- a/dwm.c	2011-07-10 23:24:25.0 +0300
+++ b/dwm.c	2011-09-06 11:52:12.212769335 +0300
@@ -119,6 +119,7 @@ typedef struct {
 
 typedef struct {
 	const char *symbol;
+	Bool addgaps;
 	void (*arrange)(Monitor *);
 } Layout;
 
@@ -470,7 +471,7 @@ checkotherwm(void) {
 void
 cleanup(void) {
 	Arg a = {.ui = ~0};
-	Layout foo = { , NULL };
+	Layout foo = { , False, NULL };
 	Monitor *m;
 
 	view(a);
@@ -1317,11 +1318,12 @@ resize(Client *c, int x, int y, int w, i
 void
 resizeclient(Client *c, int x, int y, int w, int h) {
 	XWindowChanges wc;
+	unsigned int gap = c-isfloating ? 0 : c-mon-lt[c-mon-sellt]-addgaps ? gappx : 0;
 
-	c-oldx = c-x; c-x = wc.x = x;
-	c-oldy = c-y; c-y = wc.y = y;
-	c-oldw = c-w; c-w = wc.width = w;
-	c-oldh = c-h; c-h = wc.height = h;
+	c-oldx = c-x; c-x = wc.x = x + gap;
+	c-oldy = c-y; c-y = wc.y = y + gap;
+	c-oldw = c-w; c-w = wc.width = w - (gap ? (x + w + (c-bw * 2) == c-mon-mx + c-mon-mw ? 2 : 1) * gap : 0);
+	c-oldh = c-h; c-h = wc.height = h - (gap ? (y + h + (c-bw * 2) == c-mon-my + c-mon-mh ? 2 : 1) * gap : 0);
 	wc.border_width = c-bw;
 	XConfigureWindow(dpy, c-win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, wc);
 	configure(c);


Re: [dev] [dwm] Crazy Window Behavior

2011-09-05 Thread Bogdan Ionuț
On Mon, Sep 5, 2011 at 17:10, Bastien Dejean esch...@gmail.com wrote:

  don't know if it's a known bug, but I stumble upon this crazy window
 behavior happening in floating layout.

 In the following video, I try to move and resize the window, then I hit
 MODKEY+space which is bound, in my config.h, to togglefloating, at this

I can bet that it's uselessgap patch related.


Re: [dev] [patch] map new window *after* arrange()

2011-07-09 Thread Bogdan Ionuț
On Sat, Jul 9, 2011 at 10:01, garbeam garb...@gmail.com wrote:

 Hi Peter,

 On 9 July 2011 00:40, Peter Hartlich bq...@hartlich.com wrote:
  I reviewed your patch and concluded I can't apply it as is, because
  focus() would be called twice, once on the unmapped window, and then
  on again.
 
  It seems to me that focusing and arranging should be independent
  operations. So here comes another patch to remove focus(NULL) from
  arrange and add it, if missing, everywhere arrange is called after
  either a window might have vanished from selmon's view, or selmon
  itself might have vanished.

 I agree with this and applied both patches. It is not my ideal
 solution, but I postpone an ideal version for 6.0.

 All, please test hg tip. If there are no issues this will become 5.9
 tomorrow.

 Cheers,
 --garbeam

 just one annoying issue with floating apps. eg. running save as in gimp,
will open a window in the background.


Re: [dev] Please test dwm master

2011-06-27 Thread Bogdan Ionuț
On Sun, Jun 26, 2011 at 07:23, Mikhail Gonchar m...@reji.ru wrote:

 On Sat, Jun 25, 2011 at 09:32:24AM +0100, garbeam wrote:
  Hi there,
 
  I'd like you to test it and let me know any issues.

 Hello.

 dwm hotkeys and mouse buttons doesn't work for me when Num Lock is on.
 Patch attached.

 My keyboard setup:
  setxkbmap us,ru
  xmodmap -e keysym Caps_Lock = ISO_First_Group ISO_Last_Group
  numlockx on

 xmodmap output:
  xmodmap:  up to 4 keys per modifier, (keycodes in parentheses):

  shift   Shift_L (0x32),  Shift_R (0x3e)
  lockISO_First_Group (0x42)
  control Control_L (0x25),  Control_R (0x69)
  mod1Alt_L (0x40),  Alt_R (0x6c),  Meta_L (0xcd)
  mod2Num_Lock (0x4d)
  mod3
  mod4Super_L (0x85),  Super_R (0x86),  Super_L (0xce),  Hyper_L
 (0xcf)
  mod5ISO_Level3_Shift (0x5c),  Mode_switch (0xcb)

 x86-64 Linux system, X.Org 7.6, evdev, 105 key PC keyboard.


it works with num lock, but not with scroll lock on.
--- a/dwm.c 2011-06-27 21:35:11.0 +0300
+++ b/dwm.c 2011-06-27 21:48:55.44301 +0300
@@ -42,7 +42,7 @@
 
 /* macros */
 #define BUTTONMASK  (ButtonPressMask|ButtonReleaseMask)
-#define CLEANMASK(mask) (mask  ~numlockmask  
(ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask))
+#define CLEANMASK(mask) (mask  ~(numlockmask|LockMask)  
(ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask))
 #define INRECT(X,Y,RX,RY,RW,RH) ((X) = (RX)  (X)  (RX) + (RW)  (Y) = 
(RY)  (Y)  (RY) + (RH))
 #define ISVISIBLE(C)((C-tags  C-mon-tagset[C-mon-seltags]))
 #define LENGTH(X)   (sizeof X / sizeof X[0])


Re: [dev] [dwm] segfault

2011-06-22 Thread Bogdan Ionuț
On 22/06/2011, Arian Kuschki arian.kusc...@googlemail.com wrote:
 Hi,

 after happily having used dwm for years it started to segfault on me in
 regular intervals since I switched to a new laptop (T43 - T420s). Not sure
 what the trigger is yet, /var/log/everything looks shows this:

 Jun 22 15:25:32 localhost kernel: [11636.771129] dwm[1325]: segfault at 0 ip
 004030b8 sp 7fff84382650 error 4 in dwm[40+c000]

 hg summary shows parent: 1560:e181c9cf318e tip

 Also, I applied the 'pertag' patch and maybe another one that I can't
 remember right now. How can I diff my local version against tip? Sorry am
 more of a git user.

 Any hints?

it segfaults only when reloading dwm? then it's pertag related. i
use pertag2 and adding m-mfacts[0] = mfact; in createmon() solves the
issue.



[dev] [dwm] fullscreen apps losing focus

2011-06-15 Thread Bogdan Ionuț
it's kinda annoying to lose focus in a fullscreen app if a new one is
started in the background, eg: fullscreen mplayer running in `chat` tag.
it's a bug or a feature!?


Re: [dev] dwm xsetroot colorful fonts howto?

2011-05-13 Thread Bogdan Ionuț
On Sat, May 14, 2011 at 00:01, Le Tian tiane...@gmail.com wrote:

 I'm sorry, maybe its been discussed like a lot of times, but can anybody
 tell me how to color taskbar fonts in dwm? There is a patch (
 http://dwm.suckless.org/patches/statuscolors) but that I don't like, I
 need fonts to be colored not a colorful bg or fg in the taskbar, and maybe
 its possible to change the colors on-the-fly (when monitoring high CPU
 temps)? Maybe somebody has it implemented already.

 --
 Tian


 dwm-sprinkles ( http://0mark.unserver.de/projects/dwm-sprinkles ) uses
something based on color_status_bar (
http://dwm.suckless.org/patches/historical/color_status_bar ). no patch
available, you'll have to take it from the source. :P