Compare commits
10 Commits
cfe543b5e0
...
91992dd494
Author | SHA1 | Date |
---|---|---|
mrdotx | 91992dd494 | |
mrdotx | cf3f727b65 | |
mrdotx | 3653aafc00 | |
mrdotx | f8cb897389 | |
mrdotx | 854de3fa4e | |
mrdotx | 4397fa4d63 | |
mrdotx | f9f98b8f56 | |
mrdotx | fa3c8f28c6 | |
mrdotx | 8f6d711d48 | |
mrdotx | 58f4749742 |
2
Makefile
2
Makefile
|
@ -40,7 +40,7 @@ clean:
|
|||
man: pinentry-dmenu.1
|
||||
rm -f pinentry-dmenu.1
|
||||
pandoc -s --to man pinentry-dmenu.1.md -o pinentry-dmenu.1
|
||||
sed -i '1,2d' pinentry-dmenu.1
|
||||
sed -i '/^.\\\"/d' pinentry-dmenu.1
|
||||
|
||||
dist: clean
|
||||
@echo creating dist tarball
|
||||
|
|
|
@ -27,5 +27,5 @@ See the man page for details.
|
|||
|
||||
## Manual
|
||||
|
||||
You can view the manual by running `man pinentry-dmenu`, or `man pinentry-dmenu.1`.
|
||||
If you've already ran `make clean install`.
|
||||
You can view the manual by running `man pinentry-dmenu`
|
||||
or `man pinentry-dmenu.1`, if you've already ran `make clean install`.
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
static unsigned int mon = -1;
|
||||
static unsigned int centerwidth = 1024;
|
||||
static unsigned int embedded = 0;
|
||||
static unsigned int lineheight = 22;
|
||||
static unsigned int borderwidth = 2;
|
||||
static unsigned int lineheight = 25;
|
||||
static unsigned int borderwidth = 1;
|
||||
static unsigned int minpwlen = 32;
|
||||
static unsigned int alphas[SchemeLast][2] = {
|
||||
/* values between 0 (transparent) and 255 (opaque) */
|
||||
|
@ -18,7 +18,7 @@ static unsigned int alphas[SchemeLast][2] = {
|
|||
|
||||
static const char *position = "center";
|
||||
static const char *fonts[] = {
|
||||
"DejaVuSansMono Nerd Font:pixelsize=16"
|
||||
"DejaVuSansMono Nerd Font Mono:pixelsize=16"
|
||||
};
|
||||
static const char *prompt = NULL;
|
||||
static const char *asterisk = "*";
|
||||
|
|
|
@ -19,6 +19,7 @@ FREETYPELIBS = -lfontconfig -lXft
|
|||
FREETYPEINC = /usr/include/freetype2
|
||||
# OpenBSD (uncomment)
|
||||
#FREETYPEINC = ${X11INC}/freetype2
|
||||
#MANPREFIX = ${PREFIX}/man
|
||||
|
||||
# Includes and libs
|
||||
INCS = -I${X11INC} -I${FREETYPEINC}
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
.\" Define V font for inline verbatim, using C font in formats
|
||||
.\" that render this, and otherwise B font.
|
||||
.ie "\f[CB]x\f[]"x" \{\
|
||||
. ftr V B
|
||||
. ftr VI BI
|
||||
|
@ -37,17 +35,19 @@ It is not intended to be invoked directly.
|
|||
\f[B]monitor\f[R] = \f[I]-1\f[R]
|
||||
pinentry-dmenu is displayed on the monitor number supplied.
|
||||
Monitor numbers are starting from 0.
|
||||
Value -1 for focused monitor.
|
||||
.TP
|
||||
\f[B]center_width\f[R] = \f[I]1024\f[R]
|
||||
Defines the width for the `center' menu.
|
||||
Value -1 for full width.
|
||||
.TP
|
||||
\f[B]embedded\f[R] = \f[I]false\f[R]
|
||||
Embed into window.
|
||||
.TP
|
||||
\f[B]line_height\f[R] = \f[I]22\f[R]
|
||||
\f[B]line_height\f[R] = \f[I]25\f[R]
|
||||
Defines menu line of at least `line_height' pixels tall.
|
||||
.TP
|
||||
\f[B]border_width\f[R] = \f[I]2\f[R]
|
||||
\f[B]border_width\f[R] = \f[I]1\f[R]
|
||||
Defines the border width for the menu.
|
||||
.TP
|
||||
\f[B]min_password_length\f[R] = \f[I]32\f[R]
|
||||
|
@ -84,7 +84,7 @@ Defines the description background alpha value.
|
|||
Defines the position of the menu.
|
||||
\f[I]bottom\f[R], \f[I]center\f[R] and \f[I]top\f[R] are supported.
|
||||
.TP
|
||||
\f[B]font\f[R] = \f[I]\[lq]DejaVuSansMono Nerd Font:pixelsize=16\[rq]\f[R]
|
||||
\f[B]font\f[R] = \f[I]\[lq]DejaVuSansMono Nerd Font Mono:pixelsize=16\[rq]\f[R]
|
||||
Defines the font or font set used.
|
||||
.TP
|
||||
\f[B]prompt\f[R] = \f[I]\[lq]\[lq]\f[R]
|
||||
|
@ -237,11 +237,11 @@ embedded = false;
|
|||
.PD 0
|
||||
.P
|
||||
.PD
|
||||
line_height = 22;
|
||||
line_height = 25;
|
||||
.PD 0
|
||||
.P
|
||||
.PD
|
||||
border_width = 2;
|
||||
border_width = 1;
|
||||
.PD 0
|
||||
.P
|
||||
.PD
|
||||
|
|
|
@ -17,18 +17,18 @@ The configuration is placed in *~/.gnupg/pinentry-dmenu.conf*. You can change th
|
|||
# OPTIONS
|
||||
|
||||
**monitor** = *-1*
|
||||
: pinentry-dmenu is displayed on the monitor number supplied. Monitor numbers are starting from 0.
|
||||
: pinentry-dmenu is displayed on the monitor number supplied. Monitor numbers are starting from 0. Value -1 for focused monitor.
|
||||
|
||||
**center_width** = *1024*
|
||||
: Defines the width for the 'center' menu.
|
||||
: Defines the width for the 'center' menu. Value -1 for full width.
|
||||
|
||||
**embedded** = *false*
|
||||
: Embed into window.
|
||||
|
||||
**line_height** = *22*
|
||||
**line_height** = *25*
|
||||
: Defines menu line of at least 'line_height' pixels tall.
|
||||
|
||||
**border_width** = *2*
|
||||
**border_width** = *1*
|
||||
: Defines the border width for the menu.
|
||||
|
||||
**min_password_length** = *32*
|
||||
|
@ -61,7 +61,7 @@ The configuration is placed in *~/.gnupg/pinentry-dmenu.conf*. You can change th
|
|||
**position** = *"center"*
|
||||
: Defines the position of the menu. *bottom*, *center* and *top* are supported.
|
||||
|
||||
**font** = *"DejaVuSansMono Nerd Font:pixelsize=16"*
|
||||
**font** = *"DejaVuSansMono Nerd Font Mono:pixelsize=16"*
|
||||
: Defines the font or font set used.
|
||||
|
||||
**prompt** = *""*
|
||||
|
@ -206,8 +206,8 @@ The configuration is placed in *~/.gnupg/pinentry-dmenu.conf*. You can change th
|
|||
| monitor = -1;
|
||||
| center_width = 1024;
|
||||
| embedded = false;
|
||||
| line_height = 22;
|
||||
| border_width = 2;
|
||||
| line_height = 25;
|
||||
| border_width = 1;
|
||||
| min_password_length = 32;
|
||||
| prompt_fg_alpha = 255;
|
||||
| prompt_bg_alpha = 255;
|
||||
|
|
|
@ -292,7 +292,7 @@ drawwin(void) {
|
|||
drw_setscheme(drw, scheme[SchemeDesc]);
|
||||
if (center) {
|
||||
drw_text(drw, promptw + ppromptw, lineheight, centerwidth,
|
||||
bh + borderwidth, lrpad / 2,
|
||||
bh, lrpad / 2,
|
||||
pinentry_info->description, 0);
|
||||
} else {
|
||||
drw_text(drw, pb, 0, pbw, bh, lrpad / 2,
|
||||
|
@ -357,7 +357,7 @@ setup(void) {
|
|||
|
||||
/* Calculate menu geometry */
|
||||
bh = MAX(drw->fonts->h + 2, lineheight); /* at least line height */
|
||||
mh = bh;
|
||||
mh = bh + (borderwidth * 2);
|
||||
#ifdef XINERAMA
|
||||
info = XineramaQueryScreens(dpy, &n);
|
||||
|
||||
|
@ -394,14 +394,14 @@ setup(void) {
|
|||
}
|
||||
|
||||
if (center) {
|
||||
mw = MIN(centerwidth, info[i].width);
|
||||
mh *= 2;
|
||||
x = info[i].x_org + ((info[i].width - mw) / 2);
|
||||
y = info[i].y_org + ((info[i].height - mh) / 2);
|
||||
mw = MIN(centerwidth, info[i].width) - (borderwidth * 2);
|
||||
mh = (mh * 2) - (borderwidth * 2);
|
||||
x = info[i].x_org + ((info[i].width - mw) / 2) - borderwidth;
|
||||
y = info[i].y_org + ((info[i].height - mh) / 2) - borderwidth;
|
||||
} else {
|
||||
x = info[i].x_org;
|
||||
y = info[i].y_org + (bottom ? info[i].height - mh : 0);
|
||||
mw = info[i].width;
|
||||
mw = info[i].width - (borderwidth * 2);
|
||||
}
|
||||
|
||||
XFree(info);
|
||||
|
@ -413,14 +413,14 @@ setup(void) {
|
|||
}
|
||||
|
||||
if (center) {
|
||||
mw = MIN(centerwidth, wa.width);
|
||||
mh *= 2;
|
||||
x = (wa.width - mw) / 2;
|
||||
y = (wa.height - mh) / 2;
|
||||
mw = MIN(centerwidth, wa.width) - (borderwidth * 2);
|
||||
mh = (mh * 2) - (borderwidth * 2);
|
||||
x = ((wa.width - mw) / 2) - borderwidth;
|
||||
y = ((wa.height - mh) / 2) - borderwidth;
|
||||
} else {
|
||||
x = 0;
|
||||
y = bottom ? wa.height - mh : 0;
|
||||
mw = wa.width;
|
||||
mw = wa.width - (borderwidth * 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -432,8 +432,8 @@ setup(void) {
|
|||
swa.border_pixel = 0;
|
||||
swa.colormap = cmap;
|
||||
swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask;
|
||||
win = XCreateWindow(dpy, parentwin, x, y, mw, mh, borderwidth,
|
||||
depth, CopyFromParent, visual,
|
||||
win = XCreateWindow(dpy, parentwin, x, y, mw, mh - (borderwidth * 2),
|
||||
borderwidth, depth, CopyFromParent, visual,
|
||||
CWOverrideRedirect | CWBackPixel | CWBorderPixel | CWColormap | CWEventMask, &swa);
|
||||
if (borderwidth)
|
||||
XSetWindowBorder(dpy, win, scheme[SchemeSelect][ColBg].pixel);
|
||||
|
|
Loading…
Reference in New Issue