-
Notifications
You must be signed in to change notification settings - Fork 0
/
dmenu-caretwidth-5.2.diff
67 lines (64 loc) · 2.31 KB
/
dmenu-caretwidth-5.2.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
diff -up ./dmenu-5.2/config.def.h ./config.def.h
--- ./dmenu-5.2/config.def.h 2022-10-04 23:06:58.000000000 +0530
+++ ./config.def.h 2023-06-09 08:58:44.787865743 +0530
@@ -2,6 +2,7 @@
/* Default settings; can be overriden by command line. */
static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */
+static int caret_width = 2; /* -cw option; set default caret width */
/* -fn option overrides fonts[0]; default X11 font or font set */
static const char *fonts[] = {
"monospace:size=10"
diff -up ./dmenu-5.2/dmenu.1 ./dmenu.1
--- ./dmenu-5.2/dmenu.1 2022-10-04 23:06:58.000000000 +0530
+++ ./dmenu.1 2023-06-09 09:06:11.713071070 +0530
@@ -20,6 +20,8 @@ dmenu \- dynamic menu
.IR color ]
.RB [ \-sf
.IR color ]
+.RB [ \-cw
+.IR caret_width ]
.RB [ \-w
.IR windowid ]
.P
@@ -75,6 +77,9 @@ defines the selected background color.
.BI \-sf " color"
defines the selected foreground color.
.TP
+.BI \-cw " caret_width"
+defines caret width.
+.TP
.B \-v
prints version information to stdout, then exits.
.TP
Only in ./: dmenu-5.2
Only in ./: dmenu-5.2.tar.gz
diff -up ./dmenu-5.2/dmenu.c ./dmenu.c
--- ./dmenu-5.2/dmenu.c 2022-10-04 23:06:58.000000000 +0530
+++ ./dmenu.c 2023-06-09 09:02:02.759283332 +0530
@@ -165,7 +165,7 @@ drawmenu(void)
curpos = TEXTW(text) - TEXTW(&text[cursor]);
if ((curpos += lrpad / 2 - 1) < w) {
drw_setscheme(drw, scheme[SchemeNorm]);
- drw_rect(drw, x + curpos, 2, 2, bh - 4, 1, 0);
+ drw_rect(drw, x + curpos, 2, caret_width, bh - 4, 1, 0);
}
if (lines > 0) {
@@ -711,7 +711,8 @@ static void
usage(void)
{
die("usage: dmenu [-bfiv] [-l lines] [-p prompt] [-fn font] [-m monitor]\n"
- " [-nb color] [-nf color] [-sb color] [-sf color] [-w windowid]");
+ " [-nb color] [-nf color] [-sb color] [-sf color] [-cw caret_width]\n"
+ " [-w windowid]");
}
int
@@ -751,6 +752,8 @@ main(int argc, char *argv[])
colors[SchemeSel][ColBg] = argv[++i];
else if (!strcmp(argv[i], "-sf")) /* selected foreground color */
colors[SchemeSel][ColFg] = argv[++i];
+ else if (!strcmp(argv[i], "-cw")) /* sets caret witdth */
+ caret_width = atoi(argv[++i]);
else if (!strcmp(argv[i], "-w")) /* embedding window id */
embed = argv[++i];
else
Only in ./: dmenu-caretwidth-5.2.diff.