From: Georgios Atheridis Date: Sat, 11 Feb 2023 01:30:23 +0000 (+0000) Subject: Update personal config X-Git-Url: https://git.atheridis.org/?a=commitdiff_plain;h=0cacf143b36a9c1d5e93d7a3ab3b607e9fb2f9de;p=suckless%2Fdwm.git Update personal config Chnaged settings to more match my i3 theme. Also applied the attachbottom patch. --- diff --git a/config.def.h b/config.def.h index 9efa774..bd9d9e1 100644 --- a/config.def.h +++ b/config.def.h @@ -1,21 +1,21 @@ /* See LICENSE file for copyright and license details. */ +#include /* appearance */ static const unsigned int borderpx = 1; /* border pixel of windows */ static const unsigned int snap = 32; /* snap pixel */ static const int showbar = 1; /* 0 means no bar */ static const int topbar = 1; /* 0 means bottom bar */ -static const char *fonts[] = { "monospace:size=10" }; -static const char dmenufont[] = "monospace:size=10"; -static const char col_gray1[] = "#222222"; -static const char col_gray2[] = "#444444"; -static const char col_gray3[] = "#bbbbbb"; -static const char col_gray4[] = "#eeeeee"; -static const char col_cyan[] = "#005577"; +static const char *fonts[] = { "monospace:size=11" }; +static const char dmenufont[] = "monospace:size=11"; +static const char col_bg_sel[] = "#50a0e0"; +static const char col_fg_sel[] = "#000000"; +static const char col_fg_norm[] = "#d0d0ff"; +static const char col_bg_norm[] = "#505090"; static const char *colors[][3] = { - /* fg bg border */ - [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, - [SchemeSel] = { col_gray4, col_cyan, col_cyan }, + /* fg bg border */ + [SchemeNorm] = { col_fg_norm, col_bg_norm, col_bg_norm }, + [SchemeSel] = { col_fg_sel, col_bg_sel, col_bg_sel }, }; /* tagging */ @@ -27,8 +27,7 @@ static const Rule rules[] = { * WM_NAME(STRING) = title */ /* class instance title tags mask isfloating monitor */ - { "Gimp", NULL, NULL, 0, 1, -1 }, - { "Firefox", NULL, NULL, 1 << 8, 0, -1 }, + { "discord", NULL, NULL, 1 << 8, 0, 0 }, }; /* layout(s) */ @@ -39,13 +38,13 @@ static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen win static const Layout layouts[] = { /* symbol arrange function */ - { "[]=", tile }, /* first entry is default */ - { "><>", NULL }, /* no layout function means floating behavior */ + { "[T]", tile }, /* first entry is default */ + { "[F]", NULL }, /* no layout function means floating behavior */ { "[M]", monocle }, }; /* key definitions */ -#define MODKEY Mod1Mask +#define MODKEY Mod4Mask #define TAGKEYS(KEY,TAG) \ { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ @@ -57,23 +56,30 @@ static const Layout layouts[] = { /* commands */ static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ -static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; +static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_bg_norm, "-nf", col_fg_norm, "-sb", col_bg_sel, "-sf", col_fg_sel, NULL }; +static const char *roficmd[] = { "rofi", "-show", "drun" }; static const char *termcmd[] = { "st", NULL }; +static const char *lock[] = { "slock", NULL }; +static const char *screenshot[] = { "screenshot", NULL }; + +static const char *upvol[] = {"pactl", "set-sink-volume", "0", "+2%", NULL }; +static const char *downvol[] = {"pactl", "set-sink-volume", "0", "-2%", NULL }; +static const char *mutevol[] = {"pactl", "set-sink-mute", "0", "toggle", NULL }; static const Key keys[] = { /* modifier key function argument */ - { MODKEY, XK_p, spawn, {.v = dmenucmd } }, + { MODKEY, XK_d, spawn, {.v = roficmd } }, { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, { MODKEY, XK_b, togglebar, {0} }, { MODKEY, XK_j, focusstack, {.i = +1 } }, { MODKEY, XK_k, focusstack, {.i = -1 } }, - { MODKEY, XK_i, incnmaster, {.i = +1 } }, - { MODKEY, XK_d, incnmaster, {.i = -1 } }, + { MODKEY, XK_Next, incnmaster, {.i = +1 } }, + { MODKEY, XK_Prior, incnmaster, {.i = -1 } }, { MODKEY, XK_h, setmfact, {.f = -0.05} }, { MODKEY, XK_l, setmfact, {.f = +0.05} }, { MODKEY, XK_Return, zoom, {0} }, { MODKEY, XK_Tab, view, {0} }, - { MODKEY|ShiftMask, XK_c, killclient, {0} }, + { MODKEY|ShiftMask, XK_q, killclient, {0} }, { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, @@ -94,7 +100,12 @@ static const Key keys[] = { TAGKEYS( XK_7, 6) TAGKEYS( XK_8, 7) TAGKEYS( XK_9, 8) - { MODKEY|ShiftMask, XK_q, quit, {0} }, + { MODKEY|ShiftMask, XK_e, quit, {0} }, + { 0, XF86XK_AudioRaiseVolume, spawn, {.v = upvol} }, + { 0, XF86XK_AudioLowerVolume, spawn, {.v = downvol} }, + { 0, XF86XK_AudioMute, spawn, {.v = mutevol} }, + { MODKEY|ShiftMask, XK_s, spawn, {.v = screenshot} }, + { MODKEY, XK_x, spawn, {.v = lock} }, }; /* button definitions */ @@ -114,3 +125,4 @@ static const Button buttons[] = { { ClkTagBar, MODKEY, Button3, toggletag, {0} }, }; + diff --git a/dwm.c b/dwm.c index c2bd871..0cd882d 100644 --- a/dwm.c +++ b/dwm.c @@ -147,6 +147,7 @@ static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interac static void arrange(Monitor *m); static void arrangemon(Monitor *m); static void attach(Client *c); +static void attachbottom(Client *c); static void attachstack(Client *c); static void buttonpress(XEvent *e); static void checkotherwm(void); @@ -408,6 +409,15 @@ attach(Client *c) c->mon->clients = c; } +void +attachbottom(Client *c) +{ + Client **tc; + c->next = NULL; + for (tc = &c->mon->clients; *tc; tc = &(*tc)->next); + *tc = c; +} + void attachstack(Client *c) { @@ -1074,7 +1084,7 @@ manage(Window w, XWindowAttributes *wa) c->isfloating = c->oldstate = trans != None || c->isfixed; if (c->isfloating) XRaiseWindow(dpy, c->win); - attach(c); + attachbottom(c); attachstack(c); XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend, (unsigned char *) &(c->win), 1); @@ -1427,7 +1437,7 @@ sendmon(Client *c, Monitor *m) detachstack(c); c->mon = m; c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ - attach(c); + attachbottom(c); attachstack(c); focus(NULL); arrange(NULL); @@ -1907,7 +1917,7 @@ updategeom(void) m->clients = c->next; detachstack(c); c->mon = mons; - attach(c); + attachbottom(c); attachstack(c); } if (m == selmon)