Compare commits
28 Commits
Author | SHA1 | Date | |
---|---|---|---|
b76632b9e3 | |||
f8f5b27036 | |||
d6bf35caad | |||
507c030b5b | |||
0245394e4d | |||
b6cd6ed266 | |||
09813fcf2c | |||
64d68b7de9 | |||
eaf8909378 | |||
c0fcfb7827 | |||
a45d6983ab | |||
08420a935b | |||
deea1fb5ab | |||
771c0cb607 | |||
43a19425af | |||
bbfd5391ac | |||
0e96ae6f48 | |||
989649b5a5 | |||
f8d2a29a20 | |||
3438af001a | |||
201b056e39 | |||
3dcdbe2a57 | |||
5336608a86 | |||
d398a2e318 | |||
2829009138 | |||
cae2fbdf38 | |||
225cd764c3 | |||
279966a16f |
4
.hgtags
4
.hgtags
@ -14,3 +14,7 @@ bee7fe6d1189174d0204ca3195b83cdc1bb4f82e 1.2
|
|||||||
df3fbb050004c544d14e43c36f6a94cca6ed4a69 1.4
|
df3fbb050004c544d14e43c36f6a94cca6ed4a69 1.4
|
||||||
e071fb045bd9e8574947acff7196360bc0270e68 1.5
|
e071fb045bd9e8574947acff7196360bc0270e68 1.5
|
||||||
dcc5427f99f51a978386a0dd770467cd911ac84b 1.6
|
dcc5427f99f51a978386a0dd770467cd911ac84b 1.6
|
||||||
|
58dbef4aef3d45c7a3da6945e53c9667c0f02d5b 1.7
|
||||||
|
3696d77aaf02f5d15728dde3b9e35abcaf291496 1.7.1
|
||||||
|
d3e6fa22ae45b38b1bdb0d813390365e5930360b 1.8
|
||||||
|
c7f5f4d543170f03d70468e98a3a0ec8d2c4161b 1.9
|
||||||
|
4
LICENSE
4
LICENSE
@ -1,7 +1,7 @@
|
|||||||
MIT/X Consortium License
|
MIT/X Consortium License
|
||||||
|
|
||||||
(C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
(C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
(C)opyright MMVI Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
(C)opyright MMVI-MMVII Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a
|
Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
copy of this software and associated documentation files (the "Software"),
|
copy of this software and associated documentation files (the "Software"),
|
||||||
|
2
Makefile
2
Makefile
@ -1,5 +1,5 @@
|
|||||||
# dmenu - dynamic menu
|
# dmenu - dynamic menu
|
||||||
# (C)opyright MMVI Anselm R. Garbe
|
# (C)opyright MMVII Anselm R. Garbe
|
||||||
|
|
||||||
include config.mk
|
include config.mk
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# dmenu version
|
# dmenu version
|
||||||
VERSION = 1.7
|
VERSION = 2.0
|
||||||
|
|
||||||
# Customize below to fit your system
|
# Customize below to fit your system
|
||||||
|
|
||||||
@ -20,6 +20,11 @@ LDFLAGS = ${LIBS}
|
|||||||
#CFLAGS = -g -Wall -O2 ${INCS} -DVERSION=\"${VERSION}\"
|
#CFLAGS = -g -Wall -O2 ${INCS} -DVERSION=\"${VERSION}\"
|
||||||
#LDFLAGS = -g ${LIBS}
|
#LDFLAGS = -g ${LIBS}
|
||||||
|
|
||||||
|
# Solaris
|
||||||
|
#CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\"
|
||||||
|
#LDFLAGS = ${LIBS}
|
||||||
|
#CFLAGS += -xtarget=ultra
|
||||||
|
|
||||||
# compiler and linker
|
# compiler and linker
|
||||||
CC = cc
|
CC = cc
|
||||||
LD = ${CC}
|
LD = ${CC}
|
||||||
|
49
dmenu.1
49
dmenu.1
@ -3,12 +3,13 @@
|
|||||||
dmenu \- dynamic menu
|
dmenu \- dynamic menu
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B dmenu
|
.B dmenu
|
||||||
.RB [ \-font " <name>"]
|
.RB [ \-b ]
|
||||||
.RB [ \-normbg " <color>"]
|
.RB [ \-fn " <font>"]
|
||||||
.RB [ \-normfg " <color>"]
|
.RB [ \-nb " <color>"]
|
||||||
.RB [ \-selbg " <color>"]
|
.RB [ \-nf " <color>"]
|
||||||
.RB [ \-selfg " <color>"]
|
|
||||||
.RB [ \-p " <prompt>"]
|
.RB [ \-p " <prompt>"]
|
||||||
|
.RB [ \-sb " <color>"]
|
||||||
|
.RB [ \-sf " <color>"]
|
||||||
.RB [ \-t " <seconds>"]
|
.RB [ \-t " <seconds>"]
|
||||||
.RB [ \-v ]
|
.RB [ \-v ]
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
@ -19,24 +20,27 @@ It manages huge amounts (up to 10.000 and more) of user defined menu items
|
|||||||
efficiently.
|
efficiently.
|
||||||
.SS Options
|
.SS Options
|
||||||
.TP
|
.TP
|
||||||
.B \-font <name>
|
.B \-b
|
||||||
|
makes dmenu appear at the screen bottom (by default it appears at the screen top).
|
||||||
|
.TP
|
||||||
|
.B \-fn <font>
|
||||||
defines the font.
|
defines the font.
|
||||||
.TP
|
.TP
|
||||||
.B \-normbg <color>
|
.B \-nb <color>
|
||||||
defines the normal background color (#RGB, #RRGGBB, and color names are supported).
|
defines the normal background color (#RGB, #RRGGBB, and color names are supported).
|
||||||
.TP
|
.TP
|
||||||
.B \-normfg <color>
|
.B \-nf <color>
|
||||||
defines the normal foreground color (#RGB, #RRGGBB, and color names are supported).
|
defines the normal foreground color (#RGB, #RRGGBB, and color names are supported).
|
||||||
.TP
|
.TP
|
||||||
.B \-selbg <color>
|
|
||||||
defines the selected background color (#RGB, #RRGGBB, and color names are supported).
|
|
||||||
.TP
|
|
||||||
.B \-selfg <color>
|
|
||||||
defines the selected foreground color (#RGB, #RRGGBB, and color names are supported).
|
|
||||||
.TP
|
|
||||||
.B \-p <prompt>
|
.B \-p <prompt>
|
||||||
defines a prompt to be displayed before the input area.
|
defines a prompt to be displayed before the input area.
|
||||||
.TP
|
.TP
|
||||||
|
.B \-sb <color>
|
||||||
|
defines the selected background color (#RGB, #RRGGBB, and color names are supported).
|
||||||
|
.TP
|
||||||
|
.B \-sf <color>
|
||||||
|
defines the selected foreground color (#RGB, #RRGGBB, and color names are supported).
|
||||||
|
.TP
|
||||||
.B \-t <seconds>
|
.B \-t <seconds>
|
||||||
defines the seconds to wait for standard input, before exiting (default is 3).
|
defines the seconds to wait for standard input, before exiting (default is 3).
|
||||||
.TP
|
.TP
|
||||||
@ -53,30 +57,30 @@ dmenu is completely controlled by the keyboard. The following keys are recognize
|
|||||||
Appends the character to the text in the input field. This works as a filter:
|
Appends the character to the text in the input field. This works as a filter:
|
||||||
only items containing this text will be displayed.
|
only items containing this text will be displayed.
|
||||||
.TP
|
.TP
|
||||||
.B Left/Right
|
.B Left/Right (Mod1-h/Mod1-l)
|
||||||
Select the previous/next item.
|
Select the previous/next item.
|
||||||
.TP
|
.TP
|
||||||
.B PageUp/PageDown
|
.B PageUp/PageDown (Mod1-k/Mod1-j)
|
||||||
Select the first item of the previous/next 'page' of items.
|
Select the first item of the previous/next 'page' of items.
|
||||||
.TP
|
.TP
|
||||||
.B Home/End
|
.B Home/End (Mod1-g/Mod1-G)
|
||||||
Select the first/last item.
|
Select the first/last item.
|
||||||
.TP
|
.TP
|
||||||
.B Tab
|
.B Tab (Control-i)
|
||||||
Copy the selected item to the input field.
|
Copy the selected item to the input field.
|
||||||
.TP
|
.TP
|
||||||
.B Return
|
.B Return (Control-j)
|
||||||
Confirm selection and quit (print the selected item to standard output). Returns
|
Confirm selection and quit (print the selected item to standard output). Returns
|
||||||
.B 0
|
.B 0
|
||||||
on termination.
|
on termination.
|
||||||
.TP
|
.TP
|
||||||
.B Shift-Return
|
.B Shift-Return (Control-Shift-j)
|
||||||
Confirm selection and quit (print the text in the input field to standard output).
|
Confirm selection and quit (print the text in the input field to standard output).
|
||||||
Returns
|
Returns
|
||||||
.B 0
|
.B 0
|
||||||
on termination.
|
on termination.
|
||||||
.TP
|
.TP
|
||||||
.B Escape
|
.B Escape (Control-bracketleft)
|
||||||
Quit without selecting an item. Returns
|
Quit without selecting an item. Returns
|
||||||
.B 1
|
.B 1
|
||||||
on termination.
|
on termination.
|
||||||
@ -87,4 +91,5 @@ Remove enough characters from the input field to change its filtering effect.
|
|||||||
.B Control-u
|
.B Control-u
|
||||||
Remove all characters from the input field.
|
Remove all characters from the input field.
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.BR dwm (1)
|
.BR dwm (1),
|
||||||
|
.BR wmii (1) .
|
||||||
|
10
dmenu.h
10
dmenu.h
@ -1,14 +1,14 @@
|
|||||||
/* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* See LICENSE file for license details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
|
|
||||||
#define FONT "-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*"
|
#define FONT "-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*"
|
||||||
#define NORMBGCOLOR "#333366"
|
#define NORMBGCOLOR "#eeeeee"
|
||||||
#define NORMFGCOLOR "#cccccc"
|
#define NORMFGCOLOR "#222222"
|
||||||
#define SELBGCOLOR "#666699"
|
#define SELBGCOLOR "#006699"
|
||||||
#define SELFGCOLOR "#eeeeee"
|
#define SELFGCOLOR "#ffffff"
|
||||||
#define SPACE 30 /* px */
|
#define SPACE 30 /* px */
|
||||||
|
|
||||||
/* color */
|
/* color */
|
||||||
|
2
draw.c
2
draw.c
@ -1,4 +1,4 @@
|
|||||||
/* (C)opyright MMIV-MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
/* (C)opyright MMIV-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* See LICENSE file for license details.
|
||||||
*/
|
*/
|
||||||
#include "dmenu.h"
|
#include "dmenu.h"
|
||||||
|
108
main.c
108
main.c
@ -1,5 +1,5 @@
|
|||||||
/* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* (C)opyright MMVI Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
* (C)opyright MMVI-MMVII Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* See LICENSE file for license details.
|
||||||
*/
|
*/
|
||||||
#include "dmenu.h"
|
#include "dmenu.h"
|
||||||
@ -15,6 +15,8 @@
|
|||||||
#include <X11/Xutil.h>
|
#include <X11/Xutil.h>
|
||||||
#include <X11/keysym.h>
|
#include <X11/keysym.h>
|
||||||
|
|
||||||
|
#define CLEANMASK(mask) (mask & ~(numlockmask | LockMask))
|
||||||
|
|
||||||
typedef struct Item Item;
|
typedef struct Item Item;
|
||||||
struct Item {
|
struct Item {
|
||||||
Item *next; /* traverses all items */
|
Item *next; /* traverses all items */
|
||||||
@ -26,11 +28,12 @@ struct Item {
|
|||||||
|
|
||||||
static char text[4096];
|
static char text[4096];
|
||||||
static char *prompt = NULL;
|
static char *prompt = NULL;
|
||||||
static int mx, my, mw, mh;
|
static int mw, mh;
|
||||||
static int ret = 0;
|
static int ret = 0;
|
||||||
static int nitem = 0;
|
static int nitem = 0;
|
||||||
static unsigned int cmdw = 0;
|
static unsigned int cmdw = 0;
|
||||||
static unsigned int promptw = 0;
|
static unsigned int promptw = 0;
|
||||||
|
static unsigned int numlockmask = 0;
|
||||||
static Bool running = True;
|
static Bool running = True;
|
||||||
static Item *allitems = NULL; /* first of all items */
|
static Item *allitems = NULL; /* first of all items */
|
||||||
static Item *item = NULL; /* first of pattern matching items */
|
static Item *item = NULL; /* first of pattern matching items */
|
||||||
@ -164,17 +167,49 @@ kpress(XKeyEvent * e) {
|
|||||||
switch (ksym) {
|
switch (ksym) {
|
||||||
default: /* ignore other control sequences */
|
default: /* ignore other control sequences */
|
||||||
return;
|
return;
|
||||||
|
case XK_bracketleft:
|
||||||
|
ksym = XK_Escape;
|
||||||
break;
|
break;
|
||||||
case XK_h:
|
case XK_h:
|
||||||
case XK_H:
|
case XK_H:
|
||||||
ksym = XK_BackSpace;
|
ksym = XK_BackSpace;
|
||||||
break;
|
break;
|
||||||
|
case XK_i:
|
||||||
|
case XK_I:
|
||||||
|
ksym = XK_Tab;
|
||||||
|
break;
|
||||||
|
case XK_j:
|
||||||
|
case XK_J:
|
||||||
|
ksym = XK_Return;
|
||||||
|
break;
|
||||||
case XK_u:
|
case XK_u:
|
||||||
case XK_U:
|
case XK_U:
|
||||||
text[0] = 0;
|
text[0] = 0;
|
||||||
match(text);
|
match(text);
|
||||||
drawmenu();
|
drawmenu();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(CLEANMASK(e->state) & Mod1Mask) {
|
||||||
|
switch(ksym) {
|
||||||
|
default: return;
|
||||||
|
case XK_h:
|
||||||
|
ksym = XK_Left;
|
||||||
|
break;
|
||||||
|
case XK_l:
|
||||||
|
ksym = XK_Right;
|
||||||
|
break;
|
||||||
|
case XK_j:
|
||||||
|
ksym = XK_Next;
|
||||||
|
break;
|
||||||
|
case XK_k:
|
||||||
|
ksym = XK_Prior;
|
||||||
|
break;
|
||||||
|
case XK_g:
|
||||||
|
ksym = XK_Home;
|
||||||
|
break;
|
||||||
|
case XK_G:
|
||||||
|
ksym = XK_End;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -200,11 +235,13 @@ kpress(XKeyEvent * e) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case XK_End:
|
case XK_End:
|
||||||
|
if(!item)
|
||||||
|
return;
|
||||||
while(next) {
|
while(next) {
|
||||||
sel = curr = next;
|
sel = curr = next;
|
||||||
calcoffsets();
|
calcoffsets();
|
||||||
}
|
}
|
||||||
while(sel->right)
|
while(sel && sel->right)
|
||||||
sel = sel->right;
|
sel = sel->right;
|
||||||
break;
|
break;
|
||||||
case XK_Escape:
|
case XK_Escape:
|
||||||
@ -212,6 +249,8 @@ kpress(XKeyEvent * e) {
|
|||||||
running = False;
|
running = False;
|
||||||
break;
|
break;
|
||||||
case XK_Home:
|
case XK_Home:
|
||||||
|
if(!item)
|
||||||
|
return;
|
||||||
sel = curr = item;
|
sel = curr = item;
|
||||||
calcoffsets();
|
calcoffsets();
|
||||||
break;
|
break;
|
||||||
@ -225,16 +264,16 @@ kpress(XKeyEvent * e) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case XK_Next:
|
case XK_Next:
|
||||||
if(next) {
|
if(!next)
|
||||||
sel = curr = next;
|
return;
|
||||||
calcoffsets();
|
sel = curr = next;
|
||||||
}
|
calcoffsets();
|
||||||
break;
|
break;
|
||||||
case XK_Prior:
|
case XK_Prior:
|
||||||
if(prev) {
|
if(!prev)
|
||||||
sel = curr = prev;
|
return;
|
||||||
calcoffsets();
|
sel = curr = prev;
|
||||||
}
|
calcoffsets();
|
||||||
break;
|
break;
|
||||||
case XK_Return:
|
case XK_Return:
|
||||||
if((e->state & ShiftMask) && text)
|
if((e->state & ShiftMask) && text)
|
||||||
@ -303,6 +342,7 @@ DC dc = {0};
|
|||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[]) {
|
main(int argc, char *argv[]) {
|
||||||
|
Bool bottom = False;
|
||||||
char *font = FONT;
|
char *font = FONT;
|
||||||
char *maxname;
|
char *maxname;
|
||||||
char *normbg = NORMBGCOLOR;
|
char *normbg = NORMBGCOLOR;
|
||||||
@ -310,43 +350,48 @@ main(int argc, char *argv[]) {
|
|||||||
char *selbg = SELBGCOLOR;
|
char *selbg = SELBGCOLOR;
|
||||||
char *selfg = SELFGCOLOR;
|
char *selfg = SELFGCOLOR;
|
||||||
fd_set rd;
|
fd_set rd;
|
||||||
int i;
|
int i, j, my;
|
||||||
struct timeval timeout;
|
struct timeval timeout;
|
||||||
Item *itm;
|
Item *itm;
|
||||||
XEvent ev;
|
XEvent ev;
|
||||||
|
XModifierKeymap *modmap;
|
||||||
XSetWindowAttributes wa;
|
XSetWindowAttributes wa;
|
||||||
|
|
||||||
timeout.tv_usec = 0;
|
timeout.tv_usec = 0;
|
||||||
timeout.tv_sec = 3;
|
timeout.tv_sec = 3;
|
||||||
/* command line args */
|
/* command line args */
|
||||||
for(i = 1; i < argc; i++)
|
for(i = 1; i < argc; i++)
|
||||||
if(!strncmp(argv[i], "-font", 6)) {
|
if(!strncmp(argv[i], "-b", 3)) {
|
||||||
|
bottom = True;
|
||||||
|
}
|
||||||
|
else if(!strncmp(argv[i], "-fn", 4)) {
|
||||||
if(++i < argc) font = argv[i];
|
if(++i < argc) font = argv[i];
|
||||||
}
|
}
|
||||||
else if(!strncmp(argv[i], "-normbg", 8)) {
|
else if(!strncmp(argv[i], "-nb", 4)) {
|
||||||
if(++i < argc) normbg = argv[i];
|
if(++i < argc) normbg = argv[i];
|
||||||
}
|
}
|
||||||
else if(!strncmp(argv[i], "-normfg", 8)) {
|
else if(!strncmp(argv[i], "-nf", 4)) {
|
||||||
if(++i < argc) normfg = argv[i];
|
if(++i < argc) normfg = argv[i];
|
||||||
}
|
}
|
||||||
else if(!strncmp(argv[i], "-selbg", 7)) {
|
|
||||||
if(++i < argc) selbg = argv[i];
|
|
||||||
}
|
|
||||||
else if(!strncmp(argv[i], "-selfg", 7)) {
|
|
||||||
if(++i < argc) selfg = argv[i];
|
|
||||||
}
|
|
||||||
else if(!strncmp(argv[i], "-p", 3)) {
|
else if(!strncmp(argv[i], "-p", 3)) {
|
||||||
if(++i < argc) prompt = argv[i];
|
if(++i < argc) prompt = argv[i];
|
||||||
}
|
}
|
||||||
|
else if(!strncmp(argv[i], "-sb", 4)) {
|
||||||
|
if(++i < argc) selbg = argv[i];
|
||||||
|
}
|
||||||
|
else if(!strncmp(argv[i], "-sf", 4)) {
|
||||||
|
if(++i < argc) selfg = argv[i];
|
||||||
|
}
|
||||||
else if(!strncmp(argv[i], "-t", 3)) {
|
else if(!strncmp(argv[i], "-t", 3)) {
|
||||||
if(++i < argc) timeout.tv_sec = atoi(argv[i]);
|
if(++i < argc) timeout.tv_sec = atoi(argv[i]);
|
||||||
}
|
}
|
||||||
else if(!strncmp(argv[i], "-v", 3)) {
|
else if(!strncmp(argv[i], "-v", 3)) {
|
||||||
fputs("dmenu-"VERSION", (C)opyright MMVI Anselm R. Garbe\n", stdout);
|
fputs("dmenu-"VERSION", (C)opyright MMVI-MMVII Anselm R. Garbe\n", stdout);
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
eprint("usage: dmenu [-font <name>] [-{norm,sel}{bg,fg} <color>] [-p <prompt>] [-t <seconds>] [-v]\n", stdout);
|
eprint("usage: dmenu [-b] [-fn <font>] [-nb <color>] [-nf <color>] [-p <prompt>]\n"
|
||||||
|
" [-sb <color>] [-sf <color>] [-t <seconds>] [-v]\n", stdout);
|
||||||
setlocale(LC_CTYPE, "");
|
setlocale(LC_CTYPE, "");
|
||||||
dpy = XOpenDisplay(0);
|
dpy = XOpenDisplay(0);
|
||||||
if(!dpy)
|
if(!dpy)
|
||||||
@ -367,6 +412,15 @@ main(int argc, char *argv[]) {
|
|||||||
if(select(ConnectionNumber(dpy) + 1, &rd, NULL, NULL, &timeout) < 1)
|
if(select(ConnectionNumber(dpy) + 1, &rd, NULL, NULL, &timeout) < 1)
|
||||||
goto UninitializedEnd;
|
goto UninitializedEnd;
|
||||||
maxname = readstdin();
|
maxname = readstdin();
|
||||||
|
/* init modifier map */
|
||||||
|
modmap = XGetModifierMapping(dpy);
|
||||||
|
for (i = 0; i < 8; i++) {
|
||||||
|
for (j = 0; j < modmap->max_keypermod; j++) {
|
||||||
|
if(modmap->modifiermap[i * modmap->max_keypermod + j] == XKeysymToKeycode(dpy, XK_Num_Lock))
|
||||||
|
numlockmask = (1 << i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
XFreeModifiermap(modmap);
|
||||||
/* style */
|
/* style */
|
||||||
dc.norm[ColBG] = getcolor(normbg);
|
dc.norm[ColBG] = getcolor(normbg);
|
||||||
dc.norm[ColFG] = getcolor(normfg);
|
dc.norm[ColFG] = getcolor(normfg);
|
||||||
@ -377,10 +431,12 @@ main(int argc, char *argv[]) {
|
|||||||
wa.override_redirect = 1;
|
wa.override_redirect = 1;
|
||||||
wa.background_pixmap = ParentRelative;
|
wa.background_pixmap = ParentRelative;
|
||||||
wa.event_mask = ExposureMask | ButtonPressMask | KeyPressMask;
|
wa.event_mask = ExposureMask | ButtonPressMask | KeyPressMask;
|
||||||
mx = my = 0;
|
my = 0;
|
||||||
mw = DisplayWidth(dpy, screen);
|
mw = DisplayWidth(dpy, screen);
|
||||||
mh = dc.font.height + 2;
|
mh = dc.font.height + 2;
|
||||||
win = XCreateWindow(dpy, root, mx, my, mw, mh, 0,
|
if(bottom)
|
||||||
|
my += DisplayHeight(dpy, screen) - mh;
|
||||||
|
win = XCreateWindow(dpy, root, 0, 0, mw, mh, 0,
|
||||||
DefaultDepth(dpy, screen), CopyFromParent,
|
DefaultDepth(dpy, screen), CopyFromParent,
|
||||||
DefaultVisual(dpy, screen),
|
DefaultVisual(dpy, screen),
|
||||||
CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa);
|
CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa);
|
||||||
|
Reference in New Issue
Block a user