Re: [dev] [sbase] [patch] Add hostname

2013-08-20 Thread Truls Becken
I guess usage should be eprintf(usage: %s [name]\n, argv0);

Could use puts(buf); instead of printf(%s\n, buf);

-Truls



Re: [dev] [sbase] [patch] Add hostname

2013-08-20 Thread sin
On Tue, Aug 20, 2013 at 09:41:10AM +0200, Truls Becken wrote:
 I guess usage should be eprintf(usage: %s [name]\n, argv0);

Yeah I fixed that in my repo but forgot to resend.

 Could use puts(buf); instead of printf(%s\n, buf);

Sure yeah.



[dev] [sbase] [patch v2] Add hostname

2013-08-20 Thread sin
Updated usage and used puts() instead of printf().
From 2d49326020e6a788b9c0f190bd007d2baed89e19 Mon Sep 17 00:00:00 2001
From: sin s...@2f30.org
Date: Mon, 19 Aug 2013 17:22:46 +0100
Subject: [PATCH] Add hostname(1)

---
 Makefile   |  1 +
 hostname.c | 33 +
 2 files changed, 34 insertions(+)
 create mode 100644 hostname.c

diff --git a/Makefile b/Makefile
index 3c613b0..d347aa5 100644
--- a/Makefile
+++ b/Makefile
@@ -46,6 +46,7 @@ SRC = \
fold.c \
grep.c \
head.c \
+   hostname.c \
id.c   \
kill.c \
ln.c   \
diff --git a/hostname.c b/hostname.c
new file mode 100644
index 000..787d302
--- /dev/null
+++ b/hostname.c
@@ -0,0 +1,33 @@
+/* See LICENSE file for copyright and license details. */
+#include unistd.h
+#include stdio.h
+#include string.h
+#include util.h
+
+static void
+usage(void)
+{
+   eprintf(usage: %s [name]\n, argv0);
+}
+
+int
+main(int argc, char *argv[])
+{
+   char buf[BUFSIZ];
+
+   ARGBEGIN {
+   default:
+   usage();
+   } ARGEND;
+
+   if (argc  1) {
+   if (gethostname(buf, sizeof(buf))  0)
+   eprintf(gethostname:);
+   puts(buf);
+   } else {
+   if (sethostname(argv[0], strlen(argv[0]))  0)
+   eprintf(sethostname:);
+   }
+
+   return 0;
+}
-- 
1.8.2.3



Re: [dev] [dwm] multiple monitors, default window placement

2013-08-20 Thread Martin Kopta
On Fri, Aug 02, 2013 at 10:15:43PM +0200, Anselm R Garbe wrote:
 Hi Martin,
 
 On 29 July 2013 09:50, Martin Kopta mar...@kopta.eu wrote:
  On Wed, Jul 03, 2013 at 06:59:34PM +0200, Anselm R Garbe wrote:
  Do you experience this with vanilla dwm from git? If not, then it
  might help to see your rules declaration of config.h.
 
  Yes, I use newest vanilla dwm from git without any patches. My rules are 
  empty:
 
  static const Rule rules[] = { { 0 } };
 
  Full config.h at pastebin [1]. Thank you for your time!
 
 This looks fine. Please also let me know if you use classic multiheads
 or Xinerama, and if the latter one, let me know the xrandr output.
 
 Best regards,
 Anselm

I use xrandr to make my setup. My current output of xrandr is:

Screen 0: minimum 320 x 200, current 3286 x 1080, maximum 32767 x 32767
LVDS1 connected 1366x768+0+0 (normal left inverted right x axis y axis) 293mm x 
165mm
   1366x768   60.0*+
   1024x768   60.0  
   800x60060.3 56.2  
   640x48059.9  
VGA1 connected 1920x1080+1366+0 (normal left inverted right x axis y axis) 
531mm x 299mm
   1920x1080  60.0*+
   1600x1200  60.0  
   1680x1050  60.0  
   1280x1024  75.0 60.0  
   1440x900   75.0 59.9  
   1280x960   60.0  
   1280x800   59.8  
   1152x864   75.0  
   1024x768   75.1 70.1 60.0  
   832x62474.6  
   800x60072.2 75.0 60.3 56.2  
   640x48072.8 75.0 66.7 60.0  
   720x40070.1  
