new stuff

This commit is contained in:
coast 2025-06-08 02:28:08 +03:30
parent 82bfba72f5
commit 95cf5437ff
7 changed files with 47 additions and 197 deletions

View file

@ -1,12 +1,9 @@
# Speedy controlled animations
animations = true; animations = true;
animation-stiffness-in-tag = 120; animation-stiffness-in-tag = 120;
animation-stiffness-tag-change = 90.0; animation-stiffness-tag-change = 90.0;
animation-window-mass = 0.3; animation-window-mass = 0.3;
animation-dampening = 5; animation-dampening = 5;
animation-clamping = false; animation-clamping = false;
# Zoom, but FAST
animation-for-open-window = "zoom"; animation-for-open-window = "zoom";
animation-for-unmap-window = "zoom"; animation-for-unmap-window = "zoom";
animation-for-transient-window = "zoom"; animation-for-transient-window = "zoom";
@ -14,18 +11,13 @@ animation-for-prev-tag = "zoom";
animation-for-next-tag = "zoom"; animation-for-next-tag = "zoom";
animation-for-workspace-switch-in = "zoom"; animation-for-workspace-switch-in = "zoom";
animation-for-workspace-switch-out = "zoom"; animation-for-workspace-switch-out = "zoom";
animation-max-size = 20; animation-max-size = 20;
# Fading transitions (FASTER)
enable-fading-prev-tag = true; enable-fading-prev-tag = true;
enable-fading-next-tag = true; enable-fading-next-tag = true;
fading = true; fading = true;
fade-in-step = 0.07; fade-in-step = 0.07;
fade-out-step = 0.06; fade-out-step = 0.06;
fade-delta = 5; fade-delta = 5;
# Shadow stuff
shadow = true; shadow = true;
shadow-radius = 12; shadow-radius = 12;
shadow-offset-x = -5; shadow-offset-x = -5;
@ -35,8 +27,6 @@ shadow-color = "#000000";
shadow-exclude = [ shadow-exclude = [
"class_g = 'slop'" "class_g = 'slop'"
]; ];
# Blur (still spicy)
blur-background = true; blur-background = true;
blur-background-frame = true; blur-background-frame = true;
blur-method = "dual_kawase"; blur-method = "dual_kawase";
@ -48,20 +38,15 @@ blur-exclude = [
"class_g = 'maim'", "class_g = 'maim'",
"window_type = 'dock'" "window_type = 'dock'"
]; ];
fading = true; fading = true;
fade-in-step = 0.03; fade-in-step = 0.03;
fade-out-step = 0.03; fade-out-step = 0.03;
fade-delta = 5; fade-delta = 5;
# Corners
#corner-radius = 10; #corner-radius = 10;
rounded-corners-exclude = [ rounded-corners-exclude = [
"class_g = 'slop'", "class_g = 'slop'",
"class_g = 'maim'" "class_g = 'maim'"
]; ];
# Opacity rules
opacity-rule = [ opacity-rule = [
"93:class_g = 'discord'", "93:class_g = 'discord'",
"80:class_g = 'spotify'", "80:class_g = 'spotify'",
@ -74,7 +59,6 @@ opacity-rule = [
"100:class_g = 'slop'" "100:class_g = 'slop'"
]; ];
# Focus and animation exclude
focus-exclude = [ focus-exclude = [
"class_g = 'slop'", "class_g = 'slop'",
"class_g = 'maim'" "class_g = 'maim'"
@ -82,8 +66,6 @@ focus-exclude = [
animation-exclude = [ animation-exclude = [
"class_g = 'slop'" "class_g = 'slop'"
]; ];
# General stuff
daemon = false; daemon = false;
backend = "glx"; backend = "glx";
dithered-present = false; dithered-present = false;
@ -101,8 +83,6 @@ xrender-sync-fence = true;
window-shader-fg = "default"; window-shader-fg = "default";
transparent-clipping = false; transparent-clipping = false;
log-level = "warn"; log-level = "warn";
# Wintypes (with fast popup animations)
wintypes: { wintypes: {
tooltip = { fade = true; shadow = true; opacity = 0.95; focus = true; animations = true; animation-for-open-window = "zoom"; }; tooltip = { fade = true; shadow = true; opacity = 0.95; focus = true; animations = true; animation-for-open-window = "zoom"; };
dock = { shadow = false; clip-shadow-above = true; }; dock = { shadow = false; clip-shadow-above = true; };
@ -111,8 +91,6 @@ wintypes: {
dropdown_menu = { opacity = 0.95; animations = true; shadow = true; animation-for-open-window = "zoom"; }; dropdown_menu = { opacity = 0.95; animations = true; shadow = true; animation-for-open-window = "zoom"; };
unknown = { fade = false; shadow = false; opacity = 1.0; focus = false; full-shadow = false; clip-shadow-above = false; animations = false; }; unknown = { fade = false; shadow = false; opacity = 1.0; focus = false; full-shadow = false; clip-shadow-above = false; animations = false; };
}; };
# Global exclusion
blur-exclude = [ blur-exclude = [
"class_g = 'slop'", "class_g = 'slop'",
"class_g = 'screenie'", "class_g = 'screenie'",

View file

@ -2,32 +2,22 @@
/* Default settings; can be overriden by command line. */ /* Default settings; can be overriden by command line. */
static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */ static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */
static int centered = 1; /* -c option; centers dmenu on screen */
static int min_width = 80; /* minimum width when centered */
static const float menu_height_ratio =
2.0f; /* This is the ratio used in the original calculation */
/* -fn option overrides fonts[0]; default X11 font or font set */ /* -fn option overrides fonts[0]; default X11 font or font set */
static const char *fonts[] = {"monospace:size=10"}; static const char *fonts[] = {
static const char *prompt = "monospace:size=10"
NULL; /* -p option; prompt to the left of input field */ };
static const char *prompt = NULL; /* -p option; prompt to the left of input field */
#include "/home/pixel/.cache/wal/colors-wal-dmenu.h" static const char *colors[SchemeLast][2] = {
// static const char *colors[SchemeLast][2] = {
/* fg bg */ /* fg bg */
/* [SchemeNorm] = {"#bbbbbb", "#222222"}, [SchemeNorm] = { "#bbbbbb", "#222222" },
[SchemeSel] = { "#eeeeee", "#005577" }, [SchemeSel] = { "#eeeeee", "#005577" },
[SchemeOut] = { "#000000", "#00ffff" }, [SchemeOut] = { "#000000", "#00ffff" },
}; };
*/ /* -l option; if nonzero, dmenu uses vertical list with given number of lines */
/* -l and -g options; controls number of lines and columns in grid if > 0 */ static unsigned int lines = 0;
static unsigned int lines = 9;
static unsigned int columns = 1;
/* /*
* Characters not considered part of a word while deleting words * Characters not considered part of a word while deleting words
* for example: " /?\"&[]" * for example: " /?\"&[]"
*/ */
static const char worddelimiters[] = " "; static const char worddelimiters[] = " ";
/* Size of the window border */
static unsigned int border_width = 3;

View file

@ -1,33 +1,23 @@
/* See LICENSE file for copyright and license details. */ /* See LICENSE file for copyright and license details. */
/* Default settings; can be overriden by command line. */ /* Default settings; can be overriden by command line. */
static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */ static int topbar = 0; /* -b option; if 0, dmenu appears at bottom */
static int centered = 1; /* -c option; centers dmenu on screen */
static int min_width = 80; /* minimum width when centered */
static const float menu_height_ratio =
2.0f; /* This is the ratio used in the original calculation */
/* -fn option overrides fonts[0]; default X11 font or font set */ /* -fn option overrides fonts[0]; default X11 font or font set */
static const char *fonts[] = {"monospace:size=10"}; static const char *fonts[] = {
static const char *prompt = "monospace:size=10"
NULL; /* -p option; prompt to the left of input field */ };
static const char *prompt = NULL; /* -p option; prompt to the left of input field */
#include "/home/pixel/.cache/wal/colors-wal-dmenu.h" static const char *colors[SchemeLast][2] = {
// static const char *colors[SchemeLast][2] = {
/* fg bg */ /* fg bg */
/* [SchemeNorm] = {"#bbbbbb", "#222222"}, [SchemeNorm] = { "#bbbbbb", "#222222" },
[SchemeSel] = { "#eeeeee", "#005577" }, [SchemeSel] = { "#eeeeee", "#005577" },
[SchemeOut] = { "#000000", "#00ffff" }, [SchemeOut] = { "#000000", "#00ffff" },
}; };
*/ /* -l option; if nonzero, dmenu uses vertical list with given number of lines */
/* -l and -g options; controls number of lines and columns in grid if > 0 */ static unsigned int lines = 0;
static unsigned int lines = 9;
static unsigned int columns = 1;
/* /*
* Characters not considered part of a word while deleting words * Characters not considered part of a word while deleting words
* for example: " /?\"&[]" * for example: " /?\"&[]"
*/ */
static const char worddelimiters[] = " "; static const char worddelimiters[] = " ";
/* Size of the window border */
static unsigned int border_width = 3;

Binary file not shown.

View file

@ -4,8 +4,6 @@ dmenu \- dynamic menu
.SH SYNOPSIS .SH SYNOPSIS
.B dmenu .B dmenu
.RB [ \-bfiv ] .RB [ \-bfiv ]
.RB [ \-g
.IR columns ]
.RB [ \-l .RB [ \-l
.IR lines ] .IR lines ]
.RB [ \-m .RB [ \-m
@ -42,9 +40,6 @@ which lists programs in the user's $PATH and runs the result in their $SHELL.
.B \-b .B \-b
dmenu appears at the bottom of the screen. dmenu appears at the bottom of the screen.
.TP .TP
.B \-c
dmenu appears centered on the screen.
.TP
.B \-f .B \-f
dmenu grabs the keyboard before reading stdin if not reading from a tty. This dmenu grabs the keyboard before reading stdin if not reading from a tty. This
is faster, but will lock up X until stdin reaches end\-of\-file. is faster, but will lock up X until stdin reaches end\-of\-file.
@ -52,11 +47,8 @@ is faster, but will lock up X until stdin reaches end\-of\-file.
.B \-i .B \-i
dmenu matches menu items case insensitively. dmenu matches menu items case insensitively.
.TP .TP
.BI \-g " columns"
dmenu lists items in a grid with the given number of columns.
.TP
.BI \-l " lines" .BI \-l " lines"
dmenu lists items in a grid with the given number of lines. dmenu lists items vertically, with the given number of lines.
.TP .TP
.BI \-m " monitor" .BI \-m " monitor"
dmenu is displayed on the monitor number supplied. Monitor numbers are starting dmenu is displayed on the monitor number supplied. Monitor numbers are starting

View file

@ -15,7 +15,6 @@
#include <X11/extensions/Xinerama.h> #include <X11/extensions/Xinerama.h>
#endif #endif
#include <X11/Xft/Xft.h> #include <X11/Xft/Xft.h>
#include <X11/Xresource.h>
#include "drw.h" #include "drw.h"
#include "util.h" #include "util.h"
@ -53,10 +52,6 @@ static XIC xic;
static Drw *drw; static Drw *drw;
static Clr *scheme[SchemeLast]; static Clr *scheme[SchemeLast];
/* Temporary arrays to allow overriding xresources values */
static char *colortemp[4];
static char *tempfonts;
#include "config.h" #include "config.h"
static int (*fstrncmp)(const char *, const char *, size_t) = strncmp; static int (*fstrncmp)(const char *, const char *, size_t) = strncmp;
@ -88,7 +83,7 @@ calcoffsets(void)
int i, n; int i, n;
if (lines > 0) if (lines > 0)
n = lines * columns * bh; n = lines * bh;
else else
n = mw - (promptw + inputw + TEXTW("<") + TEXTW(">")); n = mw - (promptw + inputw + TEXTW("<") + TEXTW(">"));
/* calculate which items will begin the next page and previous page */ /* calculate which items will begin the next page and previous page */
@ -100,21 +95,12 @@ calcoffsets(void)
break; 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 static void
cleanup(void) cleanup(void)
{ {
size_t i; size_t i;
XUngrabKey(dpy, AnyKey, AnyModifier, root); XUngrabKeyboard(dpy, CurrentTime);
for (i = 0; i < SchemeLast; i++) for (i = 0; i < SchemeLast; i++)
free(scheme[i]); free(scheme[i]);
for (i = 0; items && items[i].text; ++i) for (i = 0; items && items[i].text; ++i)
@ -182,15 +168,9 @@ drawmenu(void)
} }
if (lines > 0) { if (lines > 0) {
/* draw grid */ /* draw vertical list */
int i = 0; for (item = curr; item != next; item = item->right)
for (item = curr; item != next; item = item->right, i++) drawitem(item, x, y += bh, mw - x);
drawitem(
item,
x + ((i / lines) * ((mw - x) / columns)),
y + (((i % lines) + 1) * bh),
(mw - x) / columns
);
} else if (matches) { } else if (matches) {
/* draw horizontal list */ /* draw horizontal list */
x += inputw; x += inputw;
@ -646,13 +626,8 @@ setup(void)
int a, di, n, area = 0; int a, di, n, area = 0;
#endif #endif
/* init appearance */ /* init appearance */
for (j = 0; j < SchemeLast; j++) { for (j = 0; j < SchemeLast; j++)
scheme[j] = drw_scm_create(drw, (const char**)colors[j], 2); scheme[j] = drw_scm_create(drw, colors[j], 2);
}
for (j = 0; j < SchemeOut; ++j) {
for (i = 0; i < 2; ++i)
free(colors[j][i]);
}
clip = XInternAtom(dpy, "CLIPBOARD", False); clip = XInternAtom(dpy, "CLIPBOARD", False);
utf8 = XInternAtom(dpy, "UTF8_STRING", False); utf8 = XInternAtom(dpy, "UTF8_STRING", False);
@ -661,7 +636,6 @@ setup(void)
bh = drw->fonts->h + 2; bh = drw->fonts->h + 2;
lines = MAX(lines, 0); lines = MAX(lines, 0);
mh = (lines + 1) * bh; mh = (lines + 1) * bh;
promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 : 0;
#ifdef XINERAMA #ifdef XINERAMA
i = 0; i = 0;
if (parentwin == root && (info = XineramaQueryScreens(dpy, &n))) { if (parentwin == root && (info = XineramaQueryScreens(dpy, &n))) {
@ -688,16 +662,9 @@ setup(void)
if (INTERSECT(x, y, 1, 1, info[i]) != 0) if (INTERSECT(x, y, 1, 1, info[i]) != 0)
break; break;
if (centered) {
mw = MIN(MAX(max_textw() + promptw, min_width), info[i].width);
x = info[i].x_org + ((info[i].width - mw) / 2);
y = info[i].y_org + ((info[i].height - mh) / menu_height_ratio);
} else {
x = info[i].x_org; x = info[i].x_org;
y = info[i].y_org + (topbar ? 0 : info[i].height - mh); y = info[i].y_org + (topbar ? 0 : info[i].height - mh);
mw = info[i].width; mw = info[i].width;
}
XFree(info); XFree(info);
} else } else
#endif #endif
@ -705,17 +672,10 @@ setup(void)
if (!XGetWindowAttributes(dpy, parentwin, &wa)) if (!XGetWindowAttributes(dpy, parentwin, &wa))
die("could not get embedding window attributes: 0x%lx", die("could not get embedding window attributes: 0x%lx",
parentwin); parentwin);
if (centered) {
mw = MIN(MAX(max_textw() + promptw, min_width), wa.width);
x = (wa.width - mw) / 2;
y = (wa.height - mh) / 2;
} else {
x = 0; x = 0;
y = topbar ? 0 : wa.height - mh; y = topbar ? 0 : wa.height - mh;
mw = wa.width; mw = wa.width;
} }
}
promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 : 0; promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 : 0;
inputw = mw / 3; /* input width: ~33% of monitor width */ inputw = mw / 3; /* input width: ~33% of monitor width */
match(); match();
@ -724,11 +684,9 @@ setup(void)
swa.override_redirect = True; swa.override_redirect = True;
swa.background_pixel = scheme[SchemeNorm][ColBg].pixel; swa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask; swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask;
win = XCreateWindow(dpy, root, x, y, mw, mh, border_width, win = XCreateWindow(dpy, root, x, y, mw, mh, 0,
CopyFromParent, CopyFromParent, CopyFromParent, CopyFromParent, CopyFromParent, CopyFromParent,
CWOverrideRedirect | CWBackPixel | CWEventMask, &swa); CWOverrideRedirect | CWBackPixel | CWEventMask, &swa);
if (border_width)
XSetWindowBorder(dpy, win, scheme[SchemeSel][ColBg].pixel);
XSetClassHint(dpy, win, &ch); XSetClassHint(dpy, win, &ch);
/* input methods */ /* input methods */
@ -760,41 +718,6 @@ usage(void)
" [-nb color] [-nf color] [-sb color] [-sf color] [-w windowid]"); " [-nb color] [-nf color] [-sb color] [-sf color] [-w windowid]");
} }
void
readxresources(void) {
XrmInitialize();
char* xrm;
if ((xrm = XResourceManagerString(drw->dpy))) {
char *type;
XrmDatabase xdb = XrmGetStringDatabase(xrm);
XrmValue xval;
if (XrmGetResource(xdb, "dmenu.font", "*", &type, &xval))
fonts[0] = strdup(xval.addr);
else
fonts[0] = strdup(fonts[0]);
if (XrmGetResource(xdb, "dmenu.background", "*", &type, &xval))
colors[SchemeNorm][ColBg] = strdup(xval.addr);
else
colors[SchemeNorm][ColBg] = strdup(colors[SchemeNorm][ColBg]);
if (XrmGetResource(xdb, "dmenu.foreground", "*", &type, &xval))
colors[SchemeNorm][ColFg] = strdup(xval.addr);
else
colors[SchemeNorm][ColFg] = strdup(colors[SchemeNorm][ColFg]);
if (XrmGetResource(xdb, "dmenu.selbackground", "*", &type, &xval))
colors[SchemeSel][ColBg] = strdup(xval.addr);
else
colors[SchemeSel][ColBg] = strdup(colors[SchemeSel][ColBg]);
if (XrmGetResource(xdb, "dmenu.selforeground", "*", &type, &xval))
colors[SchemeSel][ColFg] = strdup(xval.addr);
else
colors[SchemeSel][ColFg] = strdup(colors[SchemeSel][ColFg]);
XrmDestroyDatabase(xdb);
}
}
int int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
@ -810,38 +733,30 @@ main(int argc, char *argv[])
topbar = 0; topbar = 0;
else if (!strcmp(argv[i], "-f")) /* grabs keyboard before reading stdin */ else if (!strcmp(argv[i], "-f")) /* grabs keyboard before reading stdin */
fast = 1; fast = 1;
else if (!strcmp(argv[i], "-c")) /* centers dmenu on screen */
centered = 1;
else if (!strcmp(argv[i], "-i")) { /* case-insensitive item matching */ else if (!strcmp(argv[i], "-i")) { /* case-insensitive item matching */
fstrncmp = strncasecmp; fstrncmp = strncasecmp;
fstrstr = cistrstr; fstrstr = cistrstr;
} else if (i + 1 == argc) } else if (i + 1 == argc)
usage(); usage();
/* these options take one argument */ /* these options take one argument */
else if (!strcmp(argv[i], "-g")) { /* number of columns in grid */ else if (!strcmp(argv[i], "-l")) /* number of lines in vertical list */
columns = atoi(argv[++i]);
if (lines == 0) lines = 1;
} else if (!strcmp(argv[i], "-l")) { /* number of lines in grid */
lines = atoi(argv[++i]); lines = atoi(argv[++i]);
if (columns == 0) columns = 1; else if (!strcmp(argv[i], "-m"))
} else if (!strcmp(argv[i], "-m"))
mon = atoi(argv[++i]); mon = atoi(argv[++i]);
else if (!strcmp(argv[i], "-p")) /* adds prompt to left of input field */ else if (!strcmp(argv[i], "-p")) /* adds prompt to left of input field */
prompt = argv[++i]; prompt = argv[++i];
else if (!strcmp(argv[i], "-fn")) /* font or font set */ else if (!strcmp(argv[i], "-fn")) /* font or font set */
tempfonts = argv[++i]; fonts[0] = argv[++i];
else if (!strcmp(argv[i], "-nb")) /* normal background color */ else if (!strcmp(argv[i], "-nb")) /* normal background color */
colortemp[0] = argv[++i]; colors[SchemeNorm][ColBg] = argv[++i];
else if (!strcmp(argv[i], "-nf")) /* normal foreground color */ else if (!strcmp(argv[i], "-nf")) /* normal foreground color */
colortemp[1] = argv[++i]; colors[SchemeNorm][ColFg] = argv[++i];
else if (!strcmp(argv[i], "-sb")) /* selected background color */ else if (!strcmp(argv[i], "-sb")) /* selected background color */
colortemp[2] = argv[++i]; colors[SchemeSel][ColBg] = argv[++i];
else if (!strcmp(argv[i], "-sf")) /* selected foreground color */ else if (!strcmp(argv[i], "-sf")) /* selected foreground color */
colortemp[3] = argv[++i]; colors[SchemeSel][ColFg] = argv[++i];
else if (!strcmp(argv[i], "-w")) /* embedding window id */ else if (!strcmp(argv[i], "-w")) /* embedding window id */
embed = argv[++i]; embed = argv[++i];
else if (!strcmp(argv[i], "-bw"))
border_width = atoi(argv[++i]); /* border width */
else else
usage(); usage();
@ -857,23 +772,8 @@ main(int argc, char *argv[])
die("could not get embedding window attributes: 0x%lx", die("could not get embedding window attributes: 0x%lx",
parentwin); parentwin);
drw = drw_create(dpy, screen, root, wa.width, wa.height); drw = drw_create(dpy, screen, root, wa.width, wa.height);
readxresources(); if (!drw_fontset_create(drw, fonts, LENGTH(fonts)))
/* Now we check whether to override xresources with commandline parameters */
if ( tempfonts )
fonts[0] = strdup(tempfonts);
if ( colortemp[0])
colors[SchemeNorm][ColBg] = strdup(colortemp[0]);
if ( colortemp[1])
colors[SchemeNorm][ColFg] = strdup(colortemp[1]);
if ( colortemp[2])
colors[SchemeSel][ColBg] = strdup(colortemp[2]);
if ( colortemp[3])
colors[SchemeSel][ColFg] = strdup(colortemp[3]);
if (!drw_fontset_create(drw, (const char**)fonts, LENGTH(fonts)))
die("no fonts could be loaded."); die("no fonts could be loaded.");
free(fonts[0]);
lrpad = drw->fonts->h; lrpad = drw->fonts->h;
#ifdef __OpenBSD__ #ifdef __OpenBSD__

Binary file not shown.