Re: [dev] [dmenu] No x, y, w options?

From: Josh Klar <iv5970_AT_gmail.com>
Date: Sat, 3 Dec 2011 17:20:47 -0500

The mailing list post where a patch for this was posted last time:
http://lists.suckless.org/dev/1108/9190.html

That seems to be doing fine for me, and works fine with 4.4.1, so maybe
just use something to this effect (ish?).
Then again, your mileage may vary, depending on your use. I set mine up to
place itself in my DWM bar just after the ASCII icon for my tiling mode.
Think AwesomeWM's run bar style, except this covers up the window title
rather than shifting it right.

On Sat, Dec 3, 2011 at 9:14 AM, Peter John Hartman <
peterjohnhartman_AT_gmail.com> wrote:

> > It would be more sensible to have a single '-g' flag, for geometry,
> > which would take an X geometry string. I did write a patch a while
> > back which did this, but I don't know where I put it. I also didn't
> > find it at all useful, and some of the code was a bit ugly. What would
> > be the use case for this?
>
> diff -r 6341d6b4c23f config.mk
> --- a/config.mk Mon Oct 17 10:22:23 2011 +0100
> +++ b/config.mk Wed Oct 19 14:17:18 2011 +0100
> _AT__AT_ -18,7 +18,7 @@
>
> # flags
> CPPFLAGS = -D_BSD_SOURCE -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
> -CFLAGS = -ansi -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
> +CFLAGS = -ansi -pedantic -Wall -Wextra -Os ${INCS} ${CPPFLAGS}
> LDFLAGS = -s ${LIBS}
>
> # compiler and linker
> diff -r 6341d6b4c23f dmenu.c
> --- a/dmenu.c Mon Oct 17 10:22:23 2011 +0100
> +++ b/dmenu.c Wed Oct 19 14:17:18 2011 +0100
> _AT__AT_ -39,15 +39,16 @@
> static void usage(void);
>
> static char text[BUFSIZ] = "";
> -static int bh, mw, mh;
> static int inputw, promptw;
> static size_t cursor = 0;
> static const char *font = NULL;
> +static const char *geom = NULL;
> static const char *prompt = NULL;
> static const char *normbgcolor = "#cccccc";
> static const char *normfgcolor = "#000000";
> static const char *selbgcolor = "#0066ff";
> static const char *selfgcolor = "#ffffff";
> +static unsigned int bh, mw, mh;
> static unsigned int lines = 0;
> static unsigned long normcol[ColLast];
> static unsigned long selcol[ColLast];
> _AT__AT_ -85,6 +86,8 @@
> else if(i+1 == argc)
> usage();
> /* double flags */
> + else if(!strcmp(argv[i], "-g"))
> + geom = argv[++i];
> else if(!strcmp(argv[i], "-l"))
> lines = atoi(argv[++i]);
> else if(!strcmp(argv[i], "-p"))
> _AT__AT_ -511,8 +514,12 @@
> bh = dc->font.height + 2;
> lines = MAX(lines, 0);
> mh = (lines + 1) * bh;
> + if(geom) {
> + XParseGeometry(geom, &x, &y, &mw, &mh);
> + lines = (mh / bh)-1;
> + }
> #ifdef XINERAMA
> - if((info = XineramaQueryScreens(dc->dpy, &n))) {
> + else if((info = XineramaQueryScreens(dc->dpy, &n))) {
> int i, di;
> unsigned int du;
> Window w, dw;
> _AT__AT_ -531,9 +538,8 @@
> mw = info[i].width;
> XFree(info);
> }
> - else
> #endif
> - {
> + else {
> x = 0;
> y = topbar ? 0 : DisplayHeight(dc->dpy, screen) - mh;
> mw = DisplayWidth(dc->dpy, screen);
>
> > On 2 December 2011 20:12, Bjartur Thorlacius <svartman95_AT_gmail.com>
> wrote:
> > > Why choose window placement and dimensions at exec, instead of letting
> > > the window manager handle the issue? Just set _NET_WM_WINDOW_TYPE to
> > > _NET_WM_WINDOW_TYPE_DIALOG and spend engineering time ranting about
> > > WM_TRANSIENT_FOR, modality and modularity instead.
> >
> > DIALOG wouldn't work, because dmenu would be given silly decorations
> > &c. I think if we were to go down this route we'd have to go with DOCK
> > and use _NET_WM_STRUT_PARTIAL. Not sure that's a good idea, though.
> >
> > > dmenu's override-redirect flag has always annoyed me, as well as
> > > grabbing the whole keyboard rendering it temporarily unusable for
> > > anything but typing text into dmenu or escaping out of it.
> >
> > I would think that moving one's mouse unfocusing dmenu would be
> > annoying. But if someone were to write a patch I would try it out.
>
> Why would you move the mouse and not expect it to refocus things? Esp.
> since this is how it works everywhere else?
>
> >
> > Thanks,
> > cls
> >
>
> --
> sic dicit magister P
> University of Toronto / Fordham University
> Collins Hall B06; Office Hours TF10-12
> http://individual.utoronto.ca/peterjh
> gpg --keyserver pgp.mit.edu --recv-keys E0DBD3D6
>
>


-- 
Invalid Argument (iv597)
Received on Sat Dec 03 2011 - 23:20:47 CET

This archive was generated by hypermail 2.3.0 : Sat Dec 03 2011 - 23:24:04 CET