HDMI1 disconnected (normal left inverted right x axis y axis)
DP1 disconnected (normal left inverted right x axis y axis)

Used command is:
static const char *mon3[] = { xrandr, --output, LVDS1, --auto, 
--left-of, VGA1, --output, VGA1, --auto, NULL };
{ MODKEY,   XK_F3, spawn,  {.v = mon3 } 
},

Currently, my primary output is LVDS1. If I move my mouse to VGA1 screen and
even ensure by MOD+. (twice) it is actually selected and create new windows
(st), it is created on LVDS1 instead of VGA1. Of course, I can change my
primary output from LVDS1 to VGA1 using xrandr --primary, but then I have the
opposite problem in some cases.

Best regards,
  Martin Kopta



[dev][dwm][patch] dwm toggleignore patch

2013-08-20 Thread Nikolay Vasylchyshyn
Hello, suckless community!

I have created a patch for the current dwm (commit
6af273771cb0e28e4394c78ab0322f77025a57f3).
It excludes (and toggles back again) currently focused window from
MODKEY+j, MODKEY+k change focus cycle.

How do I use it: I open many terminals and actively work in 2 or 3 of them.
The rest shows some useful info, docs, etc. I exclude them and my windows
switching cycle became much shorter, only between my main 2 windows. When I
need to focus the ignored window, I alsays can do it with a mouse.

Just bind toggleignore() in your config.h. Here is mine:
{ MODKEY|ShiftMask, XK_i,  toggleignore,   {0} },

Maybe, some of you also will find this patch useful. ; )

Patch is in the attachment.


dwm-6af2737-toggleignore.diff
Description: Binary data


Re: [dev][dwm][patch] dwm toggleignore patch

2013-08-20 Thread Raphaël Proust
On Tue, Aug 20, 2013 at 1:06 PM, Nikolay Vasylchyshyn
vasylchyshy...@gmail.com wrote:
 […]
 Maybe, some of you also will find this patch useful. ; )

Seems potentially very useful. One thing you might want to do is add a
set of colours for the ignored windows.

static const char ignoredbordercolor[] = #[…];
static const char ignoredbgcolor[] = #[…];
static const char ignoredfgcolor[] = #[…];


-- 
__
Raphaël Proust



[dev] [PATCH] Add -g (geometry) option to tabbed.

2013-08-20 Thread Thorsten Glaser
Signed-off-by: Thorsten Glaser t.gla...@tarent.de
---
 LICENSE  | 1 +
 tabbed.1 | 5 +
 tabbed.c | 8 
 3 files changed, 14 insertions(+)

diff --git a/LICENSE b/LICENSE
index add8a53..b8dc9ea 100644
--- a/LICENSE
+++ b/LICENSE
@@ -3,6 +3,7 @@ MIT/X Consortium License
 © 2009-2011 Enno Boland g s01 de
 © 2011 Connor Lane Smith c...@lubutu.com
 © 2012 Christoph Lohmann 2...@r-36.net 
+© 2013 Thorsten “mirabilos” Glaser t.gla...@tarent.de
 
 Permission is hereby granted, free of charge, to any person obtaining a
 copy of this software and associated documentation files (the Software),
diff --git a/tabbed.1 b/tabbed.1
index d3ef06a..a315136 100644
--- a/tabbed.1
+++ b/tabbed.1
@@ -8,6 +8,8 @@ tabbed \- generic tabbed interface
 .RB [ \-h ]
 .RB [ \-s ]
 .RB [ \-v ]
