From ed80e5df8c718fc2321904db1b81604d1ed33444 Mon Sep 17 00:00:00 2001 From: ben Date: Sat, 3 May 2025 14:59:49 -0700 Subject: suckless --- config/suckless/dwm/config.h | 220 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 220 insertions(+) create mode 100644 config/suckless/dwm/config.h (limited to 'config/suckless/dwm/config.h') diff --git a/config/suckless/dwm/config.h b/config/suckless/dwm/config.h new file mode 100644 index 0000000..6e52e48 --- /dev/null +++ b/config/suckless/dwm/config.h @@ -0,0 +1,220 @@ +#include +/* See LICENSE file for copyright and license details. */ + +/* appearance */ +static const unsigned int borderpx = 4; /* border pixel of windows */ +static const unsigned int gappx = 2; /* gap pixel between windows */ +static const unsigned int snap = 32; /* snap pixel */ +static const int showbar = 1; /* 0 means no bar */ +static const int topbar = 0; /* 0 means bottom bar */ +static const char *fonts[] = { "monospace:size=9" }; +static const char dmenufont[] = "monospace:size=9"; +static const char col_gray1[] = "#000000"; // background of tags and statusbar +static const char col_gray2[] = "#0f0f0f"; // unfocused +static const char col_gray3[] = "#FFFFFF"; // status bar and other tags +static const char col_gray4[] = "#FFFFFF"; // Current tag + program name +static const char col_cyan[] = "#353735";/*"#1f211f";*/ // focused +static const char *colors[][3] = { + /* fg bg border */ + [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, + [SchemeSel] = { col_gray4, col_cyan, col_cyan }, +}; + +/* tagging */ +static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9",}; + +static const Rule rules[] = { + /* xprop(1): + * WM_CLASS(STRING) = instance, class + * WM_NAME(STRING) = title + */ + /* class instance title tags mask isfloating monitor */ + { "Gimp", NULL, NULL, 0, 1, -1 }, + { "Firefox", NULL, NULL, 1 << 8, 0, -1 }, +}; + +/* 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 */ +static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ + +static const Layout layouts[] = { + /* symbol arrange function */ + { "[]=", tile }, /* first entry is default */ + { "><>", NULL }, /* no layout function means floating behavior */ + { "[M]", monocle }, +}; + +/* key definitions */ +#define MODKEY Mod4Mask +#define ALT_L Mod1Mask +#define TAGKEYS(KEY,TAG) \ +{ 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} }, + +/* helper for spawning shell commands in the pre dwm-5.0 fashion */ +#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } + +/* 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 *termcmd[] = { "st", NULL }; +static const char *ranger[] = { "st", "ranger", NULL }; +//static const char *newsboat[] = { "st", "newsboat", NULL }; +static const char *pavucontrol[] = { "pavucontrol", NULL }; +static const char *htop[] = { "st", "htop", NULL }; +static const char *obs[] = { "obs", NULL }; +//static const char *browser[] = {"librewolf", NULL}; +static const char *browser[] = {"mullvad-browser", NULL}; +static const char *element[] = {"element-desktop", NULL}; +static const char *maim[] = {"screen-shot", NULL}; +static const char *qbittorrent[] = {"qbittorrent", NULL}; +//static const char *mail[] = {"st", "-e", "sh", "-c", "pkill mbsync && neomutt; exec sh", NULL}; +static const char *mail[] = { + "st", "-e", "sh", "-c", "pkill mbsync || true; /bin/neomutt", NULL +}; + +//static const char *freetube[] = {"freetube", NULL}; +static const char *calcurse[] = {"st", "calcurse", NULL}; +static const char *slock[] = {"slock", NULL}; +static const char *afk[] = {"st", "/bin/afk", NULL}; +static const char *calculator[] = {"mate-calculator", NULL}; +static const char *prompt[] = {"/bin/prompt", NULL}; +static const char *gimp[] = {"gimp", NULL}; +static const char *krita[] = {"krita", NULL}; +static const char *vol[] = {"/bin/vol", NULL}; +static const char *voldown[] = {"/bin/vol-", NULL}; +static const char *volup[] = {"/bin/vol+", NULL}; +static const char *alsa[] = {"st", "alsamixer", NULL}; +static const char *abook[] = {"st", "abook", NULL}; +static const char *droidcam[] = {"droidcam-mpv", NULL}; +static const char *kiwix[] = {"kiwix-desktop", NULL}; +static const char *tenacity[] = {"tenacity", NULL}; +static const char *stopwatch[] = {"hourglass", NULL}; +static const char *bmark[] = {"bmark", NULL}; +static const char *bmarkadd[] = {"bmark-add", NULL}; +static const char *kill_dwm[] = {"/bin/pkill", "dwm", NULL}; +static const char *keynav[] = {"/bin/keynav", /* "/bin/xdotool key 'ctrl+;'", */ NULL}; + +static Key keys[] = { + /* modifier key function argument */ + { MODKEY, XK_d, spawn, {.v = dmenucmd } }, + { MODKEY, XK_Return, spawn, {.v = termcmd } }, + { MODKEY, XK_p, spawn, {.v = prompt } }, +// { MODKEY, XK_Insert, spawn, {.v = bmark } }, + { MODKEY, XK_r, spawn, {.v = bmark } }, +// { ALT_L|ShiftMask, XK_b, spawn, {.v = bmarkadd } }, + { MODKEY|ShiftMask, XK_s, spawn, {.v = maim } }, + + // applications + { MODKEY, XK_f, spawn, {.v = ranger } }, + //{ MODKEY, XK_n, spawn, {.v = newsboat } }, + { MODKEY, XK_b, spawn, {.v = browser } }, + { MODKEY, XK_e, spawn, {.v = element } }, + { MODKEY, XK_m, spawn, {.v = mail } }, + { MODKEY, XK_x, spawn, {.v = calcurse } }, + { MODKEY, XK_c, spawn, {.v = calculator } }, + { MODKEY, XK_u, spawn, {.v = keynav } }, + + { MODKEY|ShiftMask, XK_o, spawn, {.v = obs } }, + { MODKEY|ShiftMask, XK_t, spawn, {.v = qbittorrent } }, + //{ MODKEY|ShiftMask, XK_v, spawn, {.v = mullvad } }, + //{ MODKEY|ShiftMask, XK_y, spawn, {.v = freetube } }, + { MODKEY|ShiftMask, XK_w, spawn, {.v = kiwix } }, + { MODKEY|ShiftMask, XK_g, spawn, {.v = gimp } }, + { MODKEY|ShiftMask, XK_k, spawn, {.v = krita } }, + + //{ ALT_L|ShiftMask, XK_t, spawn, {.v = torbrowser } }, + { ALT_L|ShiftMask, XK_a, spawn, {.v = abook } }, + { ALT_L|ShiftMask, XK_d, spawn, {.v = droidcam } }, + //{ ALT_L|ShiftMask, XK_p, spawn, {.v = stash } }, + { ALT_L|ShiftMask, XK_e, spawn, {.v = tenacity } }, + { ALT_L|ShiftMask, XK_h, spawn, {.v = stopwatch } }, + + + // control + { MODKEY|ShiftMask, XK_p, spawn, {.v = pavucontrol } }, + { MODKEY|ShiftMask, XK_h, spawn, {.v = htop } }, + { MODKEY|ShiftMask, XK_q, spawn, {.v = slock } }, + { MODKEY|ShiftMask, XK_q, spawn, {.v = afk } }, + { MODKEY|ShiftMask, XK_a, spawn, {.v = alsa } }, + { MODKEY|ShiftMask, XK_b, togglebar, {0} }, + { MODKEY|ShiftMask, XK_Escape, spawn, {.v = kill_dwm } }, + { MODKEY, XK_Home, quit, {0} }, + { MODKEY|ShiftMask, XK_c, killclient, {0} }, + + // volume + { MODKEY, XK_F1, spawn, {.v = vol } }, + { MODKEY, XK_F2, spawn, {.v = voldown } }, + { MODKEY, XK_F3, spawn, {.v = volup } }, + { 0, XF86XK_AudioRaiseVolume, spawn, {.v = volup } }, + { 0, XF86XK_AudioLowerVolume, spawn, {.v = voldown } }, + { 0, XF86XK_AudioPlay, spawn, SHCMD("echo cycle pause | socat - /tmp/mpvsocket") }, + { 0, XF86XK_AudioPrev, spawn, SHCMD("echo playlist-prev | socat - /tmp/mpvsocket") }, + { 0, XF86XK_AudioNext, spawn, SHCMD("echo playlist-next | socat - /tmp/mpvsocket") }, + { 0, XF86XK_AudioMute, spawn, SHCMD("echo cycle mute | socat - /tmp/mpvsocket") }, + + + + // layout + { MODKEY, XK_i, incnmaster, {.i = +1 } }, + { MODKEY|ShiftMask, XK_d, incnmaster, {.i = -1 } }, + + { MODKEY, XK_h, setmfact, {.f = -0.05} }, + { MODKEY, XK_l, setmfact, {.f = +0.05} }, + { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, + { MODKEY|ShiftMask, XK_f, setlayout, {.v = &layouts[1]} }, + { MODKEY|ShiftMask, XK_m, setlayout, {.v = &layouts[2]} }, + { MODKEY, XK_space, setlayout, {0} }, + { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, + + + // focused + { MODKEY, XK_j, focusstack, {.i = +1 } }, + { MODKEY, XK_k, focusstack, {.i = -1 } }, + { MODKEY, XK_comma, focusmon, {.i = -1 } }, + { MODKEY, XK_period, focusmon, {.i = +1 } }, + { MODKEY|ShiftMask, XK_Return, zoom, {0} }, + + + // window + TAGKEYS( XK_1, 0) + 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) + + { MODKEY, XK_0, view, {.ui = ~0 } }, + { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, + + { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, + { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, + { MODKEY, XK_Tab, view, {0} }, + + + +}; + +/* button definitions */ +/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ +static Button buttons[] = { + /* click event mask button function argument */ + { ClkLtSymbol, 0, Button1, setlayout, {0} }, + { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, + { 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} }, + { ClkTagBar, 0, Button3, toggleview, {0} }, + { ClkTagBar, MODKEY, Button1, tag, {0} }, + { ClkTagBar, MODKEY, Button3, toggletag, {0} }, + //{ ClkStatusText, 0, 9, spawn, {.v = termcmd} }, + { ClkStatusText, 0, 13, spawn, {.v = termcmd} }, +}; -- cgit v1.2.3