123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315 |
- /* See LICENSE file for copyright and license details. */
- /* appearance */
- static const unsigned int borderpx = 1; /* border pixel of windows */
- static const unsigned int barborderpx = 0; /* border pixel of bar */
- static const unsigned int snap = 32; /* snap pixel */
- static const int swallowfloating = 1; /* 1 means swallow floating windows by default */
- static const unsigned int gappih = 10; /* horiz inner gap between windows */
- static const unsigned int gappiv = 10; /* vert inner gap between windows */
- static const unsigned int gappoh = 10; /* horiz outer gap between windows and screen edge */
- static const unsigned int gappov = 10; /* vert outer gap between windows and screen edge */
- static const int smartgaps_fact = 0; /* gap factor when there is only one client; 0 = no gaps, 3 = 3x outer gaps */
- static const char autostartblocksh[] = "autostart_blocking.sh";
- static const char autostartsh[] = "autostart.sh";
- static const char dwmdir[] = "dwm";
- static const char localshare[] = ".local/share";
- static const int showbar = 0; /* 0 means no bar */
- static const int topbar = 0; /* 0 means bottom bar */
- static const int bar_height = 45; /* 0 means derive from font, >= 1 explicit height */
- static const int statusmon = 'A'; /* Status is to be shown on: -1 (all monitors), 0 (a specific monitor by index), 'A' (active monitor) */
- static const int horizpadbar = 10; /* horizontal padding for statusbar */
- static const int vertpadbar = 15; /* vertical padding for statusbar */
- /* alt-tab configuration */
- static const unsigned int tabmodkey = 0x40; /* (Alt) when this key is held down the alt-tab functionality stays active. Must be the same modifier as used to run alttabstart */
- static const unsigned int tabcyclekey = 0x17; /* (Tab) when this key is hit the menu moves one position forward in client stack. Must be the same key as used to run alttabstart */
- static const unsigned int tabposy = 1; /* tab position on Y axis, 0 = top, 1 = center, 2 = bottom */
- static const unsigned int tabposx = 1; /* tab position on X axis, 0 = left, 1 = center, 2 = right */
- static const unsigned int maxwtab = 600; /* tab menu width */
- static const unsigned int maxhtab = 200; /* tab menu height */
- /* Indicators: see patch/bar_indicators.h for options */
- static int tagindicatortype = INDICATOR_CLIENT_DOTS;
- static int tiledindicatortype = INDICATOR_NONE;
- static int floatindicatortype = INDICATOR_TOP_LEFT_SQUARE;
- static const char *fonts[] = { "SF Pro Rounded:style=Regular:size=9:antialias=true", "Font Awesome 6 Pro:style=Solid:pixelsize=16:antialias=true", "Font Awesome 6 Brands:style=Solid:pixelsize=16:antialias=true", "Material Design Icons:Regular:pixelsize=19:antialias=true" };
- static const char dmenufont[] = "SF Pro Rounded:style=Regular:size=9:antialias=true";
- static char c000000[] = "#141414"; // placeholder value
- static char normfgcolor[] = "#a7a7a7";
- static char normbgcolor[] = "#141414";
- static char normbordercolor[] = "#202020";
- static char normfloatcolor[] = "#303030";
- static char selfgcolor[] = "#808fa0";
- static char selbgcolor[] = "#141414";
- static char selbordercolor[] = "#505050";
- static char selfloatcolor[] = "#505050";
- static char titlenormfgcolor[] = "#a7a7a7";
- static char titlenormbgcolor[] = "#141414";
- static char titlenormbordercolor[] = "#141414";
- static char titlenormfloatcolor[] = "#303030";
- static char titleselfgcolor[] = "#808fa0";
- static char titleselbgcolor[] = "#141414";
- static char titleselbordercolor[] = "#141414";
- static char titleselfloatcolor[] = "#a7a7a7";
- static char tagsnormfgcolor[] = "#a7a7a7";
- static char tagsnormbgcolor[] = "#141414";
- static char tagsnormbordercolor[] = "#141414";
- static char tagsnormfloatcolor[] = "#303030";
- static char tagsselfgcolor[] = "#808fa0";
- static char tagsselbgcolor[] = "#141414";
- static char tagsselbordercolor[] = "#141414";
- static char tagsselfloatcolor[] = "#a7a7a7";
- static char hidnormfgcolor[] = "#a7a7a7";
- static char hidselfgcolor[] = "#808fa0";
- static char hidnormbgcolor[] = "#222222";
- static char hidselbgcolor[] = "#222222";
- static char urgfgcolor[] = "#b16286";
- static char urgbgcolor[] = "#141414";
- static char urgbordercolor[] = "#b16286";
- static char urgfloatcolor[] = "#b16286";
- static const unsigned int baralpha = 255;
- static const unsigned int borderalpha = OPAQUE;
- static const unsigned int alphas[][3] = {
- /* fg bg border */
- [SchemeNorm] = { OPAQUE, baralpha, borderalpha },
- [SchemeSel] = { OPAQUE, baralpha, borderalpha },
- [SchemeTitleNorm] = { OPAQUE, baralpha, borderalpha },
- [SchemeTitleSel] = { OPAQUE, baralpha, borderalpha },
- [SchemeTagsNorm] = { OPAQUE, baralpha, borderalpha },
- [SchemeTagsSel] = { OPAQUE, baralpha, borderalpha },
- [SchemeHidNorm] = { OPAQUE, baralpha, borderalpha },
- [SchemeHidSel] = { OPAQUE, baralpha, borderalpha },
- [SchemeUrg] = { OPAQUE, baralpha, borderalpha },
- };
- static char *colors[][ColCount] = {
- /* fg bg border float */
- [SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor, normfloatcolor },
- [SchemeSel] = { selfgcolor, selbgcolor, selbordercolor, selfloatcolor },
- [SchemeTitleNorm] = { titlenormfgcolor, titlenormbgcolor, titlenormbordercolor, titlenormfloatcolor },
- [SchemeTitleSel] = { titleselfgcolor, titleselbgcolor, titleselbordercolor, titleselfloatcolor },
- [SchemeTagsNorm] = { tagsnormfgcolor, tagsnormbgcolor, tagsnormbordercolor, tagsnormfloatcolor },
- [SchemeTagsSel] = { tagsselfgcolor, tagsselbgcolor, tagsselbordercolor, tagsselfloatcolor },
- [SchemeHidNorm] = { hidnormfgcolor, hidnormbgcolor, c000000, c000000 },
- [SchemeHidSel] = { hidselfgcolor, hidselbgcolor, c000000, c000000 },
- [SchemeUrg] = { urgfgcolor, urgbgcolor, urgbordercolor, urgfloatcolor },
- };
- const char *spcmd1[] = {"st", "-n", "spterm", "-g", "120x34", NULL };
- static Sp scratchpads[] = {
- /* name cmd */
- {"spterm", spcmd1},
- };
- static char *tagicons[][NUMTAGS] =
- {
- [DEFAULT_TAGS] = { "", "", "", "", "", "", "", "", "" },
- [ALTERNATIVE_TAGS] = { "A", "B", "C", "D", "E", "F", "G", "H", "I" },
- [ALT_TAGS_DECORATION] = { "", "", "", "", "", "", "", "", "" },
- };
- /* xprop(1):
- * WM_CLASS(STRING) = instance, class
- * WM_NAME(STRING) = title
- * WM_WINDOW_ROLE(STRING) = role
- * _NET_WM_WINDOW_TYPE(ATOM) = wintype
- */
- static const Rule rules[] = {
- RULE(.wintype = WTYPE "DIALOG", .isfloating = 1)
- RULE(.wintype = WTYPE "UTILITY", .isfloating = 1)
- RULE(.wintype = WTYPE "TOOLBAR", .isfloating = 1)
- RULE(.wintype = WTYPE "SPLASH", .isfloating = 1)
- RULE(.class = "Gimp", .tags = 1 << 8, .switchtag = 1)
- RULE(.class = "firefox", .tags = 1, .switchtag = 1)
- RULE(.class = "qutebrowser", .tags = 1, .switchtag = 1)
- RULE(.class = "transmission-gtk", .tags = 1 << 2)
- RULE(.class = "Nicotine", .tags = 1 << 2, .switchtag = 1)
- RULE(.class = "ncmpcpp", .tags = 1 << 3, .switchtag = 1)
- RULE(.class = "Thunar", .tags = 1 << 4, .switchtag = 1)
- RULE(.class = "Sxiv", .tags = 1 << 4, .isfloating = 1, .iscentered = 1, .switchtag = 1)
- RULE(.class = "Nsxiv", .tags = 1 << 4, .isfloating = 1, .iscentered = 1, .switchtag = 1)
- RULE(.class = "mpv", .tags = 1 << 4, .isfloating = 1, .iscentered = 1, .switchtag = 1)
- RULE(.class = "File-roller", .tags = 1 << 4, .isfloating = 1, .iscentered = 1)
- RULE(.class = "Subl", .tags = 1 << 6, .switchtag = 1)
- RULE(.class = "nano", .tags = 1 << 6, .switchtag = 1)
- RULE(.class = "Toolkit", .title = "Picture-in-Picture", .wintype = "_NET_WM_WINDOW_TYPE_UTILITY", .tags = 0, .isfloating = 1, .iscentered = 1)
- RULE(.class = "steam", .tags = 1 << 7, .switchtag = 1,.isfloating = 1, .iscentered = 1)
- RULE(.class = "Easytag", .tags = 1 << 8, .switchtag = 1)
- RULE(.instance = "GtkFileChooserDialog", .title = "Save File", .tags = 0, .isfloating = 1, .iscentered = 1)
- RULE(.instance = "spterm", .tags = SPTAG(0), .isfloating = 1)
- RULE(.wintype = "About Mozilla Firefox", .tags = 0, .isfloating = 1, .iscentered = 1)
- RULE(.wintype = "_NET_WM_WINDOW_TYPE_DIALOG", .title = "File Operation Progress", .tags = 0, .isfloating = 1, .iscentered = 1)
- RULE(.wintype = "_NET_WM_WINDOW_TYPE_UTILITY", .title = "Picture-in-Picture", .tags = 0, .isfloating = 1, .iscentered = 1)
- };
- static const BarRule barrules[] = {
- /* monitor bar alignment widthfunc drawfunc clickfunc hoverfunc name */
- { -1, 0, BAR_ALIGN_LEFT, width_tags, draw_tags, click_tags, hover_tags, "tags" },
- { -1, 0, BAR_ALIGN_LEFT, width_ltsymbol, draw_ltsymbol, click_ltsymbol, NULL, "layout" },
- { statusmon, 0, BAR_ALIGN_RIGHT, width_status2d, draw_status2d, click_status2d, NULL, "status2d" },
- { -1, 0, BAR_ALIGN_NONE, width_awesomebar, draw_awesomebar, click_awesomebar, NULL, "awesomebar" },
- };
- /* layout(s) */
- static const float mfact = 0.50; /* factor of master area size [0.05..0.95] */
- static const int nmaster = 1; /* number of clients in master area */
- static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */
- static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
- static const Layout layouts[] = {
- /* symbol arrange function */
- { "", dwindle }, /* first entry is default */
- { "", tile },
- { "", NULL }, /* no layout function means floating behavior */
- { "", monocle },
- };
- /* 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} },
- /* 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_history", NULL};
- static const char *termcmd[] = { "st", NULL };
- #define APP_BROWSER "firefox"
- #define APP_QUTE "qutebrowser"
- #define APP_MUSIC "st -c ncmpcpp -e ncmpcpp"
- #define APP_MPDTOG "mpc toggle"
- #define APP_FILE "thunar"
- #define APP_EDIT "subl"
- #define APP_VOLU "/home/dobbie/.bin/volume up"
- #define APP_VOLD "/home/dobbie/.bin/volume down"
- #define APP_EXIT "/usr/bin/dmenu_logout"
- #define APP_MAIM "/home/dobbie/.bin/ss.sh"
- #define APP_MAIMS "/home/dobbie/.bin/sss.sh"
- #define APP_DUNSTHIST "dunstctl history-pop"
- #define APP_DUNSTCLOSE "dunstctl close"
- #define APP_LOCK "slock"
- #define APP_NANO "st -c nano -e nano"
- #include <X11/XF86keysym.h>
- static const Key keys[] = {
- /* modifier key function argument */
- { MODKEY, XK_space, spawn, {.v = dmenucmd } },
- { MODKEY, XK_t, spawn, {.v = termcmd } },
- { MODKEY, XK_w, spawn, SHCMD(APP_BROWSER) },
- { MODKEY|ShiftMask, XK_w, spawn, SHCMD(APP_QUTE) },
- { MODKEY, XK_m, spawn, SHCMD(APP_MUSIC) },
- { MODKEY, XK_e, spawn, SHCMD(APP_EDIT) },
- { MODKEY|ShiftMask, XK_e, spawn, SHCMD(APP_NANO) },
- { 0, XK_Print, spawn, SHCMD(APP_MAIM) },
- { 0|ShiftMask, XK_Print, spawn, SHCMD(APP_MAIMS) },
- { MODKEY, XK_Escape, spawn, SHCMD(APP_MPDTOG) },
- { 0, XF86XK_AudioPlay, spawn, SHCMD(APP_MPDTOG) },
- { 0, XF86XK_AudioRaiseVolume, spawn, SHCMD(APP_VOLU) },
- { 0, XF86XK_AudioLowerVolume, spawn, SHCMD(APP_VOLD) },
- { MODKEY|ShiftMask, XK_r, spawn, SHCMD(APP_EXIT) },
- { MODKEY, XK_f, spawn, SHCMD(APP_FILE) },
- { MODKEY, XK_l, spawn, SHCMD(APP_LOCK) },
- { ControlMask, XK_grave, spawn, SHCMD(APP_DUNSTHIST) },
- { ControlMask, XK_space, spawn, SHCMD(APP_DUNSTCLOSE) },
- { MODKEY, XK_b, togglebar, {0} },
- { MODKEY|ControlMask, XK_space, focusmaster, {0} },
- { MODKEY|ShiftMask, XK_j, rotatestack, {.i = +1 } },
- { MODKEY|ShiftMask, XK_k, rotatestack, {.i = -1 } },
- { MODKEY, XK_j, focusstack, {.i = +1 } },
- { MODKEY, XK_k, focusstack, {.i = -1 } },
- { MODKEY, XK_i, incnmaster, {.i = +1 } },
- { MODKEY, XK_d, incnmaster, {.i = -1 } },
- { MODKEY, XK_h, setmfact, {.f = -0.05} },
- { MODKEY|ControlMask, XK_l, setmfact, {.f = +0.05} },
- { MODKEY, XK_Return, zoom, {0} },
- { MODKEY|Mod4Mask, XK_u, incrgaps, {.i = +1 } },
- { MODKEY|Mod4Mask|ShiftMask, XK_u, incrgaps, {.i = -1 } },
- { MODKEY|Mod4Mask, XK_i, incrigaps, {.i = +1 } },
- { MODKEY|Mod4Mask|ShiftMask, XK_i, incrigaps, {.i = -1 } },
- { MODKEY|Mod4Mask, XK_o, incrogaps, {.i = +1 } },
- { MODKEY|Mod4Mask|ShiftMask, XK_o, incrogaps, {.i = -1 } },
- { MODKEY|Mod4Mask, XK_6, incrihgaps, {.i = +1 } },
- { MODKEY|Mod4Mask|ShiftMask, XK_6, incrihgaps, {.i = -1 } },
- { MODKEY|Mod4Mask, XK_7, incrivgaps, {.i = +1 } },
- { MODKEY|Mod4Mask|ShiftMask, XK_7, incrivgaps, {.i = -1 } },
- { MODKEY|Mod4Mask, XK_8, incrohgaps, {.i = +1 } },
- { MODKEY|Mod4Mask|ShiftMask, XK_8, incrohgaps, {.i = -1 } },
- { MODKEY|Mod4Mask, XK_9, incrovgaps, {.i = +1 } },
- { MODKEY|Mod4Mask|ShiftMask, XK_9, incrovgaps, {.i = -1 } },
- { MODKEY|Mod4Mask, XK_0, togglegaps, {0} },
- { MODKEY|Mod4Mask|ShiftMask, XK_0, defaultgaps, {0} },
- { Mod1Mask, XK_Tab, alttabstart, {0} },
- { MODKEY|ControlMask, XK_z, showhideclient, {0} },
- { MODKEY, XK_q, killclient, {0} },
- { MODKEY|ShiftMask, XK_q, quit, {0} },
- { MODKEY|ControlMask|ShiftMask, XK_q, quit, {1} },
- { MODKEY, XK_u, focusurgent, {0} },
- { MODKEY|ShiftMask, XK_F5, xrdb, {.v = NULL } },
- { MODKEY|ShiftMask, XK_t, setlayout, {.v = &layouts[0]} },
- { MODKEY|ControlMask, XK_f, setlayout, {.v = &layouts[1]} },
- { MODKEY|ControlMask, XK_m, setlayout, {.v = &layouts[2]} },
- { MODKEY|ControlMask|ShiftMask, XK_space, setlayout, {0} },
- { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
- { MODKEY, XK_s, togglescratch, {.ui = 0 } },
- { MODKEY|ControlMask, XK_s, setscratch, {.ui = 0 } },
- { MODKEY|ShiftMask, XK_s, removescratch, {.ui = 0 } },
- { MODKEY, XK_0, view, {.ui = ~SPTAGMASK } },
- { MODKEY|ShiftMask, XK_0, tag, {.ui = ~SPTAGMASK } },
- { 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 } },
- { MODKEY, XK_n, togglealttag, {0} },
- { MODKEY|ControlMask, XK_minus, setborderpx, {.i = -1 } },
- { MODKEY|ControlMask, XK_plus, setborderpx, {.i = +1 } },
- { MODKEY|ControlMask, XK_numbersign, setborderpx, {.i = 0 } },
- 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)
- TAGKEYS( XK_0, 9)
- };
- /* button definitions */
- /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
- static const Button buttons[] = {
- /* click event mask button function argument */
- { ClkLtSymbol, 0, Button1, setlayout, {0} },
- { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
- { ClkWinTitle, 0, Button1, togglewin, {0} },
- { ClkWinTitle, 0, Button3, showhideclient, {0} },
- { ClkWinTitle, 0, Button2, zoom, {0} },
- { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
- { ClkClientWin, MODKEY, Button1, movemouse, {0} },
- { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
- { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
- { ClkClientWin, MODKEY, Button4, rotatestack, {.i = +1 } },
- { ClkClientWin, MODKEY, Button5, rotatestack, {.i = -1 } },
- { ClkTagBar, 0, Button1, view, {0} },
- { ClkTagBar, 0, Button3, toggleview, {0} },
- { ClkTagBar, MODKEY, Button1, tag, {0} },
- { ClkTagBar, MODKEY, Button3, toggletag, {0} },
- };
|