+.RB [ \-g
+.IR geometry ]
 .RB [ \-n
 .IR name ]
 .RB [ \-p
@@ -34,6 +36,9 @@ detaches tabbed from the terminal and prints its XID to 
stdout.
 fill up tabbed again by spawning the provided command, when the last tab is
 closed. Mutually exclusive with -c.
 .TP
+.BI \-g  geometry
+specifies the preferred size and position of the parent window.
+.TP
 .B \-h
 will print the usage of tabbed.
 .TP
diff --git a/tabbed.c b/tabbed.c
index ba1df21..64dcd2a 100644
--- a/tabbed.c
+++ b/tabbed.c
@@ -160,6 +160,7 @@ static int (*xerrorxlib)(Display *, XErrorEvent *);
 static char winid[64];
 static char **cmd = NULL;
 static char *wmname = tabbed;
+static const char *geometry = NULL;
 
 char *argv0;
 
@@ -890,6 +891,10 @@ setup(void) {
ww = 800;
wh = 600;
 
+   if (geometry)
+   XParseGeometry(geometry, wx, wy,
+   (unsigned *)ww, (unsigned *)wh);
+
dc.norm[ColBG] = getcolor(normbgcolor);
dc.norm[ColFG] = getcolor(normfgcolor);
dc.sel[ColBG] = getcolor(selbgcolor);
@@ -1125,6 +1130,9 @@ main(int argc, char *argv[]) {
case 'f':
fillagain = True;
break;
+   case 'g':
+   geometry = EARGF(usage());
+   break;
case 'n':
wmname = EARGF(usage());
break;
-- 
1.8.4.rc3




[dev] smdev (suckless mdev)

2013-08-20 Thread sin
Hi all,

I've hacked together smdev[1].  It is basically mdev with
a config.def.h.

It does not currently support all of mdev's features.

What do you guys think?

Thanks,
sin

[1] http://git.2f30.org/smdev



Re: [dev][dwm][patch] dwm toggleignore patch

2013-08-20 Thread Nikolay Vasylchyshyn
Raphaël, thank you for the idea with colors. Will play with it in my
spare time during the week.
 Seems potentially very useful.
I'm very glad to read this. : )

Sorry for html emails. This one in plain text.

2013/8/20 Nikolay Vasylchyshyn vasylchyshy...@gmail.com:
 Raphaël, thank you for the idea with colors. Will play with it in my spare
 time during the week.
 Seems potentially very useful.
 I'm very glad to read this. : )


 2013/8/20 Raphaël Proust raphla...@gmail.com

 On Tue, Aug 20, 2013 at 1:06 PM, Nikolay Vasylchyshyn
 vasylchyshy...@gmail.com wrote:
  […]
  Maybe, some of you also will find this patch useful. ; )

 Seems potentially very useful. One thing you might want to do is add a
 set of colours for the ignored windows.

 static const char ignoredbordercolor[] = #[…];
 static const char ignoredbgcolor[] = #[…];
 static const char ignoredfgcolor[] = #[…];


 --
 __
 Raphaël Proust





Re: [dev][dwm][patch] dwm toggleignore patch

2013-08-20 Thread Markus Teich

Nikolay Vasylchyshyn wrote:

Seems potentially very useful.

I'm very glad to read this. : )


I object. This new feature is already nearly there.

If you have two active windows, in which you are working,
just zoom them to the top of the client stack. Then you
can easily switch between them with MODKEY+j and MODKEY+k.

If you have three windows, in one third of the possibilities
of switching from any of client 1, 2 or 3 to one of the
remaining two clients you have to press one more key without
your patch: MODKEY+j+j instead of MODKEY+k and the other
way around. So during a prolonged work session you can save
1/3 * 1/3 = 1/9 of the keypresses with three actively used
clients.

The setup takes some key presses with your patch too and
managing (remembering and getting the right key combinations
into muscle memory) the additional state of every client
in your brain also takes some more time.

So at least for my workflow (which is not that static) this
patch is not useful.

--Markus



Re: [dev][dwm][patch] dwm toggleignore patch

2013-08-20 Thread Raphaël Proust
On Tue, Aug 20, 2013 at 3:20 PM, Markus Teich
markus.te...@stusta.mhn.de wrote:
 Nikolay Vasylchyshyn wrote:

 Seems potentially very useful.

 I'm very glad to read this. : )


 I object. This new feature is already nearly there.

 If you have two active windows, in which you are working,
 just zoom them to the top of the client stack. Then you
 can easily switch between them with MODKEY+j and MODKEY+k.

 If you have three windows, in one third of the possibilities
 of switching from any of client 1, 2 or 3 to one of the
 remaining two clients you have to press one more key without
 your patch: MODKEY+j+j instead of MODKEY+k and the other
 way around. So during a prolonged work session you can save
 1/3 * 1/3 = 1/9 of the keypresses with three actively used
 clients.

I end up spending quite some keypresses getting the right order for my
windows. Especially when I bring together several tags and end up with
difficult to predict interleaving of windows.



 The setup takes some key presses with your patch too and
 managing (remembering and getting the right key combinations
 into muscle memory) the additional state of every client
 in your brain also takes some more time.

Hence the idea of adding different colours. The state need not be
stored in your brain.



 So at least for my workflow (which is not that static) this
 patch is not useful.

Probably not to be included in the main branch anyway, but it'd still
make a good addition to the patch section of the wiki.


-- 
__
Raphaël Proust



Re: [dev][dwm][patch] dwm toggleignore patch

2013-08-20 Thread Markus Teich



Am 2013-08-20 16:36, schrieb Raphaël Proust:

On Tue, Aug 20, 2013 at 3:20 PM, Markus Teich
markus.te...@stusta.mhn.de wrote:

Nikolay Vasylchyshyn wrote:


Seems potentially very useful.


I'm very glad to read this. : )



I object. This new feature is already nearly there.

If you have two active windows, in which you are working,
just zoom them to the top of the client stack. Then you
can easily switch between them with MODKEY+j and MODKEY+k.

If you have three windows, in one third of the possibilities
of switching from any of client 1, 2 or 3 to one of the
remaining two clients you have to press one more key without
your patch: MODKEY+j+j instead of MODKEY+k and the other
way around. So during a prolonged work session you can save
1/3 * 1/3 = 1/9 of the keypresses with three actively used
clients.


I end up spending quite some keypresses getting the right order for my
windows. Especially when I bring together several tags and end up with
difficult to predict interleaving of windows.


If you use some clients (i assume you use them on top of the client
stack/list as i do), this happens automatically as you zoom needed
clients into the master area during work.



The setup takes some key presses with your patch too and
managing (remembering and getting the right key combinations
into muscle memory) the additional state of every client
in your brain also takes some more time.


Hence the idea of adding different colours. The state need not be
stored in your brain.


It still takes time getting used to this additional way of
achieving client selection.

Also i forgot to mention, that it seems unintuitive to me, that i have
to use the mouse to unignore a client, although the rest of dwm's
functions (appart from moving/resizing floatign windows) can be 
accessed

just by the keyboard.

--Markus



Re: [dev][dwm][patch] dwm toggleignore patch

2013-08-20 Thread Nikolay Vasylchyshyn
About remembering window state. There is and indicator. It is shown
under the floating/fixed indicator. It's not so useful, because it is
seen (or hidden) only for focused window. The idea with custom border
color is much superior, because you can see all ignored windows at
once.

 I object. This new feature is already nearly there.

 If you have two active windows, in which you are working,
 just zoom them to the top of the client stack. Then you
 can easily switch between them with MODKEY+j and MODKEY+k.

Recently I have changed my habit of using dwm. I have switched from
tiled layout to floating.
And zoom doesn't work with floating windows nor floating layout. Zoom
works great. But...
I like to have some terminal windows to show different info I'm
interested in right now.
And when I use zoom, windows switch their positions and I have to
adapt to new windows layout. Which means
to remember new positions. So, I have to look on the terminal window
and understand again which command it is running.

Sorry for my english. Maybe it is not so clear as I would like it to be.

2013/8/20 Raphaël Proust raphla...@gmail.com:
 On Tue, Aug 20, 2013 at 3:20 PM, Markus Teich
 markus.te...@stusta.mhn.de wrote:
 Nikolay Vasylchyshyn wrote:

 Seems potentially very useful.

 I'm very glad to read this. : )


 I object. This new feature is already nearly there.

 If you have two active windows, in which you are working,
 just zoom them to the top of the client stack. Then you
 can easily switch between them with MODKEY+j and MODKEY+k.

 If you have three windows, in one third of the possibilities
 of switching from any of client 1, 2 or 3 to one of the
 remaining two clients you have to press one more key without
 your patch: MODKEY+j+j instead of MODKEY+k and the other
 way around. So during a prolonged work session you can save
 1/3 * 1/3 = 1/9 of the keypresses with three actively used
 clients.

 I end up spending quite some keypresses getting the right order for my
 windows. Especially when I bring together several tags and end up with
 difficult to predict interleaving of windows.



 The setup takes some key presses with your patch too and
 managing (remembering and getting the right key combinations
 into muscle memory) the additional state of every client
 in your brain also takes some more time.

 Hence the idea of adding different colours. The state need not be
 stored in your brain.



 So at least for my workflow (which is not that static) this
 patch is not useful.

 Probably not to be included in the main branch anyway, but it'd still
 make a good addition to the patch section of the wiki.


 --
 __
 Raphaël Proust




Re: [dev][dwm][patch] dwm toggleignore patch

2013-08-20 Thread Raphaël Proust
On Tue, Aug 20, 2013 at 4:58 PM, Markus Teich
markus.te...@stusta.mhn.de wrote:
 Am 2013-08-20 16:36, schrieb Raphaël Proust:
 On Tue, Aug 20, 2013 at 3:20 PM, Markus Teich
 markus.te...@stusta.mhn.de wrote:
 Nikolay Vasylchyshyn wrote:
 […]
 […]
 […]

 If you use some clients (i assume you use them on top of the client
 stack/list as i do), this happens automatically as you zoom needed
 clients into the master area during work.

Most of the time it's okay, but there are the odd cases when I have
been spawning a few clients on several less important tags and they
jump in front of the clients that are on important tags when I
merge the tags in the same view.

I have to refocus the important windows (the one I keep on the important tags.

Actually it could be useful to have a de-focus feature that would push
the client down the whole stack… I might give that a shot some time.



 […]
 […]


 It still takes time getting used to this additional way of
 achieving client selection.

Yes. But for those that have a workflow that would benefit from this
new way, it'd probably be time well spent. It took me some time to get
use to dwm in the frist place.



 Also i forgot to mention, that it seems unintuitive to me, that i have
 to use the mouse to unignore a client, although the rest of dwm's
 functions (appart from moving/resizing floatign windows) can be accessed
 just by the keyboard.

Maybe Mod+Shift+i could unignore all window / reignore all previously ignored…

I use the mouse a lot. Maybe even more than Mod+j/k. Mostly because I
use applications that are sensitive to the position of the mouse (Acme
and Firefox) so that wouldn't be a problem.

The feature's usefulness is highly workflow dependent. But I think it
has its place in with the patches on the website.



-- 
__
Raphaël Proust



Re: [dev] [PATCH] Add -g (geometry) option to tabbed.

2013-08-20 Thread Christoph Lohmann
Greetings.

Thanks for the hint, but you didn’t do it right. The geometry string al‐
lows to specify negative positions too and a negative  zero  too.  Addi‐
tionally this now fixates the geometry of tabbed.


Sincerely,

Christoph Lohmann




Re: [dev] smdev (suckless mdev)

2013-08-20 Thread Christoph Lohmann
Greetings.

On Tue, 20 Aug 2013 18:46:45 +0200 sin s...@2f30.org wrote:
 Hi all,
 
 I've hacked together smdev[1].  It is basically mdev with
 a config.def.h.
 
 It does not currently support all of mdev's features.
 
 What do you guys think?

If  it supports all the execution properties of mdev it would be perfect
for me to import it into nldev and make an nldevd, which  would  be  the
true replacement for udevd.

Try to cache the result of regcomp(). This will speed up things in large
trees. For being a competitor. When designing any replacement for udevd,
keep  in mind that due to that permission misdesign in Linux your daemon
has to manage some 10 thousand devices in  a  huge  server  in  under  a
minute.   This  can’t  be  done  linearly and is why udevd keeps a queue
of worker processes.



Sincerely,

Christoph Lohmann




Re: [dev] [PATCH] Add -g (geometry) option to tabbed.

2013-08-20 Thread Thorsten Glaser
Christoph Lohmann dixit:

Thanks for the hint, but you didn’t do it right. The geometry string al‐
lows to specify negative positions too and a negative  zero  too.  Addi‐

Hrm, ok ☹ back to the drawing board, then (unless you’ve got
a hint – I’ve not done any X11 programming previously).

tionally this now fixates the geometry of tabbed.

I do not quite understand this? It sets a different geometry
at start if one’s given, no change otherwise, AIUI.

bye,
//mirabilos
-- 
22:59⎜Vutral glaub ich termkit is kompliziert | glabe nicht das man
damit schneller arbeitet | reizüberflutung │ wie windows │ alles evil
zuviel bilder │ wie ein spiel | 23:00⎜Vutral die meisten raffen auch
nicht mehr von windows | 23:01⎜Vutral bilderbücher sind ja auch nich
wirklich verbreitet als erwachsenen literatur   ‣ who needs GUIs thus?