2021-06-19 15:05:17 +02:00
|
|
|
/* See LICENSE file for copyright and license details. */
|
|
|
|
|
|
|
|
/* appearance */
|
2022-03-07 19:00:15 +01:00
|
|
|
static const unsigned int borderpx = 5; /* border pixel of windows */
|
2021-06-19 15:05:17 +02:00
|
|
|
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*/
|
2022-03-31 23:04:01 +02:00
|
|
|
static const int showsystray = 1; /* 0 means no systray */
|
2021-06-19 15:05:17 +02:00
|
|
|
static const int showbar = 1; /* 0 means no bar */
|
|
|
|
static const int topbar = 1; /* 0 means bottom bar */
|
2022-03-31 23:04:01 +02:00
|
|
|
static const int user_bh = 20; /* 0 means that dwm will calculate bar height, >= 1 means dwm will user_bh as bar height */
|
2022-02-24 15:19:38 +01:00
|
|
|
static const char *fonts[] = { "RobotoMono Nerd Font:style=Medium:size=10", "Material Icons:size=12" };
|
2021-06-19 15:05:17 +02:00
|
|
|
static const char normfgcolor[] = "#bbbbbb";
|
2022-03-31 22:51:39 +02:00
|
|
|
static const char col_fg[] = "#c7c7c7";
|
|
|
|
static const char col_bg[] = "#161616";
|
2022-03-08 20:20:12 +01:00
|
|
|
static const char col_bd[] = "#000000";
|
2022-03-07 18:57:13 +01:00
|
|
|
static const char col_fg_sel[] = "#ffffff";
|
|
|
|
static const char col_bg_sel[] = "#005577";
|
2022-03-31 22:39:36 +02:00
|
|
|
static const char col_bd_sel[] = "#005577";
|
2021-11-26 16:23:00 +01:00
|
|
|
static const char *colors[][3] = {
|
|
|
|
/* fg bg border */
|
|
|
|
[SchemeNorm] = { col_fg, col_bg, col_bd },
|
|
|
|
[SchemeSel] = { col_fg_sel, col_bg_sel, col_bd_sel },
|
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;
|
2022-03-31 22:39:36 +02:00
|
|
|
const char *spcmd1[] = {"st", "-n", "spterm", "-g", "120x34", NULL };
|
|
|
|
const char *spcmd2[] = {"st", "-n", "spwork", "-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},
|
2022-03-07 18:57:13 +01:00
|
|
|
{"spwork", spcmd2},
|
2021-06-19 15:05:17 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/* tagging */
|
2022-03-11 18:25:35 +01:00
|
|
|
static const char *tags[] = {"\ue9ef", "\ue80b", "\ue0c9", "\ue0e1", "\ue3fe", "\ue3ff", "\ue405", "\ue8af", "\ue943", "\ue894"};
|
2021-06-19 15:05:17 +02:00
|
|
|
|
|
|
|
static const Rule rules[] = {
|
|
|
|
/* xprop(1):
|
|
|
|
* WM_CLASS(STRING) = instance, class
|
|
|
|
* WM_NAME(STRING) = title
|
|
|
|
*/
|
2022-03-11 18:25:35 +01:00
|
|
|
/* class instance title tags mask isfloating isterminal noswallow monitor */
|
2022-03-31 22:39:36 +02:00
|
|
|
{ NULL, NULL, "st", 0, 0, 1, 0, -1 },
|
2022-03-18 16:07:33 +01:00
|
|
|
{ "firefox", NULL, NULL, 2, 0, 0, 1, -1 },
|
2022-03-11 18:25:35 +01:00
|
|
|
{ "Ferdi", NULL, NULL, 1 << 2, 0, 0, 0, -1 },
|
|
|
|
{ "Slack", NULL, NULL, 1 << 7, 0, 0, 0, -1 },
|
2022-04-05 14:32:34 +02:00
|
|
|
{ "workfx", NULL, NULL, 1 << 9, 0, 0, 1, -1 },
|
2022-03-11 18:25:35 +01:00
|
|
|
{ "sonos-controller-unofficial", NULL, NULL, 1 << 6, 0, 0, 0, -1 },
|
|
|
|
{ NULL, NULL, "Event Tester", 0, 0, 0, 1, -1 }, /* xev */
|
|
|
|
{ NULL, "mutt", NULL, 1 << 3, 0, 1, 1, -1 },
|
|
|
|
{ NULL, "spterm", NULL, SPTAG(0), 1, 1, 0, -1 },
|
|
|
|
{ NULL, "spwork", NULL, SPTAG(1), 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 */
|
2022-01-19 11:56:41 +01:00
|
|
|
static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
|
2021-06-19 15:05:17 +02:00
|
|
|
|
|
|
|
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 } }
|
|
|
|
|
|
|
|
#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 */
|
2022-03-06 15:16:16 +01:00
|
|
|
//{ MODKEY, XK_Return, spawn, {.v = termcmd } },
|
2022-03-31 23:30:50 +02:00
|
|
|
{ MODKEY, XK_Return, spawn, SHCMD("BROWSER=firefox st") },
|
|
|
|
{ SHTKEY, XK_Return, spawn, SHCMD("BROWSER=workfx st -n work") },
|
2021-10-25 00:12:52 +02:00
|
|
|
{ MODKEY, XK_space, spawn, SHCMD("dmenu_run -c -i -l 20") },
|
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'") },
|
2022-04-05 14:32:34 +02:00
|
|
|
{ MODKEY, XK_m, spawn, SHCMD("pgrep -x neomutt > /dev/null || BROWSER=firefox st -n mutt -e neomutt") },
|
2021-07-26 16:43:47 +02:00
|
|
|
{ MODKEY, XK_q, killclient, {0} },
|
|
|
|
{ MODKEY, XK_e, togglescratch, {.ui = 0 } },
|
2022-03-07 18:57:13 +01:00
|
|
|
{ SHTKEY, XK_e, togglescratch, {.ui = 1 } },
|
2021-07-26 16:43:47 +02:00
|
|
|
/* 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") },
|
2022-02-20 03:08:28 +01:00
|
|
|
{ CTRKEY, XK_l, spawn, SHCMD("slock") },
|
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)") },
|
2022-03-27 11:53:33 +02:00
|
|
|
{ 0, XF86XK_MonBrightnessDown, spawn, SHCMD("xbacklight -dec 10") },
|
|
|
|
{ 0, XF86XK_MonBrightnessUp, spawn, SHCMD("xbacklight -inc 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
|
|
|
};
|