update config.h

This commit is contained in:
Stachelbeere1248 2025-03-20 13:33:59 +01:00
parent 2a9c298155
commit a025839ba9
Signed by: Stachelbeere1248
SSH key fingerprint: SHA256:IozEKdw2dB8TZxkpPdMxcWSoWTIMwoLaCcZJ1AJnY2o
3 changed files with 47 additions and 47 deletions

View file

@ -16,29 +16,29 @@ static const float resize_factor = 0.0002f; /* Resize multiplier for m
static const uint32_t resize_interval_ms = 16; /* Resize interval depends on framerate and screen refresh rate. */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
static const char *fonts[] = {"monospace:size=12"};
static const char *fonts[] = {"monospace:size=12", "NotoSansM NFM SemBd"};
static const float rootcolor[] = COLOR(0x6495eded);
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
static uint32_t colors[][3] = {
/* fg bg border */
[SchemeNorm] = { 0xff7777ff, 0x000000c0, 0x30346dff },
[SchemeSel] = { 0xff7777ff, 0x00000050, 0x6495edff },
[SchemeNorm] = { 0xDA651Dff, 0x000000c0, 0x176815ff },
[SchemeSel] = { 0xB33A25ff, 0x00000050, 0x8FC711ff },
[SchemeUrg] = { 0, 0, 0xffaaaaff },
};
enum Direction { DIR_LEFT, DIR_RIGHT, DIR_UP, DIR_DOWN };
/* tagging - TAGCOUNT must be no greater than 31 */
static char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
#define TAGCOUNT (sizeof(tags) / sizeof(tags[0]))
static char *tags[] = { "󰍪", "1", "2", "3", "", "", "\ueb11" };
/* logging */
static int log_level = WLR_ERROR;
/* Autostart */
static const char *const autostart[] = {
"wbg", "/home/stachelbeere1248/.desktop/wallpaper", NULL,
"wbg", "/home/stachel/.desktop/wallpaper", NULL,
"vesktop", NULL,
"foot", NULL,
"foot", "--term", "xterm-256color", NULL,
"keepassxc", NULL,
NULL /* terminate */
};
@ -47,10 +47,10 @@ static const char *const autostart[] = {
static const Rule rules[] = {
/* app_id title tags mask isfloating skipfocus isterm noswallow monitor */
/* examples: */
{ "Gimp_EXAMPLE", NULL, 0, 1, 0, 0, 0, -1 }, /* Start on currently visible tags floating, not tiled */
{ "firefox_EXAMPLE", NULL, 1 << 8, 0, 0, 0, 0, -1 }, /* Start on ONLY tag "9" */
{ "foot", NULL, 0, 0, 0, 1, 1, -1 }, /* make foot swallow clients that are not foot */
{ "KeePassXC", NULL, 1<<6, 0, 1, 0, 0, -1 },
{ "vesktop", NULL, 1, 0, 1, 0, 0, -1 },
{ "wev", NULL, 0, 1, 1, 0, 1, -1 },
};
/* layout(s) */
@ -58,8 +58,8 @@ static const Layout layouts[] = {
/* symbol arrange function */
{ "|w|", btrtile },
{ "[]=", tile },
{ "><>", NULL }, /* no layout function means floating behavior */
{ "[M]", monocle },
//{ "><>", NULL }, /* no layout function means floating behavior */
//{ "[M]", monocle },
};
/* monitors */
@ -88,8 +88,8 @@ static const struct xkb_rule_names xkb_rules = {
.variant = "nodeadkeys"
};
static const int repeat_rate = 25;
static const int repeat_delay = 600;
static const int repeat_rate = -1;
static const int repeat_delay = 0;
/* Trackpad */
static const int tap_to_click = 1;
@ -134,7 +134,7 @@ LIBINPUT_CONFIG_TAP_MAP_LMR -- 1/2/3 finger tap maps to left/middle/right
*/
static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TAP_MAP_LRM;
static const int cursor_timeout = 5;
static const int cursor_timeout = 1;
/* If you want to use the windows key for MODKEY, use WLR_MODIFIER_LOGO */
#define MODKEY WLR_MODIFIER_LOGO
@ -149,11 +149,11 @@ static const int cursor_timeout = 5;
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
/* commands */
static const char *termcmd[] = { "foot", NULL };
static const char *termcmd[] = { "foot", "--term", "xterm-256color", NULL };
static const char *menucmd[] = { "mew-run", NULL };
static const char *upvol[] = { "pactl", "set-sink-volume", "@DEFAULT_SINK@", "+1%", NULL };
static const char *downvol[] = { "pactl", "set-sink-volume", "@DEFAULT_SINK@", "-1%", NULL };
static const char *mutevol[] = { "amixer", "set", "Master", "toggle", NULL };
//static const char *mutevol[] = { "amixer", "set", "Master", "toggle", NULL };
static const char *playpause[] = { "playerctl", "play-pause", NULL };
static const char *nextTrack[] = { "playerctl", "next", NULL };
static const char *prevTrack[] = { "playerctl", "previous", NULL };
@ -165,7 +165,7 @@ static const Key keys[] = {
{ MODKEY, Key_Return, spawn, {.v = termcmd} },
{ 0, Key_XF86AudioRaiseVolume, spawn, {.v = upvol } },
{ 0, Key_XF86AudioLowerVolume, spawn, {.v = downvol } },
{ 0, Key_XF86AudioMute, spawn, {.v = mutevol } },
//{ 0, Key_XF86AudioMute, spawn, {.v = mutevol } },
{ 0, Key_XF86AudioPlay, spawn, {.v = playpause } },
{ 0, Key_XF86AudioNext, spawn, {.v = nextTrack } },
{ 0, Key_XF86AudioPrev, spawn, {.v = prevTrack } },
@ -179,34 +179,33 @@ static const Key keys[] = {
{ MODKEY, Key_p, incnmaster, {.i = -1} },
{ MODKEY, Key_h, setmfact, {.f = -0.05f} },
{ MODKEY, Key_l, setmfact, {.f = +0.05f} },
{ MODKEY|WLR_MODIFIER_SHIFT, Key_Return, zoom, {0} },
{ MODKEY|WLR_MODIFIER_SHIFT, Key_Return, swapclients, {0} },
{ MODKEY|WLR_MODIFIER_CTRL, Key_Return, zoom, {0} },
{ MODKEY, Key_Tab, view, {0} },
{ MODKEY|WLR_MODIFIER_SHIFT, Key_q, killclient, {0} },
{ MODKEY, Key_w, setlayout, {.v = &layouts[0]} },
{ MODKEY, Key_t, setlayout, {.v = &layouts[1]} },
{ MODKEY, Key_f, setlayout, {.v = &layouts[2]} },
{ MODKEY, Key_space, setlayout, {0} },
//{ MODKEY, Key_f, setlayout, {.v = &layouts[2]} },
//{ MODKEY, Key_space, setlayout, {0} },
{ MODKEY|WLR_MODIFIER_SHIFT, Key_space, togglefloating, {0} },
{ MODKEY, Key_e, togglefullscreen, {0} },
{ MODKEY, Key_0, view, {.ui = ~0} },
{ MODKEY|WLR_MODIFIER_SHIFT, Key_0, tag, {.ui = ~0} },
{ MODKEY, Key_comma, focusmon, {.i = WLR_DIRECTION_LEFT} },
{ MODKEY, Key_period, focusmon, {.i = WLR_DIRECTION_RIGHT} },
{ MODKEY|WLR_MODIFIER_SHIFT, Key_comma, tagmon, {.i = WLR_DIRECTION_LEFT} },
{ MODKEY|WLR_MODIFIER_SHIFT, Key_period, tagmon, {.i = WLR_DIRECTION_RIGHT} },
//{ MODKEY, Key_comma, focusmon, {.i = WLR_DIRECTION_LEFT} },
//{ MODKEY, Key_period, focusmon, {.i = WLR_DIRECTION_RIGHT} },
//{ MODKEY|WLR_MODIFIER_SHIFT, Key_comma, tagmon, {.i = WLR_DIRECTION_LEFT} },
//{ MODKEY|WLR_MODIFIER_SHIFT, Key_period, tagmon, {.i = WLR_DIRECTION_RIGHT} },
{ MODKEY|WLR_MODIFIER_CTRL, Key_Right, setratio_h, {.f = +0.025f} },
{ MODKEY|WLR_MODIFIER_CTRL, Key_Left, setratio_h, {.f = -0.025f} },
{ MODKEY|WLR_MODIFIER_CTRL, Key_Up, setratio_v, {.f = -0.025f} },
{ MODKEY|WLR_MODIFIER_CTRL, Key_Down, setratio_v, {.f = +0.025f} },
TAGKEYS( Key_1, 0),
TAGKEYS( Key_2, 1),
TAGKEYS( Key_3, 2),
TAGKEYS( Key_4, 3),
TAGKEYS( Key_5, 4),
TAGKEYS( Key_6, 5),
TAGKEYS( Key_7, 6),
TAGKEYS( Key_8, 7),
TAGKEYS( Key_9, 8),
TAGKEYS( Key_grave, 0),
TAGKEYS( Key_1, 1),
TAGKEYS( Key_2, 2),
TAGKEYS( Key_3, 3),
TAGKEYS( Key_4, 4),
TAGKEYS( Key_5, 5),
TAGKEYS( Key_6, 6),
{ MODKEY|WLR_MODIFIER_SHIFT, Key_e, quit, {0} },
/* Ctrl-Alt-Backspace and Ctrl-Alt-Fx used to be handled by X server */
@ -221,10 +220,10 @@ static const Key keys[] = {
};
static const Button buttons[] = {
{ ClkLtSymbol, 0, BTN_LEFT, setlayout, {.v = &layouts[0]} },
{ ClkLtSymbol, 0, BTN_RIGHT, setlayout, {.v = &layouts[2]} },
{ ClkTitle, 0, BTN_MIDDLE, zoom, {0} },
{ ClkStatus, 0, BTN_MIDDLE, spawn, {.v = termcmd} },
//{ ClkLtSymbol, 0, BTN_LEFT, setlayout, {.v = &layouts[0]} },
//{ ClkLtSymbol, 0, BTN_RIGHT, setlayout, {.v = &layouts[1]} },
//{ ClkTitle, 0, BTN_MIDDLE, zoom, {0} },
//{ ClkStatus, 0, BTN_MIDDLE, spawn, {.v = termcmd} },
{ ClkClient, MODKEY, BTN_LEFT, moveresize, {.ui = CurMove} },
{ ClkClient, MODKEY, BTN_MIDDLE, togglefloating, {0} },
{ ClkClient, MODKEY, BTN_RIGHT, moveresize, {.ui = CurResize} },

View file

@ -13,5 +13,6 @@ XLIBS =
# Uncomment to build XWayland support
XWAYLAND = -DXWAYLAND
XLIBS = xcb xcb-icccm
CC = gcc
CC = gcc
CFLAGS = -O3 -march=native -Wall -Wextra -flto -s
LDFLAGS += -flto

14
dwl.c
View file

@ -540,10 +540,10 @@ static xcb_atom_t netatom[NetLast];
struct Pertag {
unsigned int curtag, prevtag; /* current and previous tag */
int nmasters[TAGCOUNT + 1]; /* number of windows in master area */
float mfacts[TAGCOUNT + 1]; /* mfacts per tag */
unsigned int sellts[TAGCOUNT + 1]; /* selected layouts */
const Layout *ltidxs[TAGCOUNT + 1][2]; /* matrix of tags and layouts indexes */
int nmasters[LENGTH(tags) + 1]; /* number of windows in master area */
float mfacts[LENGTH(tags) + 1]; /* mfacts per tag */
unsigned int sellts[LENGTH(tags) + 1]; /* selected layouts */
const Layout *ltidxs[LENGTH(tags) + 1][2]; /* matrix of tags and layouts indexes */
};
static pid_t *autostart_pids;
static size_t autostart_len;
@ -1403,7 +1403,7 @@ createmon(struct wl_listener *listener, void *data)
m->pertag = calloc(1, sizeof(Pertag));
m->pertag->curtag = m->pertag->prevtag = 1;
for (i = 0; i <= TAGCOUNT; i++) {
for (i = 0; i <= LENGTH(tags); i++) {
m->pertag->nmasters[i] = m->nmaster;
m->pertag->mfacts[i] = m->mfact;
@ -1738,7 +1738,7 @@ dwl_ipc_manager_bind(struct wl_client *client, void *data, uint32_t version, uin
}
wl_resource_set_implementation(manager_resource, &dwl_manager_implementation, NULL, dwl_ipc_manager_destroy);
zdwl_ipc_manager_v2_send_tags(manager_resource, TAGCOUNT);
zdwl_ipc_manager_v2_send_tags(manager_resource, LENGTH(tags));
for (unsigned int i = 0; i < LENGTH(layouts); i++)
zdwl_ipc_manager_v2_send_layout(manager_resource, layouts[i].symbol);
@ -1799,7 +1799,7 @@ dwl_ipc_output_printstatus_to(DwlIpcOutput *ipc_output)
focused = focustop(monitor);
zdwl_ipc_output_v2_send_active(ipc_output->resource, monitor == selmon);
for (tag = 0 ; tag < TAGCOUNT; tag++) {
for (tag = 0 ; tag < LENGTH(tags); tag++) {
numclients = state = focused_client = 0;
tagmask = 1 << tag;
if ((tagmask & monitor->tagset[monitor->seltags]) != 0)