Compare commits
1 commit
stachelbee
...
stachelbee
Author | SHA1 | Date | |
---|---|---|---|
a025839ba9 |
3 changed files with 45 additions and 46 deletions
70
config.h
70
config.h
|
@ -4,7 +4,7 @@
|
||||||
((hex >> 8) & 0xFF) / 255.0f, \
|
((hex >> 8) & 0xFF) / 255.0f, \
|
||||||
(hex & 0xFF) / 255.0f }
|
(hex & 0xFF) / 255.0f }
|
||||||
/* appearance */
|
/* appearance */
|
||||||
static const int sloppyfocus = 0; /* focus follows mouse */
|
static const int sloppyfocus = 1; /* focus follows mouse */
|
||||||
static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */
|
static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */
|
||||||
static const unsigned int borderpx = 1; /* border pixel of windows */
|
static const unsigned int borderpx = 1; /* border pixel of windows */
|
||||||
static const int draw_minimal_borders = 1; /* merge adjacent borders */
|
static const int draw_minimal_borders = 1; /* merge adjacent borders */
|
||||||
|
@ -16,20 +16,19 @@ 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 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 showbar = 1; /* 0 means no bar */
|
||||||
static const int topbar = 1; /* 0 means bottom bar */
|
static const int topbar = 1; /* 0 means bottom bar */
|
||||||
static const char *fonts[] = {"monospace:size=12", "NotoSansM Nerd Font Mono:size=12"};
|
static const char *fonts[] = {"monospace:size=12", "NotoSansM NFM SemBd"};
|
||||||
static const float rootcolor[] = COLOR(0x6495eded);
|
static const float rootcolor[] = COLOR(0x6495eded);
|
||||||
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
|
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
|
||||||
static uint32_t colors[][3] = {
|
static uint32_t colors[][3] = {
|
||||||
/* fg bg border */
|
/* fg bg border */
|
||||||
[SchemeNorm] = { 0xB33A25ff, 0x000000c0, 0x176815ff },
|
[SchemeNorm] = { 0xDA651Dff, 0x000000c0, 0x176815ff },
|
||||||
[SchemeSel] = { 0xDA651Dff, 0x00000050, 0x8FC711ff },
|
[SchemeSel] = { 0xB33A25ff, 0x00000050, 0x8FC711ff },
|
||||||
[SchemeUrg] = { 0, 0, 0xffaaaaff },
|
[SchemeUrg] = { 0, 0, 0xffaaaaff },
|
||||||
};
|
};
|
||||||
|
|
||||||
enum Direction { DIR_LEFT, DIR_RIGHT, DIR_UP, DIR_DOWN };
|
enum Direction { DIR_LEFT, DIR_RIGHT, DIR_UP, DIR_DOWN };
|
||||||
/* tagging - TAGCOUNT must be no greater than 31 */
|
/* tagging - TAGCOUNT must be no greater than 31 */
|
||||||
static char *tags[] = { "", "1", "2", "3", "\uf120", "\uf4ed", "\ueb11" };
|
static char *tags[] = { "", "1", "2", "3", "", "", "\ueb11" };
|
||||||
#define TAGCOUNT (sizeof(tags) / sizeof(tags[0]))
|
|
||||||
|
|
||||||
/* logging */
|
/* logging */
|
||||||
static int log_level = WLR_ERROR;
|
static int log_level = WLR_ERROR;
|
||||||
|
@ -39,6 +38,7 @@ static const char *const autostart[] = {
|
||||||
"wbg", "/home/stachel/.desktop/wallpaper", NULL,
|
"wbg", "/home/stachel/.desktop/wallpaper", NULL,
|
||||||
"vesktop", NULL,
|
"vesktop", NULL,
|
||||||
"foot", "--term", "xterm-256color", NULL,
|
"foot", "--term", "xterm-256color", NULL,
|
||||||
|
"keepassxc", NULL,
|
||||||
NULL /* terminate */
|
NULL /* terminate */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -47,19 +47,19 @@ static const char *const autostart[] = {
|
||||||
static const Rule rules[] = {
|
static const Rule rules[] = {
|
||||||
|
|
||||||
/* app_id title tags mask isfloating skipfocus isterm noswallow monitor */
|
/* 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 */
|
{ "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) */
|
/* layout(s) */
|
||||||
static const Layout layouts[] = {
|
static const Layout layouts[] = {
|
||||||
/* symbol arrange function */
|
/* symbol arrange function */
|
||||||
{ "[+]", btrtile },
|
{ "|w|", btrtile },
|
||||||
{ "[]=", tile },
|
{ "[]=", tile },
|
||||||
{ "><>", NULL }, /* no layout function means floating behavior */
|
//{ "><>", NULL }, /* no layout function means floating behavior */
|
||||||
//{ "[M]", monocle },
|
//{ "[M]", monocle },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* monitors */
|
/* monitors */
|
||||||
|
@ -88,8 +88,8 @@ static const struct xkb_rule_names xkb_rules = {
|
||||||
.variant = "nodeadkeys"
|
.variant = "nodeadkeys"
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int repeat_rate = 25;
|
static const int repeat_rate = -1;
|
||||||
static const int repeat_delay = 600;
|
static const int repeat_delay = 0;
|
||||||
|
|
||||||
/* Trackpad */
|
/* Trackpad */
|
||||||
static const int tap_to_click = 1;
|
static const int tap_to_click = 1;
|
||||||
|
@ -146,14 +146,14 @@ static const int cursor_timeout = 1;
|
||||||
{ MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT,KEY,toggletag, {.ui = 1 << TAG} }
|
{ MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT,KEY,toggletag, {.ui = 1 << TAG} }
|
||||||
|
|
||||||
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
|
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
|
||||||
#define SHCMD(cmd) { .v = (const char*[]){ "yash", "-c", cmd, NULL } }
|
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
||||||
|
|
||||||
/* commands */
|
/* commands */
|
||||||
static const char *termcmd[] = { "foot", "--term", "xterm-256color", NULL };
|
static const char *termcmd[] = { "foot", "--term", "xterm-256color", NULL };
|
||||||
static const char *menucmd[] = { "mew-run", NULL };
|
static const char *menucmd[] = { "mew-run", NULL };
|
||||||
static const char *upvol[] = { "pactl", "set-sink-volume", "@DEFAULT_SINK@", "+1%", 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 *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 *playpause[] = { "playerctl", "play-pause", NULL };
|
||||||
static const char *nextTrack[] = { "playerctl", "next", NULL };
|
static const char *nextTrack[] = { "playerctl", "next", NULL };
|
||||||
static const char *prevTrack[] = { "playerctl", "previous", NULL };
|
static const char *prevTrack[] = { "playerctl", "previous", NULL };
|
||||||
|
@ -165,7 +165,7 @@ static const Key keys[] = {
|
||||||
{ MODKEY, Key_Return, spawn, {.v = termcmd} },
|
{ MODKEY, Key_Return, spawn, {.v = termcmd} },
|
||||||
{ 0, Key_XF86AudioRaiseVolume, spawn, {.v = upvol } },
|
{ 0, Key_XF86AudioRaiseVolume, spawn, {.v = upvol } },
|
||||||
{ 0, Key_XF86AudioLowerVolume, spawn, {.v = downvol } },
|
{ 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_XF86AudioPlay, spawn, {.v = playpause } },
|
||||||
{ 0, Key_XF86AudioNext, spawn, {.v = nextTrack } },
|
{ 0, Key_XF86AudioNext, spawn, {.v = nextTrack } },
|
||||||
{ 0, Key_XF86AudioPrev, spawn, {.v = prevTrack } },
|
{ 0, Key_XF86AudioPrev, spawn, {.v = prevTrack } },
|
||||||
|
@ -185,29 +185,27 @@ static const Key keys[] = {
|
||||||
{ MODKEY|WLR_MODIFIER_SHIFT, Key_q, killclient, {0} },
|
{ MODKEY|WLR_MODIFIER_SHIFT, Key_q, killclient, {0} },
|
||||||
{ MODKEY, Key_w, setlayout, {.v = &layouts[0]} },
|
{ MODKEY, Key_w, setlayout, {.v = &layouts[0]} },
|
||||||
{ MODKEY, Key_t, setlayout, {.v = &layouts[1]} },
|
{ MODKEY, Key_t, setlayout, {.v = &layouts[1]} },
|
||||||
{ MODKEY, Key_f, setlayout, {.v = &layouts[2]} },
|
//{ MODKEY, Key_f, setlayout, {.v = &layouts[2]} },
|
||||||
{ MODKEY, Key_space, setlayout, {0} },
|
//{ MODKEY, Key_space, setlayout, {0} },
|
||||||
{ MODKEY|WLR_MODIFIER_SHIFT, Key_space, togglefloating, {0} },
|
{ MODKEY|WLR_MODIFIER_SHIFT, Key_space, togglefloating, {0} },
|
||||||
{ MODKEY, Key_e, togglefullscreen, {0} },
|
{ MODKEY, Key_e, togglefullscreen, {0} },
|
||||||
{ MODKEY, Key_0, view, {.ui = ~0} },
|
{ MODKEY, Key_0, view, {.ui = ~0} },
|
||||||
{ MODKEY|WLR_MODIFIER_SHIFT, Key_0, tag, {.ui = ~0} },
|
{ MODKEY|WLR_MODIFIER_SHIFT, Key_0, tag, {.ui = ~0} },
|
||||||
{ MODKEY, Key_comma, focusmon, {.i = WLR_DIRECTION_LEFT} },
|
//{ MODKEY, Key_comma, focusmon, {.i = WLR_DIRECTION_LEFT} },
|
||||||
{ MODKEY, Key_period, focusmon, {.i = WLR_DIRECTION_RIGHT} },
|
//{ MODKEY, Key_period, focusmon, {.i = WLR_DIRECTION_RIGHT} },
|
||||||
{ MODKEY|WLR_MODIFIER_SHIFT, Key_comma, tagmon, {.i = WLR_DIRECTION_LEFT} },
|
//{ 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_SHIFT, Key_period, tagmon, {.i = WLR_DIRECTION_RIGHT} },
|
||||||
{ MODKEY|WLR_MODIFIER_CTRL, Key_Right, setratio_h, {.f = +0.025f} },
|
{ 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_Left, setratio_h, {.f = -0.025f} },
|
||||||
{ MODKEY|WLR_MODIFIER_CTRL, Key_Up, setratio_v, {.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} },
|
{ MODKEY|WLR_MODIFIER_CTRL, Key_Down, setratio_v, {.f = +0.025f} },
|
||||||
TAGKEYS( Key_1, 0),
|
TAGKEYS( Key_grave, 0),
|
||||||
TAGKEYS( Key_2, 1),
|
TAGKEYS( Key_1, 1),
|
||||||
TAGKEYS( Key_3, 2),
|
TAGKEYS( Key_2, 2),
|
||||||
TAGKEYS( Key_4, 3),
|
TAGKEYS( Key_3, 3),
|
||||||
TAGKEYS( Key_5, 4),
|
TAGKEYS( Key_4, 4),
|
||||||
TAGKEYS( Key_6, 5),
|
TAGKEYS( Key_5, 5),
|
||||||
TAGKEYS( Key_7, 6),
|
TAGKEYS( Key_6, 6),
|
||||||
// TAGKEYS( Key_8, 7),
|
|
||||||
// TAGKEYS( Key_9, 8),
|
|
||||||
{ MODKEY|WLR_MODIFIER_SHIFT, Key_e, quit, {0} },
|
{ MODKEY|WLR_MODIFIER_SHIFT, Key_e, quit, {0} },
|
||||||
|
|
||||||
/* Ctrl-Alt-Backspace and Ctrl-Alt-Fx used to be handled by X server */
|
/* Ctrl-Alt-Backspace and Ctrl-Alt-Fx used to be handled by X server */
|
||||||
|
@ -222,10 +220,10 @@ static const Key keys[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const Button buttons[] = {
|
static const Button buttons[] = {
|
||||||
{ ClkLtSymbol, 0, BTN_LEFT, setlayout, {.v = &layouts[0]} },
|
//{ ClkLtSymbol, 0, BTN_LEFT, setlayout, {.v = &layouts[0]} },
|
||||||
{ ClkLtSymbol, 0, BTN_RIGHT, setlayout, {.v = &layouts[2]} },
|
//{ ClkLtSymbol, 0, BTN_RIGHT, setlayout, {.v = &layouts[1]} },
|
||||||
{ ClkTitle, 0, BTN_MIDDLE, zoom, {0} },
|
//{ ClkTitle, 0, BTN_MIDDLE, zoom, {0} },
|
||||||
{ ClkStatus, 0, BTN_MIDDLE, spawn, {.v = termcmd} },
|
//{ ClkStatus, 0, BTN_MIDDLE, spawn, {.v = termcmd} },
|
||||||
{ ClkClient, MODKEY, BTN_LEFT, moveresize, {.ui = CurMove} },
|
{ ClkClient, MODKEY, BTN_LEFT, moveresize, {.ui = CurMove} },
|
||||||
{ ClkClient, MODKEY, BTN_MIDDLE, togglefloating, {0} },
|
{ ClkClient, MODKEY, BTN_MIDDLE, togglefloating, {0} },
|
||||||
{ ClkClient, MODKEY, BTN_RIGHT, moveresize, {.ui = CurResize} },
|
{ ClkClient, MODKEY, BTN_RIGHT, moveresize, {.ui = CurResize} },
|
||||||
|
|
|
@ -13,5 +13,6 @@ XLIBS =
|
||||||
# Uncomment to build XWayland support
|
# Uncomment to build XWayland support
|
||||||
XWAYLAND = -DXWAYLAND
|
XWAYLAND = -DXWAYLAND
|
||||||
XLIBS = xcb xcb-icccm
|
XLIBS = xcb xcb-icccm
|
||||||
|
CC = gcc
|
||||||
CC = gcc
|
CFLAGS = -O3 -march=native -Wall -Wextra -flto -s
|
||||||
|
LDFLAGS += -flto
|
||||||
|
|
16
dwl.c
16
dwl.c
|
@ -540,10 +540,10 @@ static xcb_atom_t netatom[NetLast];
|
||||||
|
|
||||||
struct Pertag {
|
struct Pertag {
|
||||||
unsigned int curtag, prevtag; /* current and previous tag */
|
unsigned int curtag, prevtag; /* current and previous tag */
|
||||||
int nmasters[TAGCOUNT + 1]; /* number of windows in master area */
|
int nmasters[LENGTH(tags) + 1]; /* number of windows in master area */
|
||||||
float mfacts[TAGCOUNT + 1]; /* mfacts per tag */
|
float mfacts[LENGTH(tags) + 1]; /* mfacts per tag */
|
||||||
unsigned int sellts[TAGCOUNT + 1]; /* selected layouts */
|
unsigned int sellts[LENGTH(tags) + 1]; /* selected layouts */
|
||||||
const Layout *ltidxs[TAGCOUNT + 1][2]; /* matrix of tags and layouts indexes */
|
const Layout *ltidxs[LENGTH(tags) + 1][2]; /* matrix of tags and layouts indexes */
|
||||||
};
|
};
|
||||||
static pid_t *autostart_pids;
|
static pid_t *autostart_pids;
|
||||||
static size_t autostart_len;
|
static size_t autostart_len;
|
||||||
|
@ -1403,7 +1403,7 @@ createmon(struct wl_listener *listener, void *data)
|
||||||
m->pertag = calloc(1, sizeof(Pertag));
|
m->pertag = calloc(1, sizeof(Pertag));
|
||||||
m->pertag->curtag = m->pertag->prevtag = 1;
|
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->nmasters[i] = m->nmaster;
|
||||||
m->pertag->mfacts[i] = m->mfact;
|
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);
|
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++)
|
for (unsigned int i = 0; i < LENGTH(layouts); i++)
|
||||||
zdwl_ipc_manager_v2_send_layout(manager_resource, layouts[i].symbol);
|
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);
|
focused = focustop(monitor);
|
||||||
zdwl_ipc_output_v2_send_active(ipc_output->resource, monitor == selmon);
|
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;
|
numclients = state = focused_client = 0;
|
||||||
tagmask = 1 << tag;
|
tagmask = 1 << tag;
|
||||||
if ((tagmask & monitor->tagset[monitor->seltags]) != 0)
|
if ((tagmask & monitor->tagset[monitor->seltags]) != 0)
|
||||||
|
@ -1981,7 +1981,7 @@ drawbar(Monitor *m)
|
||||||
|
|
||||||
if ((w = m->b.width - tw - x) > m->b.height) {
|
if ((w = m->b.width - tw - x) > m->b.height) {
|
||||||
if (c) {
|
if (c) {
|
||||||
drwl_setscheme(m->drw, colors[SchemeNorm]);
|
drwl_setscheme(m->drw, colors[m == selmon ? SchemeSel : SchemeNorm]);
|
||||||
drwl_text(m->drw, x, 0, w, m->b.height, m->lrpad / 2, client_get_title(c), 0);
|
drwl_text(m->drw, x, 0, w, m->b.height, m->lrpad / 2, client_get_title(c), 0);
|
||||||
if (c && c->isfloating)
|
if (c && c->isfloating)
|
||||||
drwl_rect(m->drw, x + boxs, boxs, boxw, boxw, 0, 0);
|
drwl_rect(m->drw, x + boxs, boxs, boxw, boxw, 0, 0);
|
||||||
|
|
Loading…
Add table
Reference in a new issue