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

View file

@ -1,33 +1,23 @@
/* See LICENSE file for copyright and license details. */
/* Default settings; can be overriden by command line. */
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 */
static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */
/* -fn option overrides fonts[0]; default X11 font or font set */
static const char *fonts[] = {"monospace:size=10"};
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] = {
/* fg bg */
/* [SchemeNorm] = {"#bbbbbb", "#222222"},
[SchemeSel] = {"#eeeeee", "#005577"},
[SchemeOut] = {"#000000", "#00ffff"},
static const char *fonts[] = {
"monospace:size=10"
};
static const char *prompt = NULL; /* -p option; prompt to the left of input field */
static const char *colors[SchemeLast][2] = {
/* fg bg */
[SchemeNorm] = { "#bbbbbb", "#222222" },
[SchemeSel] = { "#eeeeee", "#005577" },
[SchemeOut] = { "#000000", "#00ffff" },
};
*/
/* -l and -g options; controls number of lines and columns in grid if > 0 */
static unsigned int lines = 9;
static unsigned int columns = 1;
/* -l option; if nonzero, dmenu uses vertical list with given number of lines */
static unsigned int lines = 0;
/*
* Characters not considered part of a word while deleting words
* for example: " /?\"&[]"
*/
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. */
/* Default settings; can be overriden by command line. */
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 */
static int topbar = 0; /* -b option; if 0, dmenu appears at bottom */
/* -fn option overrides fonts[0]; default X11 font or font set */
static const char *fonts[] = {"monospace:size=10"};
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] = {
/* fg bg */
/* [SchemeNorm] = {"#bbbbbb", "#222222"},
[SchemeSel] = {"#eeeeee", "#005577"},
[SchemeOut] = {"#000000", "#00ffff"},
static const char *fonts[] = {
"monospace:size=10"
};
static const char *prompt = NULL; /* -p option; prompt to the left of input field */
static const char *colors[SchemeLast][2] = {
/* fg bg */
[SchemeNorm] = { "#bbbbbb", "#222222" },
[SchemeSel] = { "#eeeeee", "#005577" },
[SchemeOut] = { "#000000", "#00ffff" },
};
*/
/* -l and -g options; controls number of lines and columns in grid if > 0 */
static unsigned int lines = 9;
static unsigned int columns = 1;
/* -l option; if nonzero, dmenu uses vertical list with given number of lines */
static unsigned int lines = 0;
/*
* Characters not considered part of a word while deleting words
* for example: " /?\"&[]"
*/
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
.B dmenu
.RB [ \-bfiv ]
.RB [ \-g
.IR columns ]
.RB [ \-l
.IR lines ]
.RB [ \-m
@ -42,9 +40,6 @@ which lists programs in the user's $PATH and runs the result in their $SHELL.
.B \-b
dmenu appears at the bottom of the screen.
.TP
.B \-c
dmenu appears centered on the screen.
.TP
.B \-f
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.
@ -52,11 +47,8 @@ is faster, but will lock up X until stdin reaches end\-of\-file.
.B \-i
dmenu matches menu items case insensitively.
.TP
.BI \-g " columns"
dmenu lists items in a grid with the given number of columns.
.TP
.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
.BI \-m " monitor"
dmenu is displayed on the monitor number supplied. Monitor numbers are starting

View file

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

Binary file not shown.