RE: [dev] [dmenu] What is the status of the project?

From: Jente Hidskes <jthidskes_AT_outlook.com>
Date: Wed, 17 Apr 2013 21:25:22 +0200

I see you are open for patches now. Have you heard of the xyw offsets patch? It allows to you, for example, have dmenu spawn in the center of the screen at co÷rdinates x and y, and width w. Note that the patch is not mine, I don't know where I picked it up. I just made it apply to dmenu 4.5 --- a/dmenu.1 2012-01-08 13:18:43.000000000 +0100 +++ b/dmenu.1 2012-12-12 22:54:01.622487570 +0100 _AT__AT_ -55,6 +55,15 _AT__AT_ .BI \-fn " font" defines the font or font set used. .TP +.BI \-x " xoffset" +defines the offset from the left border of the screen. +.TP +.BI \-y " yoffset" +defines the offset from the top border of the screen. +.TP +.BI \-w " width" +defines the desired menu window width. +.TP .BI \-nb " color" defines the normal background color. .IR #RGB , --- a/dmenu.c 2012-12-12 22:58:55.475859117 +0100 +++ b/dmenu.c 2012-12-12 23:02:21.569227230 +0100 _AT__AT_ -44,6 +44,9 _AT_@ static char text[BUFSIZ] = ""; static int bh, mw, mh; static int inputw, promptw; +static int xoffset = 0; +static int yoffset = 0; +static int width = 0; static size_t cursor = 0; static const char *font = NULL; static const char *prompt = NULL; _AT__AT_ -90,6 +93,12 _AT_@ else if(i+1 == argc) usage(); /* these options take one argument */ + else if(!strcmp(argv[i], "-x")) /* offset from the left border of the screen */ + xoffset = atoi(argv[++i]); + else if(!strcmp(argv[i], "-y")) /* offset from the top border of the screen */ + yoffset = atoi(argv[++i]); + else if(!strcmp(argv[i], "-w")) /* defines the desired menu window width */ + width = atoi(argv[++i]); else if(!strcmp(argv[i], "-l")) /* number of lines in vertical list */ lines = atoi(argv[++i]); else if(!strcmp(argv[i], "-p")) /* adds prompt to left of input field */ _AT__AT_ -578,7 +587,7 _AT_@ break; x = info[i].x_org; - y = info[i].y_org + (topbar ? 0 : info[i].height - mh); + y = info[i].y_org + (topbar ? yoffset : info[i].height - mh - yoffset); mw = info[i].width; XFree(info); } _AT__AT_ -586,9 +595,13 _AT_@ #endif { x = 0; - y = topbar ? 0 : DisplayHeight(dc->dpy, screen) - mh; + y = topbar ? yoffset : DisplayHeight(dc->dpy, screen) - mh - yoffset; mw = DisplayWidth(dc->dpy, screen); } + + x += xoffset; + mw = width ? width : mw; + promptw = prompt ? textw(dc, prompt) : 0; inputw = MIN(inputw, mw/3); match(); _AT__AT_ -615,6 +628,7 _AT_@ void usage(void) { fputs("usage: dmenu [-b] [-f] [-i] [-l lines] [-p prompt] [-fn font]\n" + " [-x xoffset] [-y yoffset] [-w width]\n" " [-nb color] [-nf color] [-sb color] [-sf color] [-v]\n", stderr); exit(EXIT_FAILURE); } ---------------------------------------- > Date: Wed, 17 Apr 2013 21:16:52 +0200 > Subject: Re: [dev] [dmenu] What is the status of the project? > From: garbeam_AT_gmail.com > To: dev_AT_suckless.org > > On 17 April 2013 21:14, William Giokas <1007380_AT_gmail.com> wrote: > > On Wed, Apr 17, 2013 at 09:04:27PM +0200, Anselm R Garbe wrote: > >> On 15 April 2013 10:08, Alexander Sedov <alex0player_AT_gmail.com> wrote: > >> > I went through the mailing list archives since the date of last commit > >> > and collected all patches that seem relevant/interesting to me. Sorry > >> > if you have already seen some of these. > >> > http://lists.suckless.org/dev/1108/9114.html > >> > >> This seems to be wmii related, so no apply. > >> > >> > http://lists.suckless.org/dev/1110/9742.html > >> > >> Ok, applied. > >> > >> > http://lists.suckless.org/dev/1303/14982.html > >> > >> Ok applied. > >> > >> > http://lists.suckless.org/dev/1304/15300.html > >> > >> Ok, applied, but in a slightly amended version. > > > > You forgot to add the config.def.h to git. > > Right, fixed. > > Thanks, > Anselm >
Received on Wed Apr 17 2013 - 21:25:22 CEST

This archive was generated by hypermail 2.3.0 : Wed Apr 17 2013 - 21:36:05 CEST