diff options
| author | ozpv <39195175+ozpv@users.noreply.github.com> | 2021-08-15 18:58:55 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-15 18:58:55 -0500 |
| commit | 1b8bc13ae08363008558b99973c2b33cbb207433 (patch) | |
| tree | d28622cf1e0981f5c79f933909172747b0211970 | |
| parent | eeee0425bfe73c3056018af8dacd04da780da6f3 (diff) | |
commit
| -rw-r--r-- | config.h | 40 | ||||
| -rw-r--r-- | dwm.c | 51 |
2 files changed, 26 insertions, 65 deletions
@@ -11,7 +11,7 @@ static const int usealtbar = 0; /* 1 means use non-dwm status ba static const char *altbarclass = "Polybar";/* Alternate bar class name */ static const char *alttrayname = "tray"; /* Polybar tray instance name */ static const char *altbarcmd = ""; /* Alternate bar launch command */ -static const char *fonts[] = { "FiraCode-Regular:size=10", "fontawesome:size=10" }; +static const char *fonts[] = {"FiraCode-Regular:size=10", "fontawesome:size=10", "Iosevka Nerd Font:size=10"}; static const char dmenufont[] = "FiraCode-Regular:size=10"; static const char col_gray1[] = "#282828"; static const char col_gray2[] = "#928374"; @@ -65,39 +65,50 @@ 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 *dmenunmcmd[] = { "networkmanager_dmenu", NULL }; static const char *termcmd[] = { "st", NULL }; static const char *browsercmd[] = { "firefox", NULL }; +static const char *volup[] = { "amixer", "set", "Master", "10%+", NULL }; +static const char *voldown[] = { "amixer", "set", "Master", "10%-", NULL }; +static const char *volmute[] = { "amixer", "set", "Master", "0%", NULL }; static Key keys[] = { /* modifier key function argument */ { MODKEY, XK_space, spawn, {.v = dmenucmd } }, + { MODKEY|ShiftMask, XK_space, spawn, {.v = dmenunmcmd } }, { MODKEY, XK_a, spawn, {.v = termcmd } }, { MODKEY, XK_f, spawn, {.v = browsercmd } }, + { MODKEY, XK_j, spawn, {.v = volup } }, + { MODKEY, XK_k, spawn, {.v = voldown } }, + { MODKEY, XK_l, spawn, {.v = volmute } }, + { 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_h, setmfact, {.f = -0.05} }, - { MODKEY, XK_l, setmfact, {.f = +0.05} }, - { MODKEY, XK_Return, zoom, {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_h, setmfact, {.f = -0.05} }, + //{ MODKEY, XK_l, setmfact, {.f = +0.05} }, + //{ MODKEY, XK_Return, zoom, {0} }, { MODKEY, XK_Tab, view, {0} }, { MODKEY, XK_w, killclient, {0} }, { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, - { MODKEY, XK_o, setlayout, {.v = &layouts[1]} }, - { MODKEY|ShiftMask, XK_m, setlayout, {.v = &layouts[2]} }, + //{ MODKEY, XK_o, setlayout, {.v = &layouts[1]} }, + //{ MODKEY|ShiftMask, XK_m, setlayout, {.v = &layouts[2]} }, { MODKEY, XK_m, fullscreen, {0} }, - { MODKEY, XK_p, setlayout, {0} }, - { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, - { MODKEY, XK_0, view, {.ui = ~0 } }, - { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, + //{ MODKEY, XK_p, setlayout, {0} }, + { MODKEY|ShiftMask, XK_f, togglefloating, {0} }, + //{ MODKEY, XK_0, view, {.ui = ~0 } }, + //{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, { MODKEY, XK_comma, focusmon, {.i = -1 } }, { MODKEY, XK_period, focusmon, {.i = +1 } }, { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, + { MODKEY, XK_minus, setgaps, {.i = -1 } }, { MODKEY, XK_equal, setgaps, {.i = +1 } }, { MODKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } }, + TAGKEYS( XK_1, 0) TAGKEYS( XK_2, 1) TAGKEYS( XK_3, 2) @@ -107,6 +118,7 @@ static Key keys[] = { TAGKEYS( XK_7, 6) TAGKEYS( XK_8, 7) TAGKEYS( XK_9, 8) + { MODKEY|ShiftMask, XK_q, quit, {0} }, }; @@ -171,13 +171,11 @@ static void expose(XEvent *e); static void focus(Client *c); static void focusin(XEvent *e); static void focusmon(const Arg *arg); -static void focusstack(const Arg *arg); static int getrootptr(int *x, int *y); static long getstate(Window w); static int gettextprop(Window w, Atom atom, char *text, unsigned int size); static void grabbuttons(Client *c, int focused); static void grabkeys(void); -static void incnmaster(const Arg *arg); static void keypress(XEvent *e); static void killclient(const Arg *arg); static void manage(Window w, XWindowAttributes *wa); @@ -208,7 +206,6 @@ static void setfullscreen(Client *c, int fullscreen); static void fullscreen(const Arg *arg); static void setgaps(const Arg *arg); static void setlayout(const Arg *arg); -static void setmfact(const Arg *arg); static void setup(void); static void seturgent(Client *c, int urg); static void showhide(Client *c); @@ -853,32 +850,6 @@ focusmon(const Arg *arg) focus(NULL); } -void -focusstack(const Arg *arg) -{ - Client *c = NULL, *i; - - if (!selmon->sel) - return; - if (arg->i > 0) { - for (c = selmon->sel->next; c && !ISVISIBLE(c); c = c->next); - if (!c) - for (c = selmon->clients; c && !ISVISIBLE(c); c = c->next); - } else { - for (i = selmon->clients; i != selmon->sel; i = i->next) - if (ISVISIBLE(i)) - c = i; - if (!c) - for (; i; i = i->next) - if (ISVISIBLE(i)) - c = i; - } - if (c) { - focus(c); - restack(selmon); - } -} - Atom getatomprop(Client *c, Atom prop) { @@ -987,13 +958,6 @@ grabkeys(void) } } -void -incnmaster(const Arg *arg) -{ - selmon->nmaster = MAX(selmon->nmaster + arg->i, 0); - arrange(selmon); -} - #ifdef XINERAMA static int isuniquegeom(XineramaScreenInfo *unique, size_t n, XineramaScreenInfo *info) @@ -1626,21 +1590,6 @@ setlayout(const Arg *arg) drawbar(selmon); } -/* arg > 1.0 will set mfact absolutely */ -void -setmfact(const Arg *arg) -{ - float f; - - if (!arg || !selmon->lt[selmon->sellt]->arrange) - return; - f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0; - if (f < 0.1 || f > 0.9) - return; - selmon->mfact = f; - arrange(selmon); -} - void setup(void) { |
