dwm/config.def.h

236 lines
14 KiB
C
Raw Normal View History

2007-05-30 10:19:28 +00:00
/* See LICENSE file for copyright and license details. */
2020-12-16 11:08:41 +00:00
#include <X11/XF86keysym.h>
/* appearance */
2020-12-16 11:08:41 +00:00
static unsigned int borderpx = 1; /* border pixel of windows */
static unsigned int snap = 32; /* snap pixel */
2021-01-06 11:27:46 +00:00
static int showbar = 1; /* 0 means no bar */
2021-07-13 14:44:12 +00:00
static int topbar = 0; /* 0 means bottom bar */
2021-03-08 07:41:35 +00:00
static const unsigned int gappih = 10; /* horiz inner gap between windows */
2020-12-16 05:56:13 +00:00
static const unsigned int gappiv = 10; /* vert inner gap between windows */
2021-01-06 11:27:46 +00:00
static const unsigned int gappoh = 10; /* horiz outer gap between windows and screen edge */
2021-03-08 07:41:35 +00:00
static const unsigned int gappov = 10; /* vert outer gap between windows and screen edge */
2020-12-16 17:09:36 +00:00
static int smartgaps = 0; /* 1 means no outer gap when there is only one window */
2021-03-08 07:41:35 +00:00
//static const char *fonts[] = { "iosevka:size=9" };
//static const char dmenufont[] = "iosevka:size=9";
2021-07-13 14:44:12 +00:00
//static const char *fonts[] = { "Liberation Mono:size=9:antialias=true:autohint=true" };
//static const char dmenufont[] = "Liberation Mono:size=9:antialias=true:autohint=true";
2021-07-15 08:53:52 +00:00
static const char *fonts[] = { "monospace:size=11:antialias=true:autohint=true" };
static const char dmenufont[] = "monospace:size=11:antialias=true:autohint=true";
2021-03-08 07:41:35 +00:00
//#include "/home/dizzy/.cache/wal/colors-wal-dwm.h"
2021-07-13 14:44:12 +00:00
static char normbgcolor[] = "#222222";
static char normbordercolor[] = "#444444";
static char normfgcolor[] = "#bbbbbb";
2021-03-08 07:41:35 +00:00
2021-07-13 14:44:12 +00:00
static char selfgcolor[] = "#eeeeee";
static char selbordercolor[] = "#770000";
static char selbgcolor[] = "#005577";
2021-03-08 07:41:35 +00:00
static char col_urgborder[] = "#ff0000";
static char col_urgfg[] = "#ff0000";
static char col_urgbg[] = "#ff0000";
static char *colors[][3] = {
/* fg bg border */
[SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor },
[SchemeSel] = { selfgcolor, selbgcolor, selbordercolor },
[SchemeUrg] = { col_urgfg, col_urgbg, col_urgborder },
};
/* tagging */
2009-05-29 08:29:22 +00:00
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
static const Rule rules[] = {
2012-01-22 19:23:49 +00:00
/* xprop(1):
* WM_CLASS(STRING) = instance, class
* WM_NAME(STRING) = title
*/
2020-12-16 05:56:13 +00:00
/* class instance title tags mask isfloating monitor scratch keys float x,y,w,h floatborderpx*/
{ "Gimp", NULL, NULL, 0, 1, -1, 0, 50,50,500,500, 5 },
2021-03-08 07:41:35 +00:00
{ "feh", NULL, NULL, 0, 1, -1, 0, 50,50,500,500, 5 },
{ "mpv", NULL, NULL, 0, 1, -1, 0, 50,50,500,500, 5 },
2021-07-13 14:44:12 +00:00
{ NULL, NULL, "scratchpad", 0, 1, -1, 's', 50,50,700,500, 4 },
/* Normal Apps */
{ NULL, NULL, "sys_monitor", 1 << 8, 0, 1, 0, 50,50,700,500, 1 },
{ NULL, NULL, "newsboat", 1 << 7, 0, 0, 0, 50,50,700,500, 1 },
{ "firefox", NULL, NULL, 1 << 1, 0, 0, 0, 50,50,500,500, 5 },
{ NULL, NULL, "music", 1 << 8, 0, 0, 0, 50,50,700,500, 1 },
{ NULL, NULL, "mixer", 1 << 7, 0, 1, 0, 50,50,700,500, 1 },
/* Development Apps */
{ NULL, NULL, "code0", 1 << 0, 0, 0, 0, 50,50,700,500, 1 },
{ NULL, NULL, "code1", 1 << 0, 0, 0, 0, 50,50,700,500, 1 },
{ NULL, NULL, "code2", 1 << 2, 0, 0, 0, 50,50,700,500, 1 },
{ NULL, NULL, "code3", 1 << 0, 0, 1, 0, 50,50,700,500, 1 },
{ NULL, NULL, "code4", 1 << 1, 0, 1, 0, 50,50,700,500, 1 },
{ NULL, NULL, "code5", 1 << 2, 0, 1, 0, 50,50,700,500, 1 },
{ NULL, NULL, "code6", 1 << 3, 0, 1, 0, 50,50,700,500, 1 },
};
2007-02-19 17:19:43 +00:00
/* layout(s) */
2021-03-08 07:41:35 +00:00
static float mfact = 0.50; /* factor of master area size [0.05..0.95] */
2020-12-16 11:08:41 +00:00
static int nmaster = 1; /* number of clients in master area */
static int resizehints = 1; /* 1 means respect size hints in tiled resizals */
2020-12-16 05:56:13 +00:00
#define FORCE_VSPLIT 1 /* nrowgrid layout: force two clients to always split vertically */
#include "vanitygaps.c"
static const Layout layouts[] = {
/* symbol arrange function */
2008-06-19 10:38:53 +00:00
{ "[]=", tile }, /* first entry is default */
2008-07-02 10:19:02 +00:00
{ "[M]", monocle },
2020-12-16 05:56:13 +00:00
{ "[@]", spiral },
{ "[\\]", dwindle },
{ "H[]", deck },
{ "TTT", bstack },
{ "===", bstackhoriz },
{ "HHH", grid },
{ "###", nrowgrid },
{ "---", horizgrid },
{ ":::", gaplessgrid },
{ "|M|", centeredmaster },
{ ">M>", centeredfloatingmaster },
{ "><>", NULL }, /* no layout function means floating behavior */
{ NULL, NULL },
2007-02-19 17:19:43 +00:00
};
/* key definitions */
2020-12-16 17:09:36 +00:00
#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} },
2021-07-13 14:44:12 +00:00
#define TAGMASK ((int)((1LL << LENGTH(tags)) - 1))
2020-12-16 17:09:36 +00:00
#define HOLDKEY XK_Super_L // replace 0 with the keysym to activate holdbar
2008-06-12 15:37:03 +00:00
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
2008-06-14 09:38:18 +00:00
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
/* commands */
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
2021-07-15 08:53:52 +00:00
//static const char *dmenucmd[] = { "dmenu_run", "-b", "-m", dmenumon, "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbordercolor, "-sf", selfgcolor, NULL };
static const char *dmenucmd[] = { "dmenu_run", "-b", "-l", "5", "-m", dmenumon, NULL };
2020-12-16 11:08:41 +00:00
static const char *termcmd[] = { "alacritty", NULL };
2021-07-13 14:44:12 +00:00
/*First arg only serves to match against key in rules*/
static const char *scratchpadcmd[] = {"s", "alacritty", "-t", "scratchpad", NULL};
2020-12-16 11:08:41 +00:00
/*
* Xresources preferences to load at startup
*/
ResourcePref resources[] = {
2021-03-08 07:41:35 +00:00
{ "color0", STRING, &normbgcolor },
{ "color8", STRING, &normbordercolor },
{ "color15", STRING, &normfgcolor },
{ "color2", STRING, &selbgcolor },
{ "color15", STRING, &selbordercolor },
{ "color15", STRING, &selfgcolor },
{ "color1", STRING, &col_urgborder },
{ "color15", STRING, &col_urgfg },
{ "color1", STRING, &col_urgbg },
//{ "borderpx", INTEGER, &borderpx },
//{ "snap", INTEGER, &snap },
2020-12-16 17:09:36 +00:00
//{ "showbar", INTEGER, &showbar },
//{ "topbar", INTEGER, &topbar },
//{ "nmaster", INTEGER, &nmaster },
//{ "resizehints", INTEGER, &resizehints },
//{ "mfact", FLOAT, &mfact },
2020-12-16 11:08:41 +00:00
};
static const char *upvol[] = { "/usr/bin/pactl", "set-sink-volume", "0", "+5%", NULL };
static const char *downvol[] = { "/usr/bin/pactl", "set-sink-volume", "0", "-5%", NULL };
static const char *mutevol[] = { "/usr/bin/pactl", "set-sink-mute", "0", "toggle", NULL };
2008-06-11 13:10:18 +00:00
2008-06-11 08:12:06 +00:00
static Key keys[] = {
2008-05-17 13:04:27 +00:00
/* modifier key function argument */
2020-12-16 11:08:41 +00:00
{ MODKEY, XK_u, spawn, {.v = dmenucmd } },
{ MODKEY|ShiftMask, XK_d, spawn, SHCMD("flameshot gui") },
2021-07-13 14:44:12 +00:00
{ MODKEY|ShiftMask, XK_s, spawn, SHCMD("slock") },
{ MODKEY, XK_w, spawn, SHCMD("dweb") },
2021-03-08 07:41:35 +00:00
{ MODKEY|ControlMask, XK_w, spawn, SHCMD("change_wallpaper") },
{ MODKEY|ControlMask, XK_a, spawn, SHCMD("add_wallpaper") },
2021-07-13 14:44:12 +00:00
{ MODKEY, XK_y, spawn, SHCMD("pomodoro") },
{ MODKEY, XK_e, spawn, SHCMD("demoji") },
{ MODKEY, XK_o, spawn, SHCMD("dmpv_open") },
{ MODKEY, XK_p, spawn, SHCMD("bitwarden-dmenu --dmenu-args='-i' --dmenu-pswd-args='-nf white -P' --clear-clipboard 30 --session-timeout 100 --sync-vault-after 3600 --on-error 'xargs notify-send --urgency=low'") },
2021-03-08 07:41:35 +00:00
{ MODKEY, XK_Return, spawn, {.v = termcmd } },
2020-12-16 05:56:13 +00:00
{ MODKEY, XK_grave, togglescratch, {.v = scratchpadcmd } },
2021-03-08 07:41:35 +00:00
//{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
2011-10-25 19:40:46 +00:00
{ 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} },
2020-12-16 11:08:41 +00:00
{ MODKEY, XK_z, zoom, {0} },
2021-01-06 11:27:46 +00:00
{ MODKEY|Mod1Mask, XK_u, incrgaps, {.i = +1 } },
{ MODKEY|Mod1Mask|ShiftMask, XK_u, incrgaps, {.i = -1 } },
{ MODKEY|Mod1Mask, XK_i, incrigaps, {.i = +1 } },
{ MODKEY|Mod1Mask|ShiftMask, XK_i, incrigaps, {.i = -1 } },
{ MODKEY|Mod1Mask, XK_o, incrogaps, {.i = +1 } },
{ MODKEY|Mod1Mask|ShiftMask, XK_o, incrogaps, {.i = -1 } },
{ MODKEY|Mod1Mask, XK_6, incrihgaps, {.i = +1 } },
{ MODKEY|Mod1Mask|ShiftMask, XK_6, incrihgaps, {.i = -1 } },
{ MODKEY|Mod1Mask, XK_7, incrivgaps, {.i = +1 } },
{ MODKEY|Mod1Mask|ShiftMask, XK_7, incrivgaps, {.i = -1 } },
{ MODKEY|Mod1Mask, XK_8, incrohgaps, {.i = +1 } },
{ MODKEY|Mod1Mask|ShiftMask, XK_8, incrohgaps, {.i = -1 } },
{ MODKEY|Mod1Mask, XK_9, incrovgaps, {.i = +1 } },
{ MODKEY|Mod1Mask|ShiftMask, XK_9, incrovgaps, {.i = -1 } },
{ MODKEY|Mod1Mask, XK_0, togglegaps, {0} },
{ MODKEY|Mod1Mask|ShiftMask, XK_0, defaultgaps, {0} },
{ MODKEY, XK_Tab, view, {0} },
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
2021-07-13 14:44:12 +00:00
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
2021-01-06 11:27:46 +00:00
{ MODKEY, XK_f, setlayout, {.v = &layouts[13]} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[1]} },
2021-03-08 07:41:35 +00:00
{ MODKEY|ShiftMask, XK_t, setlayout, {.v = &layouts[3]} },
2020-12-16 17:09:36 +00:00
{ MODKEY, XK_x, setlayout, {.v = &layouts[4]} },
2008-06-19 10:38:53 +00:00
{ MODKEY, XK_space, setlayout, {0} },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
2008-06-11 08:12:06 +00:00
{ 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 } },
2021-03-08 07:41:35 +00:00
{ MODKEY, XK_F4, spawn, { .v = (const char*[]){ "refresh_wallpaper", NULL } } },
{ MODKEY, XK_F5, xresources, {.v = NULL}},
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|ShiftMask, XK_q, quit, {0} },
2020-12-16 11:08:41 +00:00
{ 0, XF86XK_AudioLowerVolume, spawn, {.v = downvol } },
{ 0, XF86XK_AudioMute, spawn, {.v = mutevol } },
{ 0, XF86XK_AudioRaiseVolume, spawn, {.v = upvol } },
2020-12-16 08:09:22 +00:00
{ 0, HOLDKEY, holdbar, {0} },
};
/* button definitions */
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
static Button buttons[] = {
/* click event mask button function argument */
2008-06-19 10:38:53 +00:00
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
{ ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
{ ClkWinTitle, 0, Button2, zoom, {0} },
2020-12-16 08:09:22 +00:00
{ ClkStatusText, 0, Button1, sigdwmblocks, {.i = 1} },
{ ClkStatusText, 0, Button2, sigdwmblocks, {.i = 2} },
{ ClkStatusText, 0, Button3, sigdwmblocks, {.i = 3} },
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
{ ClkClientWin, MODKEY, Button2, togglefloating, {0} },
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
2008-06-24 11:40:48 +00:00
{ ClkTagBar, 0, Button1, view, {0} },
{ ClkTagBar, 0, Button3, toggleview, {0} },
{ ClkTagBar, MODKEY, Button1, tag, {0} },
2008-06-20 15:52:07 +00:00
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
};