2021-06-19 15:05:17 +02:00
|
|
|
/* See LICENSE file for copyright and license details. */
|
|
|
|
|
|
|
|
/* appearance */
|
|
|
|
static const unsigned int borderpx = 2; /* border pixel of windows */
|
|
|
|
static const int startwithgaps = 1; /* 1 means gaps are used by default */
|
|
|
|
static const unsigned int gappx = 15; /* default gap between windows in pixels */
|
|
|
|
static const unsigned int snap = 32; /* snap pixel */
|
|
|
|
static const int swallowfloating = 1; /* 1 means swallow floating windows by default */
|
|
|
|
static const unsigned int systraypinning = 0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */
|
|
|
|
static const unsigned int systrayonleft = 0; /* 0: systray in the right corner, >0: systray on left of status text */
|
|
|
|
static const unsigned int systrayspacing = 2; /* systray spacing */
|
|
|
|
static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor*/
|
|
|
|
static const int showsystray = 1; /* 0 means no systray */
|
|
|
|
static const int showbar = 1; /* 0 means no bar */
|
|
|
|
static const int topbar = 1; /* 0 means bottom bar */
|
2021-07-26 15:56:06 +02:00
|
|
|
static const char *fonts[] = { "JetBrainsMono Nerd Font Mono:style=Medium:size=10", "Material Icons:size=12" };
|
2021-06-19 15:05:17 +02:00
|
|
|
static const char normfgcolor[] = "#bbbbbb";
|
|
|
|
static const char col_gray1[] = "#222222";
|
|
|
|
static const char col_gray2[] = "#444444";
|
|
|
|
static const char col_gray3[] = "#bbbbbb";
|
|
|
|
static const char col_gray4[] = "#eeeeee";
|
2021-07-26 18:18:27 +02:00
|
|
|
static const char col_cyan[] = "#005577";
|
2021-06-19 15:05:17 +02:00
|
|
|
static const char *colors[][3] = {
|
2021-07-09 20:29:44 +02:00
|
|
|
/* fg bg border */
|
|
|
|
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
|
2021-08-23 00:48:02 +02:00
|
|
|
[SchemeSel] = { col_gray4, col_cyan, col_cyan },
|
2021-06-19 15:05:17 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct {
|
2021-07-09 20:29:44 +02:00
|
|
|
const char *name;
|
|
|
|
const void *cmd;
|
2021-06-19 15:05:17 +02:00
|
|
|
} Sp;
|
2021-10-10 16:52:52 +02:00
|
|
|
const char *spcmd1[] = {"st", "-n", "spterm", "-g", "120x34", NULL };
|
2021-06-19 15:05:17 +02:00
|
|
|
static Sp scratchpads[] = {
|
2021-07-09 20:29:44 +02:00
|
|
|
/* name cmd */
|
|
|
|
{"spterm", spcmd1},
|
2021-06-19 15:05:17 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/* tagging */
|
2021-07-26 16:43:47 +02:00
|
|
|
static const char *tags[] = {"\ue9ef", "\ue894", "\ue0c9", "\ue0e1", "\ue3fe", "\ue3ff", "7", "8", "\ue943", "\uea67" };
|
2021-06-19 15:05:17 +02:00
|
|
|
|
|
|
|
static const Rule rules[] = {
|
|
|
|
/* xprop(1):
|
|
|
|
* WM_CLASS(STRING) = instance, class
|
|
|
|
* WM_NAME(STRING) = title
|
|
|
|
*/
|
2021-10-11 23:33:30 +02:00
|
|
|
/* class instance title tags mask isfloating isterminal noswallow monitor */
|
|
|
|
{ NULL, NULL, "st", 0, 0, 1, 0, -1 },
|
|
|
|
{ "Firefox", NULL, NULL, 2, 0, 0, 0, -1 },
|
|
|
|
{ "qutebrowser", NULL, NULL, 2, 0, 0, 0, -1 },
|
|
|
|
{ "Ferdi" , NULL, NULL, 1 << 2, 0, 0, 0, -1 },
|
|
|
|
{ NULL, "mutt", NULL, 1 << 3, 0, 1, 1, -1 },
|
|
|
|
{ NULL, "nnn", NULL, 1 << 4, 0, 1, 1, -1 },
|
|
|
|
{ NULL, NULL, "Citrix Workspace", 1 << 8, 0, 0, 0, -1 },
|
|
|
|
{ "Wfica", NULL, NULL, 1 << 9, 0, 0, 0, -1 },
|
|
|
|
{ NULL, NULL, "Event Tester", 0, 0, 0, 1, -1 }, /* xev */
|
|
|
|
{ NULL, "spterm", NULL, SPTAG(0), 1, 1, 0, -1 },
|
2021-06-19 15:05:17 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/* layout(s) */
|
|
|
|
static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
|
|
|
|
static const int nmaster = 1; /* number of clients in master area */
|
2021-06-21 00:48:06 +02:00
|
|
|
static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */
|
2021-06-19 15:05:17 +02:00
|
|
|
static const int attachbelow = 1; /* 1 means attach after the currently active window */
|
|
|
|
|
|
|
|
static const Layout layouts[] = {
|
2021-07-09 20:29:44 +02:00
|
|
|
/* symbol arrange function */
|
2021-07-26 18:23:26 +02:00
|
|
|
{ "\ue9b0", tile }, /* first entry is default */
|
2021-07-09 20:29:44 +02:00
|
|
|
{ "><>", NULL }, /* no layout function means floating behavior */
|
|
|
|
{ "[M]", monocle },
|
2021-06-19 15:05:17 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/* key definitions */
|
|
|
|
#define MODKEY Mod4Mask
|
|
|
|
#define SHTKEY (Mod4Mask|ShiftMask)
|
2021-07-07 16:24:05 +02:00
|
|
|
#define CTRKEY (Mod4Mask|ControlMask)
|
2021-06-19 15:05:17 +02:00
|
|
|
#define ALLKEY (Mod4Mask|ShiftMask|ControlMask)
|
|
|
|
#define TAGKEYS(KEY,TAG) \
|
2021-07-09 20:29:44 +02:00
|
|
|
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
|
|
|
|
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
|
|
|
|
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
|
|
|
|
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
|
2021-06-19 15:05:17 +02:00
|
|
|
|
|
|
|
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
|
|
|
|
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
|
|
|
|
|
|
|
/* commands */
|
2021-10-10 16:52:52 +02:00
|
|
|
static const char *termcmd[] = { "st", NULL };
|
2021-06-19 15:05:17 +02:00
|
|
|
|
|
|
|
#include <X11/XF86keysym.h>
|
|
|
|
|
|
|
|
static Key keys[] = {
|
|
|
|
/* modifier key function argument */
|
2021-07-09 20:29:44 +02:00
|
|
|
TAGKEYS( XK_1, 0)
|
2021-07-26 16:43:47 +02:00
|
|
|
TAGKEYS( XK_2, 1)
|
|
|
|
TAGKEYS( XK_3, 2)
|
|
|
|
TAGKEYS( XK_4, 3)
|
|
|
|
TAGKEYS( XK_5, 4)
|
|
|
|
TAGKEYS( XK_6, 5)
|
|
|
|
TAGKEYS( XK_7, 6)
|
|
|
|
TAGKEYS( XK_8, 7)
|
|
|
|
TAGKEYS( XK_9, 8)
|
|
|
|
TAGKEYS( XK_0, 9)
|
|
|
|
/* apps n'shit */
|
|
|
|
{ MODKEY, XK_Return, spawn, {.v = termcmd } },
|
2021-10-08 00:58:07 +02:00
|
|
|
{ MODKEY, XK_space, spawn, SHCMD("dmenu_run") },
|
2021-08-22 20:58:15 +02:00
|
|
|
{ MODKEY, XK_f, spawn, SHCMD("st -n nnn -e nnn -de") },
|
2021-08-26 12:11:08 +02:00
|
|
|
{ MODKEY, XK_i, spawn, SHCMD("scrot -f -s 'scrot_%Y-%m-%d_%H-%M-%S_%s.png'") },
|
2021-07-26 16:43:47 +02:00
|
|
|
{ SHTKEY, XK_i, spawn, SHCMD("scrot 'scrot_%Y-%m-%d_%H-%M-%S_%s.png'") },
|
2021-08-28 10:45:45 +02:00
|
|
|
{ MODKEY, XK_m, spawn, SHCMD("pgrep -x neomutt > /dev/null || st -n mutt -e neomutt") },
|
2021-07-26 16:43:47 +02:00
|
|
|
{ MODKEY, XK_q, killclient, {0} },
|
|
|
|
{ MODKEY, XK_e, togglescratch, {.ui = 0 } },
|
|
|
|
/* service controls */
|
2021-08-23 20:25:41 +02:00
|
|
|
{ CTRKEY, XK_a, spawn, SHCMD("dmenu-audio") },
|
2021-08-23 00:35:19 +02:00
|
|
|
{ CTRKEY, XK_b, spawn, SHCMD("dmenu-bluetooth") },
|
|
|
|
{ CTRKEY, XK_d, spawn, SHCMD("dmenu-display") },
|
2021-10-08 00:58:07 +02:00
|
|
|
{ CTRKEY, XK_e, spawn, SHCMD("dmenu-emoji") },
|
2021-09-20 18:04:52 +02:00
|
|
|
{ CTRKEY, XK_l, spawn, SHCMD("physlock") },
|
2021-07-26 16:43:47 +02:00
|
|
|
/* window controls */
|
|
|
|
{ SHTKEY, XK_m, zoom, {0} },
|
|
|
|
{ SHTKEY, XK_h, setmfact, {.f = -0.05} },
|
|
|
|
{ SHTKEY, XK_l, setmfact, {.f = +0.05} },
|
2021-10-10 00:45:52 +02:00
|
|
|
{ SHTKEY, XK_j, focusstack, {.i = -1 } },
|
|
|
|
{ SHTKEY, XK_k, focusstack, {.i = 11 } },
|
2021-07-26 16:43:47 +02:00
|
|
|
{ SHTKEY, XK_f, togglefloating, {0} },
|
|
|
|
{ SHTKEY, XK_equal, incnmaster, {.i = +1 } },
|
|
|
|
{ SHTKEY, XK_minus, incnmaster, {.i = -1 } },
|
|
|
|
/* main dwm controls */
|
|
|
|
{ ALLKEY, XK_b, togglebar, {0} },
|
|
|
|
{ ALLKEY, XK_g, setgaps, {.i = GAP_TOGGLE} },
|
|
|
|
{ ALLKEY, XK_f, setlayout, {.v = &layouts[1]} },
|
|
|
|
{ ALLKEY, XK_t, setlayout, {.v = &layouts[0]} },
|
|
|
|
{ ALLKEY, XK_r, quit, {1} },
|
|
|
|
{ ALLKEY, XK_q, quit, {0} },
|
|
|
|
/* only to avoid warnings */
|
|
|
|
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
|
|
|
|
{ MODKEY, XK_period, focusmon, {.i = +1 } },
|
|
|
|
{ SHTKEY, XK_comma, tagmon, {.i = -1 } },
|
|
|
|
{ SHTKEY, XK_period, tagmon, {.i = +1 } },
|
2021-08-23 20:25:41 +02:00
|
|
|
{ 0, XF86XK_AudioMute, spawn, SHCMD("pactl set-sink-mute @DEFAULT_SINK@ toggle; kill -46 $(pidof dwmblocks)") },
|
2021-08-02 18:28:20 +02:00
|
|
|
{ 0, XF86XK_AudioMicMute, spawn, SHCMD("sb-volume micmute") },
|
2021-08-23 20:25:41 +02:00
|
|
|
{ 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("pactl set-sink-volume @DEFAULT_SINK@ +5%; kill -46 $(pidof dwmblocks)") },
|
|
|
|
{ 0, XF86XK_AudioLowerVolume, spawn, SHCMD("pactl set-sink-volume @DEFAULT_SINK@ -5%; kill -46 $(pidof dwmblocks)") },
|
2021-09-20 20:10:21 +02:00
|
|
|
{ 0, XF86XK_MonBrightnessUp, spawn, SHCMD("doas xbacklight -inc 10") },
|
|
|
|
{ 0, XF86XK_MonBrightnessDown, spawn, SHCMD("doas xbacklight -dec 10") },
|
2021-06-19 15:05:17 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/* button definitions */
|
|
|
|
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
|
|
|
|
static Button buttons[] = {
|
2021-07-09 20:29:44 +02:00
|
|
|
/* click event mask button function argument */
|
|
|
|
{ ClkTagBar, 0, Button1, view, {0} },
|
|
|
|
{ ClkTagBar, 0, Button3, toggleview, {0} },
|
|
|
|
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
|
|
|
|
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
|
|
|
|
{ ClkClientWin, MODKEY, Button2, togglefloating, {0} },
|
|
|
|
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
|
2021-06-19 15:05:17 +02:00
|
|
|
};
|