suckless/dwm/config.def.h
Arija A. d0a994d534
Init
Signed-off-by: Arija A. <ari@ari.lt>
2025-05-25 22:11:02 +03:00

224 lines
7.4 KiB
C

/* See LICENSE file for copyright and license details. */
#include <X11/XF86keysym.h>
#include "dwmutils.h"
/* appearance */
static const unsigned int gappx = 2; /* gaps */
static const unsigned int borderpx = 2; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
static const char *fonts[] = {"sans:size=15.5"};
static const char col_gray1[] = "#262220"; /* #222222; background colour */
static const char col_gray2[] =
"#262220"; /* #444444; inactive window border colour */
static const char col_gray3[] = "#f9f6e8"; /* #BBBBBB; font colour */
static const char col_gray4[] =
"#383838"; /* #EEEEEE; current tag and current window colour */
static const char col_cyan[] =
"#f9f0c2"; /* #005577; second bar colour and active window border colour */
static const char *colors[][3] = {
/* fg bg border */
[SchemeNorm] = {col_gray3, col_gray1, col_gray2}, /* innnactive bar */
[SchemeSel] = {col_gray4, col_cyan, col_cyan}, /* active bar */
};
/* 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 monitor */
/* (1 << tag - 1) */
/* all tags */
mk_atag("st", ALL_TAGS),
mk_atag("Alacritty", ALL_TAGS),
mk_atag("Emacs", ALL_TAGS),
/* tag 2 */
mk_ftag("Firefox", 2),
mk_ftag("firefox", 2),
mk_ftag("Pale moon", 2),
mk_ftag("Tor Browser", 2),
mk_ftag("LibreWolf", 2),
mk_ftag("chromium", 2),
mk_ftag("qBittorrent", 2),
mk_ftag("kristall", 2),
mk_ftag("Thunderbird", 2),
mk_ftag("FreeTube", 2),
/* tag 3 */
mk_ftag("Code", 3),
mk_ftag("VSCodium", 3),
mk_ftag("jetbrains-pycharm-ce", 3),
/* tag 4 */
mk_ftag("discord", 4),
mk_ftag("Bitwarden", 4),
mk_ftag("TelegramDesktop", 4),
mk_ftag("KotatogramDesktop", 4),
/* tag 5 */
mk_ftag("Microsoft Teams - Preview", 5),
mk_ftag("teams-for-linux", 5),
mk_ftag("zoom", 5),
/* tag 6 */
mk_ftag("VirtualBox Manager", 6),
{NULL, "qemu", NULL, mk_tag(6), -1},
/* tag 7 */
mk_ftag("libreoffice", 7),
};
/* key definitions */
#define MODKEY Mod4Mask
#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}},
/* commands */
static char dmenumon[2] =
"0"; /* component of dmenucmd, manipulated in spawn() */
// static const char *dmenucmd[] = { "rofi", "-show", "run", NULL };
static const char *dmenucmd[] = mk_command("dmenu_run");
static const char *mutecmd[] =
mk_command("pactl", "set-sink-mute", "@DEFAULT_SINK@", "toggle");
static const char *volupcmd[] =
mk_command("pactl", "set-sink-volume", "@DEFAULT_SINK@", "+5%");
static const char *voldowncmd[] =
mk_command("pactl", "set-sink-volume", "@DEFAULT_SINK@", "-5%");
static const char *brupcmd[] = mk_command("xbacklight", "-inc", "10");
static const char *brdowncmd[] = mk_command("xbacklight", "-dec", "10");
static const char *editorcmd[] = mk_command("st", "-e", "vim");
static const char *calandarcmd[] = mk_command("st", "-e", "calcurse");
static const char *lockercmd[] = mk_command("xautolock", "-locknow");
static const char *browser[] = mk_command("librewolf");
static const char *emojicmd[] = mk_command("emoji");
static const char *screenkey[] =
mk_command("sh", "-c",
"exec screenkey --font 'Hack Nerd Font' --geometry "
"\"$(slop -n -f '%g')\" --position fixed --no-systray "
"--bg-color '#262220' --font-color '#d3ceba'");
static const char *screenkeykill[] = mk_command("pkill", "-f", "screenkey");
static const char *quitdwmcmd[] = mk_command("quitdwm");
static const char *dwmmenucmd[] = mk_command("dwmmenu");
static const char *termcmd[] = mk_command("st");
static const char *extrakbcmd[] = mk_command("extrakb");
static const char *weathercmd[] = mk_command("st", "-e", "dweather");
static const char *fpdwmcmd[] = mk_command("fpdwm");
static const char *clear_formatting_cmd[] = mk_command(
"sh", "-c", "xclip -selection clipboard -o | xclip -selection clipboard");
static const Key keys[] = {
/* modifier key function argument */
{MODKEY, XK_d, spawn, {.v = dmenucmd}},
{MODKEY, XK_Return, spawn, {.v = termcmd}},
// make a window master
{MODKEY | ShiftMask, XK_Return, zoom, {0}},
// toggle bar
{MODKEY, XK_b, togglebar, {0}},
// cycle through the stack clockwise
{MODKEY, XK_j, focusstack, {.i = +1}},
// cycle thtough the stack anti-clockwise
{MODKEY, XK_k, focusstack, {.i = -1}},
// increases number of windows on master
{MODKEY | ShiftMask, XK_i, incnmaster, {.i = +1}},
// decreases number of windows on master
{MODKEY | ShiftMask, XK_d, incnmaster, {.i = -1}},
// make master smaller
{MODKEY, XK_h, setmfact, {.f = -0.05}},
// make master larger
{MODKEY, XK_l, setmfact, {.f = +0.05}},
// switch to a used tag
{MODKEY, XK_Tab, view, {0}},
// kill a window
{MODKEY | ShiftMask, XK_q, killclient, {0}},
// gap control
{MODKEY, XK_minus, setgaps, {.i = -1}},
{MODKEY, XK_equal, setgaps, {.i = +1}},
{MODKEY | ShiftMask, XK_equal, setgaps, {.i = 0}},
// switch to tags
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)
// exit dwm
{MODKEY | ShiftMask, XK_e, spawn, {.v = quitdwmcmd}},
// dwm menu
{MODKEY | ShiftMask, XK_m, spawn, {.v = dwmmenucmd}},
// media keys
{0, XF86XK_AudioMute, spawn, {.v = mutecmd}},
{0, XF86XK_AudioLowerVolume, spawn, {.v = voldowncmd}},
{0, XF86XK_AudioRaiseVolume, spawn, {.v = volupcmd}},
{0, XF86XK_MonBrightnessUp, spawn, {.v = brupcmd}},
{0, XF86XK_MonBrightnessDown, spawn, {.v = brdowncmd}},
// vim
{MODKEY | ControlMask, XK_e, spawn, {.v = editorcmd}},
// locker
{MODKEY, XK_x, spawn, {.v = lockercmd}},
// actual full screen patch
{MODKEY | ShiftMask, XK_f, togglefullscr, {0}},
// browser
{MODKEY, XK_i, spawn, {.v = browser}},
// Emoji selector
{MODKEY, XK_e, spawn, {.v = emojicmd}},
// Notes/TODOs/etc.
{MODKEY, XK_n, spawn, {.v = calandarcmd}},
// Spawn screenkey
{MODKEY | ShiftMask, XK_s, spawn, {.v = screenkeykill}},
{MODKEY, XK_s, spawn, {.v = screenkey}},
// Extra keyboard characters
{MODKEY | ShiftMask, XK_k, spawn, {.v = extrakbcmd}},
// Weather
{MODKEY, XK_w, spawn, {.v = weathercmd}},
// Firefox profile selector
{MODKEY | ShiftMask, XK_p, spawn, {.v = fpdwmcmd}},
// Factor
{MODKEY | ShiftMask, XK_o, setfactor, {.f = -0.25}},
{MODKEY | ShiftMask, XK_l, setfactor, {.f = +0.25}},
{MODKEY | ShiftMask, XK_j, setfactor, {.f = 0.00}},
// Clear formatting
{MODKEY | ShiftMask, XK_n, spawn, {.v = clear_formatting_cmd}},
};