summaryrefslogtreecommitdiff
path: root/dmenu
diff options
context:
space:
mode:
authorniliara-edu <nil.jimeno@estudiant.fjaverianas.com>2024-06-12 23:16:27 +0200
committerniliara-edu <nil.jimeno@estudiant.fjaverianas.com>2024-06-12 23:16:27 +0200
commite5fdd2a9338e914a489f9598c9b4e841b38981c0 (patch)
tree22016ff5d12631b3b1c206ab57c38e8f98e314ff /dmenu
parentcd5198f084186dacb9f90bc2b52654f16f6feefb (diff)
cicada update
Diffstat (limited to 'dmenu')
-rwxr-xr-xdmenu/config.def.h9
-rwxr-xr-xdmenu/config.h2
-rwxr-xr-xdmenu/dmenubin43088 -> 43088 bytes
-rw-r--r--dmenu/dmenu-alpha-20210605-1a13d04.diff267
-rw-r--r--dmenu/dmenu-border-4.9.diff25
-rw-r--r--dmenu/dmenu-center-4.8.diff56
-rw-r--r--dmenu/dmenu.obin33664 -> 33664 bytes
-rw-r--r--dmenu/themes/cicada.h14
-rw-r--r--dmenu/themes/veloren.def.h14
-rw-r--r--dmenu/themes/veloren.h10
10 files changed, 39 insertions, 358 deletions
diff --git a/dmenu/config.def.h b/dmenu/config.def.h
index ada9542..310b349 100755
--- a/dmenu/config.def.h
+++ b/dmenu/config.def.h
@@ -1,6 +1,10 @@
/* See LICENSE file for copyright and license details. */
/* Default settings; can be overriden by command line. */
-#include "themes/sunshine.h"
+#include "themes/veloren.h"
+
+static const unsigned int border_width = 2;
+
+
static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */
@@ -19,6 +23,3 @@ static unsigned int lines = 10;
* for example: " /?\"&[]"
*/
static const char worddelimiters[] = " ";
-
-/* Size of the window border */
-static const unsigned int border_width = 5;
diff --git a/dmenu/config.h b/dmenu/config.h
index 310b349..1655574 100755
--- a/dmenu/config.h
+++ b/dmenu/config.h
@@ -1,6 +1,6 @@
/* See LICENSE file for copyright and license details. */
/* Default settings; can be overriden by command line. */
-#include "themes/veloren.h"
+#include "themes/cicada.h"
static const unsigned int border_width = 2;
diff --git a/dmenu/dmenu b/dmenu/dmenu
index fec2dff..df3bc5b 100755
--- a/dmenu/dmenu
+++ b/dmenu/dmenu
Binary files differ
diff --git a/dmenu/dmenu-alpha-20210605-1a13d04.diff b/dmenu/dmenu-alpha-20210605-1a13d04.diff
deleted file mode 100644
index 51679f7..0000000
--- a/dmenu/dmenu-alpha-20210605-1a13d04.diff
+++ /dev/null
@@ -1,267 +0,0 @@
-diff --git a/config.def.h b/config.def.h
-index 1edb647..697d511 100644
---- a/config.def.h
-+++ b/config.def.h
-@@ -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 const unsigned int alpha = 0xf0;
- /* -fn option overrides fonts[0]; default X11 font or font set */
- static const char *fonts[] = {
- "monospace:size=10"
-@@ -13,6 +14,13 @@ static const char *colors[SchemeLast][2] = {
- [SchemeSel] = { "#eeeeee", "#005577" },
- [SchemeOut] = { "#000000", "#00ffff" },
- };
-+
-+static const unsigned int alphas[SchemeLast][2] = {
-+ [SchemeNorm] = { OPAQUE, alpha },
-+ [SchemeSel] = { OPAQUE, alpha },
-+ [SchemeOut] = { OPAQUE, alpha },
-+};
-+
- /* -l option; if nonzero, dmenu uses vertical list with given number of lines */
- static unsigned int lines = 0;
-
-diff --git a/dmenu.c b/dmenu.c
-index 65f25ce..3e56e1a 100644
---- a/dmenu.c
-+++ b/dmenu.c
-@@ -10,6 +10,7 @@
-
- #include <X11/Xlib.h>
- #include <X11/Xatom.h>
-+#include <X11/Xproto.h>
- #include <X11/Xutil.h>
- #ifdef XINERAMA
- #include <X11/extensions/Xinerama.h>
-@@ -25,6 +26,8 @@
- #define LENGTH(X) (sizeof X / sizeof X[0])
- #define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
-
-+#define OPAQUE 0xffU
-+
- /* enums */
- enum { SchemeNorm, SchemeSel, SchemeOut, SchemeLast }; /* color schemes */
-
-@@ -53,10 +56,16 @@ static XIC xic;
- static Drw *drw;
- static Clr *scheme[SchemeLast];
-
-+static int useargb = 0;
-+static Visual *visual;
-+static int depth;
-+static Colormap cmap;
-+
- #include "config.h"
-
- static int (*fstrncmp)(const char *, const char *, size_t) = strncmp;
- static char *(*fstrstr)(const char *, const char *) = strstr;
-+static void xinitvisual();
-
- static void
- appenditem(struct item *item, struct item **list, struct item **last)
-@@ -602,7 +611,7 @@ setup(void)
- #endif
- /* init appearance */
- for (j = 0; j < SchemeLast; j++)
-- scheme[j] = drw_scm_create(drw, colors[j], 2);
-+ scheme[j] = drw_scm_create(drw, colors[j], alphas[i], 2);
-
- clip = XInternAtom(dpy, "CLIPBOARD", False);
- utf8 = XInternAtom(dpy, "UTF8_STRING", False);
-@@ -640,6 +649,7 @@ setup(void)
- x = info[i].x_org;
- y = info[i].y_org + (topbar ? 0 : info[i].height - mh);
- mw = info[i].width;
-+
- XFree(info);
- } else
- #endif
-@@ -657,11 +667,13 @@ setup(void)
-
- /* create menu window */
- swa.override_redirect = True;
-- swa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
-+ swa.background_pixel = 0;
-+ swa.border_pixel = 0;
-+ swa.colormap = cmap;
- swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask;
-- win = XCreateWindow(dpy, parentwin, x, y, mw, mh, 0,
-- CopyFromParent, CopyFromParent, CopyFromParent,
-- CWOverrideRedirect | CWBackPixel | CWEventMask, &swa);
-+ win = XCreateWindow(dpy, parentwin, x, y, mw, mh, border_width,
-+ depth, CopyFromParent, visual,
-+ CWOverrideRedirect | CWBackPixel | CWBorderPixel | CWColormap | CWEventMask, &swa);
- XSetClassHint(dpy, win, &ch);
-
-
-@@ -747,7 +759,8 @@ main(int argc, char *argv[])
- if (!XGetWindowAttributes(dpy, parentwin, &wa))
- die("could not get embedding window attributes: 0x%lx",
- parentwin);
-- drw = drw_create(dpy, screen, root, wa.width, wa.height);
-+ xinitvisual();
-+ drw = drw_create(dpy, screen, root, wa.width, wa.height, visual, depth, cmap);
- if (!drw_fontset_create(drw, fonts, LENGTH(fonts)))
- die("no fonts could be loaded.");
- lrpad = drw->fonts->h;
-@@ -769,3 +782,40 @@ main(int argc, char *argv[])
-
- return 1; /* unreachable */
- }
-+
-+ void
-+xinitvisual()
-+{
-+ XVisualInfo *infos;
-+ XRenderPictFormat *fmt;
-+ int nitems;
-+ int i;
-+
-+ XVisualInfo tpl = {
-+ .screen = screen,
-+ .depth = 32,
-+ .class = TrueColor
-+ };
-+ long masks = VisualScreenMask | VisualDepthMask | VisualClassMask;
-+
-+ infos = XGetVisualInfo(dpy, masks, &tpl, &nitems);
-+ visual = NULL;
-+ for(i = 0; i < nitems; i ++) {
-+ fmt = XRenderFindVisualFormat(dpy, infos[i].visual);
-+ if (fmt->type == PictTypeDirect && fmt->direct.alphaMask) {
-+ visual = infos[i].visual;
-+ depth = infos[i].depth;
-+ cmap = XCreateColormap(dpy, root, visual, AllocNone);
-+ useargb = 1;
-+ break;
-+ }
-+ }
-+
-+ XFree(infos);
-+
-+ if (! visual) {
-+ visual = DefaultVisual(dpy, screen);
-+ depth = DefaultDepth(dpy, screen);
-+ cmap = DefaultColormap(dpy, screen);
-+ }
-+}
-diff --git a/drw.c b/drw.c
-index 4cdbcbe..fe3aadd 100644
---- a/drw.c
-+++ b/drw.c
-@@ -61,7 +61,7 @@ utf8decode(const char *c, long *u, size_t clen)
- }
-
- Drw *
--drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h)
-+drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h, Visual *visual, unsigned int depth, Colormap cmap)
- {
- Drw *drw = ecalloc(1, sizeof(Drw));
-
-@@ -70,8 +70,11 @@ drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h
- drw->root = root;
- drw->w = w;
- drw->h = h;
-- drw->drawable = XCreatePixmap(dpy, root, w, h, DefaultDepth(dpy, screen));
-- drw->gc = XCreateGC(dpy, root, 0, NULL);
-+ drw->visual = visual;
-+ drw->depth = depth;
-+ drw->cmap = cmap;
-+ drw->drawable = XCreatePixmap(dpy, root, w, h, depth);
-+ drw->gc = XCreateGC(dpy, drw->drawable, 0, NULL);
- XSetLineAttributes(dpy, drw->gc, 1, LineSolid, CapButt, JoinMiter);
-
- return drw;
-@@ -87,7 +90,7 @@ drw_resize(Drw *drw, unsigned int w, unsigned int h)
- drw->h = h;
- if (drw->drawable)
- XFreePixmap(drw->dpy, drw->drawable);
-- drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, DefaultDepth(drw->dpy, drw->screen));
-+ drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, drw->depth);
- }
-
- void
-@@ -194,21 +197,22 @@ drw_fontset_free(Fnt *font)
- }
-
- void
--drw_clr_create(Drw *drw, Clr *dest, const char *clrname)
-+drw_clr_create(Drw *drw, Clr *dest, const char *clrname, unsigned int alpha)
- {
- if (!drw || !dest || !clrname)
- return;
-
-- if (!XftColorAllocName(drw->dpy, DefaultVisual(drw->dpy, drw->screen),
-- DefaultColormap(drw->dpy, drw->screen),
-+ if (!XftColorAllocName(drw->dpy, drw->visual, drw->cmap,
- clrname, dest))
- die("error, cannot allocate color '%s'", clrname);
-+
-+ dest->pixel = (dest->pixel & 0x00ffffffU) | (alpha << 24);
- }
-
- /* Wrapper to create color schemes. The caller has to call free(3) on the
- * returned color scheme when done using it. */
- Clr *
--drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount)
-+drw_scm_create(Drw *drw, const char *clrnames[], const unsigned int alphas[], size_t clrcount)
- {
- size_t i;
- Clr *ret;
-@@ -218,7 +222,7 @@ drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount)
- return NULL;
-
- for (i = 0; i < clrcount; i++)
-- drw_clr_create(drw, &ret[i], clrnames[i]);
-+ drw_clr_create(drw, &ret[i], clrnames[i], alphas[i]);
- return ret;
- }
-
-@@ -274,9 +278,7 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
- } else {
- XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel);
- XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h);
-- d = XftDrawCreate(drw->dpy, drw->drawable,
-- DefaultVisual(drw->dpy, drw->screen),
-- DefaultColormap(drw->dpy, drw->screen));
-+ d = XftDrawCreate(drw->dpy, drw->drawable, drw->visual, drw->cmap);
- x += lpad;
- w -= lpad;
- }
-diff --git a/drw.h b/drw.h
-index 4c67419..f6fa5cd 100644
---- a/drw.h
-+++ b/drw.h
-@@ -20,6 +20,9 @@ typedef struct {
- Display *dpy;
- int screen;
- Window root;
-+ Visual *visual;
-+ unsigned int depth;
-+ Colormap cmap;
- Drawable drawable;
- GC gc;
- Clr *scheme;
-@@ -27,7 +30,7 @@ typedef struct {
- } Drw;
-
- /* Drawable abstraction */
--Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h);
-+Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h, Visual*, unsigned int, Colormap);
- void drw_resize(Drw *drw, unsigned int w, unsigned int h);
- void drw_free(Drw *drw);
-
-@@ -38,8 +41,8 @@ unsigned int drw_fontset_getwidth(Drw *drw, const char *text);
- void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h);
-
- /* Colorscheme abstraction */
--void drw_clr_create(Drw *drw, Clr *dest, const char *clrname);
--Clr *drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount);
-+void drw_clr_create(Drw *drw, Clr *dest, const char *clrname, unsigned int alpha);
-+Clr *drw_scm_create(Drw *drw, const char *clrnames[], const unsigned int alphas[], size_t clrcount);
-
- /* Cursor abstraction */
- Cur *drw_cur_create(Drw *drw, int shape);
diff --git a/dmenu/dmenu-border-4.9.diff b/dmenu/dmenu-border-4.9.diff
deleted file mode 100644
index 89b4437..0000000
--- a/dmenu/dmenu-border-4.9.diff
+++ /dev/null
@@ -1,25 +0,0 @@
-diff -up dmenu-4.9-b/config.def.h dmenu-4.9-a/config.def.h
---- dmenu-4.9-b/config.def.h 2019-02-02 13:55:02.000000000 +0100
-+++ dmenu-4.9-a/config.def.h 2019-05-19 02:10:12.740040403 +0200
-@@ -21,3 +21,6 @@ static unsigned int lines = 0;
- * for example: " /?\"&[]"
- */
- static const char worddelimiters[] = " ";
-+
-+/* Size of the window border */
-+static const unsigned int border_width = 5;
-diff -up dmenu-4.9-b/dmenu.c dmenu-4.9-a/dmenu.c
---- dmenu-4.9-b/dmenu.c 2019-02-02 13:55:02.000000000 +0100
-+++ dmenu-4.9-a/dmenu.c 2019-05-19 02:11:20.966710117 +0200
-@@ -654,9 +654,10 @@ setup(void)
- swa.override_redirect = True;
- swa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
- swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask;
-- win = XCreateWindow(dpy, parentwin, x, y, mw, mh, 0,
-+ win = XCreateWindow(dpy, parentwin, x, y, mw, mh, border_width,
- CopyFromParent, CopyFromParent, CopyFromParent,
- CWOverrideRedirect | CWBackPixel | CWEventMask, &swa);
-+ XSetWindowBorder(dpy, win, scheme[SchemeSel][ColBg].pixel);
- XSetClassHint(dpy, win, &ch);
-
- /* open input methods */
diff --git a/dmenu/dmenu-center-4.8.diff b/dmenu/dmenu-center-4.8.diff
deleted file mode 100644
index a970fcb..0000000
--- a/dmenu/dmenu-center-4.8.diff
+++ /dev/null
@@ -1,56 +0,0 @@
-diff --git a/dmenu.c b/dmenu.c
-index 5e9c367..2268ea9 100644
---- a/dmenu.c
-+++ b/dmenu.c
-@@ -88,6 +88,15 @@ calcoffsets(void)
- break;
- }
-
-+static int
-+max_textw(void)
-+{
-+ int len = 0;
-+ for (struct item *item = items; item && item->text; item++)
-+ len = MAX(TEXTW(item->text), len);
-+ return len;
-+}
-+
- static void
- cleanup(void)
- {
-@@ -598,6 +607,7 @@ setup(void)
- bh = drw->fonts->h + 2;
- lines = MAX(lines, 0);
- mh = (lines + 1) * bh;
-+ promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 : 0;
- #ifdef XINERAMA
- i = 0;
- if (parentwin == root && (info = XineramaQueryScreens(dpy, &n))) {
-@@ -624,9 +634,9 @@ setup(void)
- if (INTERSECT(x, y, 1, 1, info[i]))
- break;
-
-- x = info[i].x_org;
-- y = info[i].y_org + (topbar ? 0 : info[i].height - mh);
-- mw = info[i].width;
-+ mw = MIN(MAX(max_textw() + promptw, 100), info[i].width);
-+ x = info[i].x_org + ((info[i].width - mw) / 2);
-+ y = info[i].y_org + ((info[i].height - mh) / 2);
- XFree(info);
- } else
- #endif
-@@ -634,11 +644,10 @@ setup(void)
- if (!XGetWindowAttributes(dpy, parentwin, &wa))
- die("could not get embedding window attributes: 0x%lx",
- parentwin);
-- x = 0;
-- y = topbar ? 0 : wa.height - mh;
-- mw = wa.width;
-+ mw = MIN(MAX(max_textw() + promptw, 100), wa.width);
-+ x = (wa.width - mw) / 2;
-+ y = (wa.height - mh) / 2;
- }
-- promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 : 0;
- inputw = MIN(inputw, mw/3);
- match();
-
diff --git a/dmenu/dmenu.o b/dmenu/dmenu.o
index 203628c..7b64138 100644
--- a/dmenu/dmenu.o
+++ b/dmenu/dmenu.o
Binary files differ
diff --git a/dmenu/themes/cicada.h b/dmenu/themes/cicada.h
new file mode 100644
index 0000000..caf4b09
--- /dev/null
+++ b/dmenu/themes/cicada.h
@@ -0,0 +1,14 @@
+static const char *colors[SchemeLast][2] = {
+ /* fg bg */
+ [SchemeNorm] = { "#bbbbbb", "#000" },
+ [SchemeSel] = { "#eeeeee", "#880" },
+ [SchemeOut] = { "#000000", "#880" },
+};
+//static const unsigned int alpha = 0xf9;
+static const unsigned int alpha = 0xff;
+
+static const unsigned int alphas[SchemeLast][2] = {
+ [SchemeNorm] = { OPAQUE, alpha },
+ [SchemeSel] = { OPAQUE, alpha },
+ [SchemeOut] = { OPAQUE, alpha },
+};
diff --git a/dmenu/themes/veloren.def.h b/dmenu/themes/veloren.def.h
new file mode 100644
index 0000000..30cb06f
--- /dev/null
+++ b/dmenu/themes/veloren.def.h
@@ -0,0 +1,14 @@
+static const char *colors[SchemeLast][2] = {
+ /* fg bg */
+ [SchemeNorm] = { "#bbbbbb", "#222222" },
+ [SchemeSel] = { "#eeeeee", "#862" },
+ [SchemeOut] = { "#000000", "#862" },
+};
+//static const unsigned int alpha = 0xf0;
+static const unsigned int alpha = 0xf9;
+
+static const unsigned int alphas[SchemeLast][2] = {
+ [SchemeNorm] = { OPAQUE, alpha },
+ [SchemeSel] = { OPAQUE, alpha },
+ [SchemeOut] = { OPAQUE, alpha },
+};
diff --git a/dmenu/themes/veloren.h b/dmenu/themes/veloren.h
index 30cb06f..99f0b0f 100644
--- a/dmenu/themes/veloren.h
+++ b/dmenu/themes/veloren.h
@@ -1,11 +1,11 @@
static const char *colors[SchemeLast][2] = {
/* fg bg */
- [SchemeNorm] = { "#bbbbbb", "#222222" },
- [SchemeSel] = { "#eeeeee", "#862" },
- [SchemeOut] = { "#000000", "#862" },
+ [SchemeNorm] = { "#bbbbbb", "#111100" },
+ [SchemeSel] = { "#eeeeee", "#960" },
+ [SchemeOut] = { "#000000", "#960" },
};
-//static const unsigned int alpha = 0xf0;
-static const unsigned int alpha = 0xf9;
+//static const unsigned int alpha = 0xf9;
+static const unsigned int alpha = 0xff;
static const unsigned int alphas[SchemeLast][2] = {
[SchemeNorm] = { OPAQUE, alpha },