diff options
-rw-r--r-- | config.h | 60 | ||||
-rw-r--r-- | drw.c | 2 | ||||
-rwxr-xr-x | dwm | bin | 74024 -> 74184 bytes | |||
-rw-r--r-- | dwm.c | 16 |
4 files changed, 47 insertions, 31 deletions
@@ -1,21 +1,21 @@ /* See LICENSE file for copyright and license details. */ /* Appearance. */ -static unsigned int borderpx = 5; /* border pixel of windows */ +static unsigned int borderpx = 8; /* border pixel of windows */ const static unsigned int snap= 48; /* snap pixel */ -static unsigned int gappx = 15; +static unsigned int gappx = 32; static const int swallowfloating = 1; /* Swallow floating windows by default. */ static const int showbar = 1; /* 0 means no bar */ static const int topbar = 1; /* 0 means bottom bar */ -static int sidepad = 15; -static int vertpad = 15; +static int sidepad = 0; +static int vertpad = 0; static char font[] = "Hack Nerd Font 12"; static char dmenufont[] = "Hack Nerd Font:size=12"; static char norm_bg_col[] = "#282828"; -static char norm_bor_col[] = "#282828"; +static char norm_bor_col[] = "#928374"; static char norm_fg_col[] = "#ebdbb2"; static char sel_bg_col[] = "#83a598"; @@ -67,16 +67,17 @@ ResourcePref resources[] = { /* Tags. */ static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; +/* Window rules. */ static const Rule rules[] = { /* xprop(1): * WM_CLASS(STRING) = instance, class * WM_NAME(STRING) = title */ - /* class instance title tags mask isfloating isterminal noswallow monitor */ - { "Gimp", NULL, NULL, 0, 1, 0, 0, -1 }, - { "Firefox", NULL, NULL, 1 << 8, 0, 0, -1, -1 }, - { "St", NULL, NULL, 0, 0, 1, 0, -1 }, - { NULL, NULL, "Event Tester", 0, 0, 0, 1, -1 }, /* xev */ + /* Class, instance, title, tags mask, isfloating, isterminal, noswallow, monitor. */ + { NULL, NULL, "Event Tester", 0, 0, 0, 1, -1 }, /* xev. */ + { "dolphin", NULL, NULL, 0, 1, 0, 0, -1 }, /* Dolphin. */ + { "firefox", NULL, "Picture-in-Picture", 0, 1, 0, 0, -1 }, /* Firefox PIP. */ + { "Alacritty", NULL, NULL, 0, 0, 1, 0, -1 }, /* Alacritty. */ }; /* Key definitions. */ @@ -92,17 +93,18 @@ static const Rule rules[] = { /* Commands. */ -#define SCRIPTS "/home/c/.local/bin/" +/* Scripts directory. */ +#define SCR "/home/c/.local/bin/" static char dmenumon[2] = "0"; /* Component of dmenucmd, manipulated in spawn(). */ static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, NULL }; -static const char *termcmd[] = { SCRIPTS "launchers/term.sh", NULL }; -static const char *webcmd[] = { SCRIPTS "launchers/web.sh", NULL }; -static const char *passcmd[] = { SCRIPTS "/sbin/passmenu", NULL }; -static const char *bmkscmd[] = { SCRIPTS "bmks", NULL }; -static const char *bmkaddcmd[]= { SCRIPTS "bmks", "dadd", NULL }; +static const char *termcmd[] = { SCR "launchers/term.sh", NULL }; +static const char *webcmd[] = { SCR "launchers/web.sh", NULL }; +static const char *passcmd[] = { SCR "/sbin/passmenu", NULL }; +static const char *bmkscmd[] = { SCR "bmks", NULL }; +static const char *bmkaddcmd[]= { SCR "bmks", "dadd", NULL }; -static const char *papercmd[] = { SCRIPTS "wallpaper.sh", NULL }; +static const char *papercmd[] = { SCR "wallpaper.sh", NULL }; #include "movestack.c" @@ -122,12 +124,14 @@ static const Key keys[] = { { MODKEY, XK_k, focusstack, {.i = -1 } }, { MODKEY|ShiftMask, XK_j, movestack, {.i = +1 } }, { MODKEY|ShiftMask, XK_k, movestack, {.i = -1 } }, - { MODKEY, XK_x, incnmaster, {.i = +1 } }, /* Increase the number of master windows. */ - { MODKEY, XK_z, incnmaster, {.i = -1 } }, /* Decrease the number of master windows. */ + { MODKEY, XK_z, incnmaster, {.i = +1 } }, /* Increase the number of master windows. */ + { MODKEY|ShiftMask, XK_z, incnmaster, {.i = -1 } }, /* Decrease the number of master windows. */ { MODKEY, XK_h, setmfact, {.f = -0.05} }, /* Increase master/stack ratio. */ { MODKEY, XK_l, setmfact, {.f = +0.05} }, /* Decrease master/stack ratio. */ { MODKEY, XK_q, killclient, {0} }, /* Kill active window. */ + { MODKEY, XK_x, movecenter, {0} }, /* Move window to center of screen. */ + /* Floating window navigation. */ { MODKEY, XK_Down, moveresize, {.v = (int []){ 0, snap, 0, 0 }} }, { MODKEY, XK_Up, moveresize, {.v = (int []){ 0, -snap, 0, 0 }} }, { MODKEY, XK_Right, moveresize, {.v = (int []){ snap, 0, 0, 0 }} }, @@ -173,20 +177,22 @@ static const Key keys[] = { { MODKEY|ShiftMask, XK_q, quit, {0} }, /* Quit dwm. */ /* Function keys. */ - { 0, 0x1008ff13, spawn, SHCMD("/home/c/.local/bin/setvol.sh i") }, /* Increase volume. */ - { 0, 0x1008ff11, spawn, SHCMD("/home/c/.local/bin/setvol.sh d") }, /* Decrease volume. */ - { 0, 0x1008ff12, spawn, SHCMD("/home/c/.local/bin/setvol.sh m") }, /* Toggle mute. */ + { 0, 0x1008ff13, spawn, SHCMD(SCR "setvol.sh i") }, /* Increase volume. */ + { 0, 0x1008ff11, spawn, SHCMD(SCR "setvol.sh d") }, /* Decrease volume. */ + { 0, 0x1008ff12, spawn, SHCMD(SCR "setvol.sh m") }, /* Toggle mute. */ + { 0, 0x1008ff02, spawn, SHCMD(SCR "setmon.sh i") }, /* Increase monitor brightness. */ + { 0, 0x1008ff03, spawn, SHCMD(SCR "setmon.sh d") }, /* Decrease monitor brightness. */ }; /* Button definitions. */ /* A click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin. */ static const Button buttons[] = { /* Click, mask, button, function, argument. */ - { ClkLtSymbol, 0, Button1, setlayout, {0} }, - { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, - { ClkWinTitle, 0, Button2, zoom, {0} }, - { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, - { ClkClientWin, MODKEY, Button1, movemouse, {0} }, + { ClkLtSymbol, 0, Button1, setlayout, {0} }, + { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, + { ClkWinTitle, 0, Button2, zoom, {0} }, + { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, + { ClkClientWin, MODKEY, Button1, movemouse, {0} }, { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, { ClkTagBar, 0, Button1, view, {0} }, @@ -124,6 +124,8 @@ drw_clr_create(Drw *drw, Clr *dest, const char *clrname) DefaultColormap(drw->dpy, drw->screen), clrname, dest)) die("error, cannot allocate color '%s'", clrname); + + dest->pixel |= 0xff << 24; /* Remove transparency for pixels on window borders. */ } /* Wrapper to create color schemes. The caller has to call free(3) on the Binary files differ@@ -218,6 +218,7 @@ static void monocle(Monitor *m); static void motionnotify(XEvent *e); static void movemouse(const Arg *arg); static void moveresize(const Arg *arg); +static void movecenter(const Arg * arg); static Client *nexttiled(Client *c); static void pop(Client *c); static void propertynotify(XEvent *e); @@ -1335,6 +1336,14 @@ movemouse(const Arg *arg) } } +void +movecenter(const Arg *arg) +{ + selmon->sel->x = selmon->sel->mon->mx + (selmon->sel->mon->mw - WIDTH(selmon->sel)) / 2; + selmon->sel->y = selmon->sel->mon->my + (selmon->sel->mon->mh - HEIGHT(selmon->sel)) / 2; + arrange(selmon); +} + Client * nexttiled(Client *c) { @@ -1488,7 +1497,6 @@ resizemouse(const Arg *arg) break; } } while (ev.type != ButtonRelease); - XUngrabPointer(dpy, CurrentTime); while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)); if ((m = recttomon(c->x, c->y, c->w, c->h)) != selmon) { @@ -1724,7 +1732,7 @@ setup(void) die("no fonts could be loaded."); lrpad = drw->font->h; bh = drw->font->h + 2; - sp = sidepad; + sp = sidepad; vp = (topbar == 1) ? vertpad : - vertpad; updategeom(); /* init atoms */ @@ -2515,7 +2523,7 @@ int main(int argc, char *argv[]) { if (argc == 2 && !strcmp("-v", argv[1])) - die("dwm-"VERSION); + die( "dwm-" VERSION ); else if (argc != 1) die("usage: dwm [-v]"); if (!setlocale(LC_CTYPE, "") || !XSupportsLocale()) @@ -2529,7 +2537,7 @@ main(int argc, char *argv[]) load_xresources(); setup(); #ifdef __OpenBSD__ -+ if (pledge("stdio rpath proc exec ps", NULL) == -1) + if (pledge("stdio rpath proc exec ps", NULL) == -1) die("pledge"); #endif /* __OpenBSD__ */ scan(); |