finished configuration work

This commit is contained in:
Luca Bilke 2024-02-03 15:38:38 +01:00
parent aeef7c9a17
commit 8a5b95e117
No known key found for this signature in database
GPG Key ID: AD6630D0A1E650AC
3 changed files with 313 additions and 289 deletions

596
config.h
View File

@ -1,25 +1,24 @@
/* See LICENSE file for copyright and license details. */ /* See LICENSE file for copyright and license details. */
#define TERMINAL "st" #define TERM "st"
#define TERMINAL_FLAG_NAME "-n" #define TERM_FLAG_NAME "-n"
#define TERMINAL_FLAG_EXEC "-e" #define TERM_FLAG_EXEC "-e"
#define TERM_START "tmux"
#define STATUSBAR "dwmblocks"
#define BROWSER "brave-browser" #define BROWSER "brave-browser"
#define BROWSER_FLAG_INCOG "" #define BROWSER_FLAG_INCOG ""
#define BROWSER_FLAG_1 "--enable-blink-features=MiddleClickAutoscroll" #define BROWSER_FLAG_1 "--enable-blink-features=MiddleClickAutoscroll"
#define PLAYERCTL(client, command) {.v = (const char *[]){"playerctl", "-p", client, command, NULL}}
/* appearance */ /* appearance */
static const unsigned int borderpx = 1; /* border pixel of windows */ static const unsigned int borderpx = 2;
static const unsigned int snap = 20; /* snap pixel */ static const unsigned int snap = 33;
static const int swallowfloating = 0; /* 1 means swallow floating windows by default */ static const int swallowfloating = 1;
static const int showbar = 1; /* 0 means no bar */ static const int showbar = 1;
static const int topbar = 1; /* 0 means bottom bar */ static const int topbar = 1;
static const int focusonwheel = 0; static const int focusonwheel = 1;
static int floatposgrid_x = 5; /* float grid columns */ static int floatposgrid_x = 5;
static int floatposgrid_y = 5; /* float grid rows */ static int floatposgrid_y = 3;
/* Status is to be shown on: -1 (all monitors), 0 (a specific monitor by index), 'A' (active monitor) */
static const int statusmon = 'A';
static const unsigned int systrayspacing = 0; /* systray spacing */ static const unsigned int systrayspacing = 0; /* systray spacing */
static const int showsystray = 1; /* 0 means no systray */ static const int showsystray = 1; /* 0 means no systray */
static const char ptagf[] = "[%s %s]"; /* format of a tag label */ static const char ptagf[] = "[%s %s]"; /* format of a tag label */
@ -30,7 +29,6 @@ static const unsigned int ulinestroke = 2; /* thickness / height of the und
static const unsigned int ulinevoffset = 4; /* how far above the bottom of the bar the line should appear */ static const unsigned int ulinevoffset = 4; /* how far above the bottom of the bar the line should appear */
static const int ulineall = 0; /* 1 to show underline on all tags, 0 for just the active ones */ static const int ulineall = 0; /* 1 to show underline on all tags, 0 for just the active ones */
/* alt-tab configuration */ /* 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 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 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 */
@ -121,125 +119,86 @@ static char scratchnormfloatcolor[] = BORDERNORM;
static const unsigned int baralpha = 0xcc; static const unsigned int baralpha = 0xcc;
static const unsigned int borderalpha = OPAQUE; static const unsigned int borderalpha = OPAQUE;
static const unsigned int alphas[][3] = { static const unsigned int alphas[][3] = {
/* fg bg border */ /* fg bg border */
[SchemeNorm] = { OPAQUE, baralpha, borderalpha }, [SchemeNorm] = { OPAQUE, baralpha, borderalpha },
[SchemeSel] = { OPAQUE, baralpha, borderalpha }, [SchemeSel] = { OPAQUE, baralpha, borderalpha },
[SchemeTitleNorm] = { OPAQUE, baralpha, borderalpha }, [SchemeTitleNorm] = { OPAQUE, baralpha, borderalpha },
[SchemeTitleSel] = { OPAQUE, baralpha, borderalpha }, [SchemeTitleSel] = { OPAQUE, baralpha, borderalpha },
[SchemeTagsNorm] = { OPAQUE, baralpha, borderalpha }, [SchemeTagsNorm] = { OPAQUE, baralpha, borderalpha },
[SchemeTagsSel] = { OPAQUE, OPAQUE, borderalpha }, [SchemeTagsSel] = { OPAQUE, OPAQUE, borderalpha },
[SchemeHidNorm] = { OPAQUE, baralpha, borderalpha }, [SchemeHidNorm] = { OPAQUE, baralpha, borderalpha },
[SchemeHidSel] = { OPAQUE, baralpha, borderalpha }, [SchemeHidSel] = { OPAQUE, baralpha, borderalpha },
[SchemeUrg] = { OPAQUE, OPAQUE, borderalpha }, [SchemeUrg] = { OPAQUE, OPAQUE, borderalpha },
[SchemeScratchSel] = { OPAQUE, baralpha, borderalpha }, [SchemeScratchSel] = { OPAQUE, baralpha, borderalpha },
[SchemeScratchNorm] = { OPAQUE, baralpha, borderalpha }, [SchemeScratchNorm] = { OPAQUE, baralpha, borderalpha },
}; };
static char *colors[][ColCount] = { static char *colors[][ColCount] = {
/* fg bg border float */ /* fg bg border float */
[SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor, normfloatcolor }, [SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor, normfloatcolor },
[SchemeSel] = { selfgcolor, selbgcolor, selbordercolor, selfloatcolor }, [SchemeSel] = { selfgcolor, selbgcolor, selbordercolor, selfloatcolor },
[SchemeTitleNorm] = { titlenormfgcolor, titlenormbgcolor, titlenormbordercolor, titlenormfloatcolor }, [SchemeTitleNorm] = { titlenormfgcolor, titlenormbgcolor, titlenormbordercolor, titlenormfloatcolor },
[SchemeTitleSel] = { titleselfgcolor, titleselbgcolor, titleselbordercolor, titleselfloatcolor }, [SchemeTitleSel] = { titleselfgcolor, titleselbgcolor, titleselbordercolor, titleselfloatcolor },
[SchemeTagsNorm] = { tagsnormfgcolor, tagsnormbgcolor, tagsnormbordercolor, tagsnormfloatcolor }, [SchemeTagsNorm] = { tagsnormfgcolor, tagsnormbgcolor, tagsnormbordercolor, tagsnormfloatcolor },
[SchemeTagsSel] = { tagsselfgcolor, tagsselbgcolor, tagsselbordercolor, tagsselfloatcolor }, [SchemeTagsSel] = { tagsselfgcolor, tagsselbgcolor, tagsselbordercolor, tagsselfloatcolor },
[SchemeHidNorm] = { hidnormfgcolor, hidnormbgcolor, NOCOLOR, NOCOLOR }, [SchemeHidNorm] = { hidnormfgcolor, hidnormbgcolor, NOCOLOR, NOCOLOR },
[SchemeHidSel] = { hidselfgcolor, hidselbgcolor, NOCOLOR, NOCOLOR }, [SchemeHidSel] = { hidselfgcolor, hidselbgcolor, NOCOLOR, NOCOLOR },
[SchemeUrg] = { urgfgcolor, urgbgcolor, urgbordercolor, urgfloatcolor }, [SchemeUrg] = { urgfgcolor, urgbgcolor, urgbordercolor, urgfloatcolor },
[SchemeScratchSel] = { scratchselfgcolor, scratchselbgcolor, scratchselbordercolor, scratchselfloatcolor }, [SchemeScratchSel] = { scratchselfgcolor, scratchselbgcolor, scratchselbordercolor, scratchselfloatcolor },
[SchemeScratchNorm] = { scratchnormfgcolor, scratchnormbgcolor, scratchnormbordercolor, scratchnormfloatcolor }, [SchemeScratchNorm] = { scratchnormfgcolor, scratchnormbgcolor, scratchnormbordercolor, scratchnormfloatcolor },
}; };
#define AUTOSHELL(command) "sh", "-c", command, NULL static const char *layoutmenu_cmd = "xmenulayout";
// static const char *layoutxmenu = "$HOME/.local/libexec/dwm/xmenulayout"; // TODO: Patch layoutmenu to accept arguments
// static const char *layoutdmenu = "$HOME/.local/libexec/dwm/dmenulayout"; // TODO: Patch layoutmenu to accept shell commands
static const char *const autostart[] = { static const char *const autostart[] = {
AUTOSHELL("exec runsvdir $SVDIR"), "exec runsvdir $SVDIR", NULL,
AUTOSHELL("$XDG_CONFIG_HOME/dwm/default.sh"), "sh", "-c", "$XDG_CONFIG_HOME/dwm/autostart.sh", NULL,
AUTOSHELL("gpgconf --launch gpg-agent"), "sh", "-c", "$XDG_CONFIG_HOME/dwm/start.sh gpgconf --launch gpg-agent", NULL,
AUTOSHELL("$XDG_CONFIG_HOME/dwm/start pipewire"), "sh", "-c", "$XDG_CONFIG_HOME/dwm/start.sh pipewire", NULL,
AUTOSHELL("$XDG_CONFIG_HOME/dwm/start dwmblocks"), "sh", "-c", "$XDG_CONFIG_HOME/dwm/start.sh dwmblocks", NULL,
AUTOSHELL("$XDG_CONFIG_HOME/dwm/start dunst"), "sh", "-c", "$XDG_CONFIG_HOME/dwm/start.sh dunst", NULL,
NULL /* terminate */ NULL
}; };
static const char *spterm[] = { "t", TERMINAL, "-n", "spterm", "tmux", NULL }; static const char *spterm[] = { "t", TERM, "-n", "spterm", TERM_FLAG_EXEC, "tmux", NULL };
static const char *splf[] = { "l", TERMINAL, "-n", "splf", "-e", "lf-sixel", NULL }; static const char *spfile[] = { "l", TERM, "-n", "spfile", TERM_FLAG_EXEC, "lf-sixel", NULL };
static const char *sphtop[] = { "h", TERMINAL, "-n", "sphtop", "-e", "htop", NULL }; static const char *spproc[] = { "h", TERM, "-n", "sphtop", TERM_FLAG_EXEC, "htop", NULL };
static const char *spmix[] = { "m", TERMINAL, "-n", "spmix", "-e", "pulsemixer", NULL }; static const char *spvolm[] = { "m", TERM, "-n", "spvolm", TERM_FLAG_EXEC, "pulsemixer", NULL };
static const char *sphelp[] = { "n", TERMINAL, "-n", "sphelp", "-e", "/bin/sh", "-c", "glow /usr/share/dwm/dwm.md | less", NULL }; static const char *sphelp[] = { "n", TERM, "-n", "sphelp", TERM_FLAG_EXEC, "/bin/sh", "-c", "glow -p -s $XDG_CONFIG_HOME/glow/style.json /usr/share/dwm/dwm.md", NULL };
static const char *spnmtui[] = { "i", TERMINAL, "-n", "spnmtui", "-e", "nmtui", NULL }; static const char *spinet[] = { "i", TERM, "-n", "spinet", TERM_FLAG_EXEC, "nmtui", NULL };
static const char *spwiki[] = { "v", TERMINAL, "-n", "spwiki", "-e", "zk", "edit", "-i", NULL }; static const char *spwiki[] = { "v", TERM, "-n", "spwiki", TERM_FLAG_EXEC, "zk", "edit", "-i", NULL };
static const char *spcalc[] = { "c", TERM, "-n", "spcalc", TERM_FLAG_EXEC, "bc", "-li", NULL };
/* Tags
* In a traditional dwm the number of tags in use can be changed simply by changing the number
* of strings in the tags array. This build does things a bit different which has some added
* benefits. If you need to change the number of tags here then change the NUMTAGS macro in dwm.c.
*
* Examples:
*
* 1) static char *tagicons[][NUMTAGS*2] = {
* [DEFAULT_TAGS] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I" },
* }
*
* 2) static char *tagicons[][1] = {
* [DEFAULT_TAGS] = { "" },
* }
*
* The first example would result in the tags on the first monitor to be 1 through 9, while the
* tags for the second monitor would be named A through I. A third monitor would start again at
* 1 through 9 while the tags on a fourth monitor would also be named A through I. Note the tags
* count of NUMTAGS*2 in the array initialiser which defines how many tag text / icon exists in
* the array. This can be changed to *3 to add separate icons for a third monitor.
*
* For the second example each tag would be represented as a bullet point. Both cases work the
* same from a technical standpoint - the icon index is derived from the tag index and the monitor
* index. If the icon index is is greater than the number of tag icons then it will wrap around
* until it an icon matches. Similarly if there are two tag icons then it would alternate between
* them. This works seamlessly with alternative tags and alttagsdecoration patches.
*/
static char *tagicons[][NUMTAGS] = static char *tagicons[][NUMTAGS] =
{ {
[DEFAULT_TAGS] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }, [DEFAULT_TAGS] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" },
[ALTERNATIVE_TAGS] = { "A", "B", "C", "D", "E", "F", "G", "H", "I" },
[ALT_TAGS_DECORATION] = { "[1]", "[2]", "[3]", "[4]", "[5]", "[6]", "[7]", "[8]", "[9]" },
}; };
/* There are two options when it comes to per-client rules:
* - a typical struct table or
* - using the RULE macro
*
* A traditional struct table looks like this:
* // class instance title wintype tags mask isfloating monitor
* { "Gimp", NULL, NULL, NULL, 1 << 4, 0, -1 },
* { "Firefox", NULL, NULL, NULL, 1 << 7, 0, -1 },
*
* The RULE macro has the default values set for each field allowing you to only
* specify the values that are relevant for your rule, e.g.
*
* RULE(.class = "Gimp", .tags = 1 << 4)
* RULE(.class = "Firefox", .tags = 1 << 7)
*
* Refer to the Rule struct definition for the list of available fields depending on
* the patches you enable.
*/
static const Rule rules[] = { static const Rule rules[] = {
/* xprop(1): /* xprop(1):
* WM_CLASS(STRING) = instance, class * WM_CLASS(STRING) = instance, class
* WM_NAME(STRING) = title * WM_NAME(STRING) = title
* WM_WINDOW_ROLE(STRING) = role * WM_WINDOW_ROLE(STRING) = role
* _NET_WM_WINDOW_TYPE(ATOM) = wintype * _NET_WM_WINDOW_TYPE(ATOM) = wintype
*/ */
RULE(.wintype = WTYPE "DIALOG", .isfloating = 1) RULE(.wintype = WTYPE "DIALOG", .isfloating = 1)
RULE(.wintype = WTYPE "UTILITY", .isfloating = 1) RULE(.wintype = WTYPE "UTILITY", .isfloating = 1)
RULE(.wintype = WTYPE "TOOLBAR", .isfloating = 1) RULE(.wintype = WTYPE "TOOLBAR", .isfloating = 1)
RULE(.wintype = WTYPE "SPLASH", .isfloating = 1) RULE(.wintype = WTYPE "SPLASH", .isfloating = 1)
RULE(.class = "Gimp", .tags = 1 << 4) RULE(.title = "Event Tester", .noswallow = 1)
RULE(.class = "Firefox", .tags = 1 << 7) RULE(.class = "St", .isterminal = 1)
RULE(.instance = "spterm", .scratchkey = 's', .isfloating = 1) RULE(.instance = "sphelp", .scratchkey = 'h', .isfloating = 1, .floatpos = "50% 50% 40% 80%")
RULE(.instance = "spcalc", .scratchkey = 'c', .isfloating = 1, .floatpos = "50% 50% 40% 80%")
RULE(.instance = "spterm", .scratchkey = 't', .isfloating = 1, .floatpos = "50% 50% 80% 80%")
RULE(.instance = "spfile", .scratchkey = 'f', .isfloating = 1, .floatpos = "50% 50% 80% 80%")
RULE(.instance = "spproc", .scratchkey = 'p', .isfloating = 1, .floatpos = "50% 50% 80% 80%")
RULE(.instance = "spwiki", .scratchkey = 'w', .isfloating = 1, .floatpos = "50% 50% 80% 80%")
RULE(.instance = "spvolm", .scratchkey = 'v', .isfloating = 1, .floatpos = "-4x -4y 900W 600H")
RULE(.instance = "spinet", .scratchkey = 'i', .isfloating = 1, .floatpos = "-4x -4y 800W 800H")
}; };
/* Bar rules allow you to configure what is shown where on the bar, as well as /* Bar rules allow you to configure what is shown where on the bar, as well as
* introducing your own bar modules. * introducing your own bar modules.
* *
@ -253,13 +212,13 @@ static const Rule rules[] = {
* name - does nothing, intended for visual clue and for logging / debugging * name - does nothing, intended for visual clue and for logging / debugging
*/ */
static const BarRule barrules[] = { static const BarRule barrules[] = {
/* monitor bar alignment widthfunc drawfunc clickfunc hoverfunc name */ /* 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_tags, draw_tags, click_tags, hover_tags, "tags" },
{ -1, 0, BAR_ALIGN_LEFT, width_taglabels, draw_taglabels, click_taglabels, hover_taglabels, "taglabels" }, { -1, 0, BAR_ALIGN_LEFT, width_taglabels, draw_taglabels, click_taglabels, hover_taglabels, "taglabels" },
{ 0, 0, BAR_ALIGN_RIGHT, width_systray, draw_systray, click_systray, NULL, "systray" }, { 'A', 0, BAR_ALIGN_RIGHT, width_systray, draw_systray, click_systray, NULL, "systray" },
{ -1, 0, BAR_ALIGN_LEFT, width_ltsymbol, draw_ltsymbol, click_ltsymbol, NULL, "layout" }, { -1, 0, BAR_ALIGN_LEFT, width_ltsymbol, draw_ltsymbol, click_ltsymbol, NULL, "layout" },
{ statusmon, 0, BAR_ALIGN_RIGHT, width_status, draw_status, click_statuscmd, NULL, "status" }, { 'A', 0, BAR_ALIGN_RIGHT, width_status, draw_status, click_statuscmd, NULL, "status" },
{ -1, 0, BAR_ALIGN_NONE, width_wintitle, draw_wintitle, click_wintitle, NULL, "wintitle" }, { -1, 0, BAR_ALIGN_NONE, width_wintitle, draw_wintitle, click_wintitle, NULL, "wintitle" },
}; };
/* layout(s) */ /* layout(s) */
@ -273,185 +232,250 @@ static const int decorhints = 1; /* 1 means respect decoration hints */
static const Layout layouts[] = { static const Layout layouts[] = {
/* symbol arrange function, { nmaster, nstack, layout, master axis, stack axis, secondary stack axis, symbol func } */ /* symbol arrange function, { nmaster, nstack, layout, master axis, stack axis, secondary stack axis, symbol func } */
{ "[]=", flextile, { -1, -1, SPLIT_VERTICAL, TOP_TO_BOTTOM, TOP_TO_BOTTOM, 0, NULL } }, // default tile layout { "[]=", flextile, { -1, -1, SPLIT_VERTICAL, TOP_TO_BOTTOM, TOP_TO_BOTTOM, 0, NULL } }, // default tile layout
{ "><>", NULL, {0} }, /* no layout function means floating behavior */ { "><>", NULL, {0} }, /* no layout function means floating behavior */
{ "[M]", flextile, { -1, -1, NO_SPLIT, MONOCLE, MONOCLE, 0, NULL } }, // monocle { "[M]", flextile, { -1, -1, NO_SPLIT, MONOCLE, MONOCLE, 0, NULL } }, // monocle
{ "|||", flextile, { -1, -1, SPLIT_VERTICAL, LEFT_TO_RIGHT, TOP_TO_BOTTOM, 0, NULL } }, // columns (col) layout { "|||", flextile, { -1, -1, SPLIT_VERTICAL, LEFT_TO_RIGHT, TOP_TO_BOTTOM, 0, NULL } }, // columns (col) layout
{ ">M>", flextile, { -1, -1, FLOATING_MASTER, LEFT_TO_RIGHT, LEFT_TO_RIGHT, 0, NULL } }, // floating master { ">M>", flextile, { -1, -1, FLOATING_MASTER, LEFT_TO_RIGHT, LEFT_TO_RIGHT, 0, NULL } }, // floating master
{ "[D]", flextile, { -1, -1, SPLIT_VERTICAL, TOP_TO_BOTTOM, MONOCLE, 0, NULL } }, // deck { "[D]", flextile, { -1, -1, SPLIT_VERTICAL, TOP_TO_BOTTOM, MONOCLE, 0, NULL } }, // deck
{ "TTT", flextile, { -1, -1, SPLIT_HORIZONTAL, LEFT_TO_RIGHT, LEFT_TO_RIGHT, 0, NULL } }, // bstack { "TTT", flextile, { -1, -1, SPLIT_HORIZONTAL, LEFT_TO_RIGHT, LEFT_TO_RIGHT, 0, NULL } }, // bstack
{ "===", flextile, { -1, -1, SPLIT_HORIZONTAL, LEFT_TO_RIGHT, TOP_TO_BOTTOM, 0, NULL } }, // bstackhoriz { "===", flextile, { -1, -1, SPLIT_HORIZONTAL, LEFT_TO_RIGHT, TOP_TO_BOTTOM, 0, NULL } }, // bstackhoriz
{ "|M|", flextile, { -1, -1, SPLIT_CENTERED_VERTICAL, LEFT_TO_RIGHT, TOP_TO_BOTTOM, TOP_TO_BOTTOM, NULL } }, // centeredmaster { "|M|", flextile, { -1, -1, SPLIT_CENTERED_VERTICAL, LEFT_TO_RIGHT, TOP_TO_BOTTOM, TOP_TO_BOTTOM, NULL } }, // centeredmaster
{ "-M-", flextile, { -1, -1, SPLIT_CENTERED_HORIZONTAL, TOP_TO_BOTTOM, LEFT_TO_RIGHT, LEFT_TO_RIGHT, NULL } }, // centeredmaster horiz { "-M-", flextile, { -1, -1, SPLIT_CENTERED_HORIZONTAL, TOP_TO_BOTTOM, LEFT_TO_RIGHT, LEFT_TO_RIGHT, NULL } }, // centeredmaster horiz
{ ":::", flextile, { -1, -1, NO_SPLIT, GAPPLESSGRID, GAPPLESSGRID, 0, NULL } }, // gappless grid { ":::", flextile, { -1, -1, NO_SPLIT, GAPPLESSGRID, GAPPLESSGRID, 0, NULL } }, // gappless grid
{ "[\\]", flextile, { -1, -1, NO_SPLIT, DWINDLE, DWINDLE, 0, NULL } }, // fibonacci dwindle { "[\\]", flextile, { -1, -1, NO_SPLIT, DWINDLE, DWINDLE, 0, NULL } }, // fibonacci dwindle
{ "(@)", flextile, { -1, -1, NO_SPLIT, SPIRAL, SPIRAL, 0, NULL } }, // fibonacci spiral { "(@)", flextile, { -1, -1, NO_SPLIT, SPIRAL, SPIRAL, 0, NULL } }, // fibonacci spiral
{ "[T]", flextile, { -1, -1, SPLIT_VERTICAL, LEFT_TO_RIGHT, TATAMI, 0, NULL } }, // tatami mats { "[T]", flextile, { -1, -1, SPLIT_VERTICAL, LEFT_TO_RIGHT, TATAMI, 0, NULL } }, // tatami mats
{ "[M]", monocle, {0} }, { "[M]", monocle, {0} },
}; };
/* key definitions */ /* key definitions */
#define MODKEY Mod1Mask #define MODKEY Mod4Mask
#define TAGKEYS(KEY,TAG) \ #define TAGKEYS(KEY,TAG) \
{ MODKEY, KEY, comboview, {.ui = 1 << TAG} }, \ { MODKEY, KEY, comboview, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
{ MODKEY|ShiftMask, KEY, combotag, {.ui = 1 << TAG} }, \ { MODKEY|ShiftMask, KEY, combotag, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }
#define STACKKEYS(MOD,ACTION) \
{ MOD, XK_j, ACTION##stack, {.i = INC(+1) } }, \
{ MOD, XK_k, ACTION##stack, {.i = INC(-1) } }, \
{ MOD, XK_s, ACTION##stack, {.i = PREVSEL } }, \
{ MOD, XK_w, ACTION##stack, {.i = 0 } }, \
{ MOD, XK_e, ACTION##stack, {.i = 1 } }, \
{ MOD, XK_a, ACTION##stack, {.i = 2 } }, \
{ MOD, XK_z, ACTION##stack, {.i = -1 } },
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
/* commands */ /* commands */
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
static const char *dmenucmd[] = { static const char *dmenucmd[] = {
"dmenu_run", "dmenu_run",
"-m", dmenumon, "-m", dmenumon,
"-fn", dmenufont, "-fn", dmenufont,
"-nb", normbgcolor, "-nb", normbgcolor,
"-nf", normfgcolor, "-nf", normfgcolor,
"-sb", selbgcolor, "-sb", selbgcolor,
"-sf", selfgcolor, "-sf", selfgcolor,
topbar ? NULL : "-b", topbar ? NULL : "-b",
NULL NULL
}; };
static const char *termcmd[] = { "st", NULL }; static const char *termcmd[] = { TERM, TERM_FLAG_EXEC, TERM_START, NULL };
/* This defines the name of the executable that handles the bar (used for signalling purposes) */
#define STATUSBAR "dwmblocks"
#include <X11/XF86keysym.h>
static const Key keys[] = { static const Key keys[] = {
/* modifier key function argument */ /* modifier key function argument */
{ MODKEY, XK_p, spawn, {.v = dmenucmd } }, { MODKEY, XK_F1, togglescratch, {.v = sphelp} },
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, // { MODKEY | ShiftMask, XK_F1, spawn, {.v = (const char *[]){NULL}} },
{ MODKEY, XK_b, togglebar, {0} }, { MODKEY, XK_F2, spawn, SHCMD("$HOME/.local/libexec/dwm/dmenuhandler") },
STACKKEYS(MODKEY, focus) // { MODKEY | ShiftMask, XK_F2, spawn, {.v = (const char *[]){NULL}} },
STACKKEYS(MODKEY|ShiftMask, push) { MODKEY, XK_F3, spawn, SHCMD("$HOME/.local/libexec/dwm/togtouchpad") },
{ MODKEY, XK_i, incnmaster, {.i = +1 } }, // { MODKEY | ShiftMask, XK_F3, spawn, {.v = (const char *[]){NULL}} },
{ MODKEY, XK_d, incnmaster, {.i = -1 } }, { MODKEY, XK_F4, spawn, SHCMD("$HOME/.local/libexec/dwm/togcompositor") },
{ MODKEY|ControlMask, XK_i, incnstack, {.i = +1 } }, // { MODKEY | ShiftMask, XK_F4, spawn, {.v = (const char *[]){NULL}} },
{ MODKEY|ControlMask, XK_u, incnstack, {.i = -1 } }, { MODKEY, XK_F5, xrdb, {.v = NULL } },
{ MODKEY, XK_h, setmfact, {.f = -0.05} }, // { MODKEY, XK_F6, spawn, {.v = (const char *[]){NULL}} },
{ MODKEY, XK_l, setmfact, {.f = +0.05} }, // { MODKEY | ShiftMask, XK_F6, spawn, {.v = (const char *[]){NULL}} },
{ MODKEY|ShiftMask, XK_h, setcfact, {.f = +0.25} }, // { MODKEY, XK_F7, spawn, {.v = (const char *[]){NULL}} },
{ MODKEY|ShiftMask, XK_l, setcfact, {.f = -0.25} }, // { MODKEY | ShiftMask, XK_F7, spawn, {.v = (const char *[]){NULL}} },
{ MODKEY|ShiftMask, XK_o, setcfact, {0} }, // { MODKEY, XK_F8, spawn, {.v = (const char *[]){NULL}} },
{ MODKEY, XK_Return, zoom, {0} }, // { MODKEY | ShiftMask, XK_F8, spawn, {.v = (const char *[]){NULL}} },
{ Mod1Mask, XK_Tab, alttabstart, {0} }, { MODKEY, XK_F9, spawn, SHCMD("$HOME/.local/libexec/dwm/dmenumount") },
{ MODKEY|ShiftMask, XK_c, killclient, {0} }, // { MODKEY | ShiftMask, XK_F9, spawn, {.v = (const char *[]){NULL}} },
{ MODKEY|ShiftMask, XK_q, quit, {0} }, { MODKEY, XK_F10, spawn, SHCMD("$HOME/.local/libexec/dwm/dmenuumount") },
{ MODKEY|ControlMask|ShiftMask, XK_q, quit, {1} }, // { MODKEY | ShiftMask, XK_F10, spawn, {.v = (const char *[]){NULL}} },
{ MODKEY, XK_o, winview, {0} }, { MODKEY, XK_F11, spawn, SHCMD("$HOME/.local/libexec/dwm/displayselect") },
{ MODKEY|ShiftMask, XK_F5, xrdb, {.v = NULL } }, // { MODKEY | ShiftMask, XK_F11, spawn, {.v = (const char *[]){NULL}} },
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, { MODKEY, XK_F12, spawn, SHCMD("$HOME/.local/libexec/dwm/remaps") },
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, // { MODKEY | ShiftMask, XK_F12, spawn, {.v = (const char *[]){NULL}} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, { MODKEY, XK_grave, spawn, SHCMD("$HOME/.local/libexec/dwm/dmenuunicode --nocopy") },
{ MODKEY|ControlMask, XK_t, rotatelayoutaxis, {.i = +1 } }, /* flextile, 1 = layout axis */ { MODKEY | ShiftMask, XK_grave, spawn, SHCMD("$HOME/.local/libexec/dwm/dmenuunicode") },
{ MODKEY|ControlMask, XK_Tab, rotatelayoutaxis, {.i = +2 } }, /* flextile, 2 = master axis */ TAGKEYS( XK_1, 0),
{ MODKEY|ControlMask|ShiftMask, XK_Tab, rotatelayoutaxis, {.i = +3 } }, /* flextile, 3 = stack axis */ TAGKEYS( XK_2, 1),
{ MODKEY|ControlMask|Mod1Mask, XK_Tab, rotatelayoutaxis, {.i = +4 } }, /* flextile, 4 = secondary stack axis */ TAGKEYS( XK_3, 2),
{ MODKEY|Mod5Mask, XK_t, rotatelayoutaxis, {.i = -1 } }, /* flextile, 1 = layout axis */ TAGKEYS( XK_4, 3),
{ MODKEY|Mod5Mask, XK_Tab, rotatelayoutaxis, {.i = -2 } }, /* flextile, 2 = master axis */ TAGKEYS( XK_5, 4),
{ MODKEY|Mod5Mask|ShiftMask, XK_Tab, rotatelayoutaxis, {.i = -3 } }, /* flextile, 3 = stack axis */ TAGKEYS( XK_6, 5),
{ MODKEY|Mod5Mask|Mod1Mask, XK_Tab, rotatelayoutaxis, {.i = -4 } }, /* flextile, 4 = secondary stack axis */ TAGKEYS( XK_7, 6),
{ MODKEY|ControlMask, XK_Return, mirrorlayout, {0} }, /* flextile, flip master and stack areas */ TAGKEYS( XK_8, 7),
{ MODKEY, XK_space, setlayout, {0} }, TAGKEYS( XK_9, 8),
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} }, { MODKEY, XK_0, view, {.ui = ~0} },
{ MODKEY, XK_grave, togglescratch, {.v = scratchpadcmd } }, { MODKEY | ShiftMask, XK_0, tag, {.ui = ~0} },
{ MODKEY|ControlMask, XK_grave, setscratch, {.v = scratchpadcmd } }, { MODKEY | Mod1Mask, XK_0, winview, {0} },
{ MODKEY|ShiftMask, XK_grave, removescratch, {.v = scratchpadcmd } }, // { MODKEY, XK_bracketleft, spawn, {.v = (const char *[]){NULL}} },
{ MODKEY, XK_y, togglefullscreen, {0} }, // { MODKEY | ShiftMask, XK_bracketleft, spawn, {.v = (const char *[]){NULL}} },
{ MODKEY, XK_0, view, {.ui = ~0 } }, // { MODKEY, XK_bracketright, spawn, {.v = (const char *[]){NULL}} },
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, // { MODKEY | ShiftMask, XK_bracketright, spawn, {.v = (const char *[]){NULL}} },
{ MODKEY, XK_comma, focusmon, {.i = -1 } }, { MODKEY, XK_BackSpace, spawn, SHCMD("$HOME/.local/libexec/dwm/dmenusys") },
{ MODKEY, XK_period, focusmon, {.i = +1 } }, // { MODKEY | ShiftMask, XK_BackSpace, spawn, {.v = (const char *[]){NULL}} },
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, { MODKEY, XK_Tab, alttabstart, {0} },
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, // { MODKEY | ShiftMask, XK_Tab, spawn, {.v = (const char *[]){NULL}} },
/* Note that due to key limitations the below example kybindings are defined with a Mod3Mask, // { MODKEY, XK_apostrophe, spawn, {.v = (const char *[]){NULL}} },
* which is not always readily available. Refer to the patch wiki for more details. */ // { MODKEY | ShiftMask, XK_apostrophe, spawn, {.v = (const char *[]){NULL}} },
/* Client position is limited to monitor window area */ { MODKEY, XK_comma, focusmon, {.i = +1} },
{ Mod3Mask, XK_u, floatpos, {.v = "-26x -26y" } }, // ↖ { MODKEY | ShiftMask, XK_comma, tagmon, {.i = +1} },
{ Mod3Mask, XK_i, floatpos, {.v = " 0x -26y" } }, // ↑ { MODKEY, XK_period, focusmon, {.i = -1} },
{ Mod3Mask, XK_o, floatpos, {.v = " 26x -26y" } }, // ↗ { MODKEY | ShiftMask, XK_period, tagmon, {.i = -1} },
{ Mod3Mask, XK_j, floatpos, {.v = "-26x 0y" } }, // ← { MODKEY, XK_p, spawn, {.v = (const char *[]){"playerctl", "play-pause", NULL}} },
{ Mod3Mask, XK_l, floatpos, {.v = " 26x 0y" } }, // → // { MODKEY | ShiftMask, XK_p, spawn, {.v = (const char *[]){NULL}} },
{ Mod3Mask, XK_m, floatpos, {.v = "-26x 26y" } }, // ↙ // { MODKEY, XK_y, spawn, {.v = (const char *[]){NULL}} },
{ Mod3Mask, XK_comma, floatpos, {.v = " 0x 26y" } }, // ↓ // { MODKEY | ShiftMask, XK_y, spawn, {.v = (const char *[]){NULL}} },
{ Mod3Mask, XK_period, floatpos, {.v = " 26x 26y" } }, // ↘ { MODKEY, XK_f, togglefullscreen, {0} },
/* Absolute positioning (allows moving windows between monitors) */ // { MODKEY | ShiftMask, XK_f, spawn, {.v = (const char *[]){NULL}} },
{ Mod3Mask|ControlMask, XK_u, floatpos, {.v = "-26a -26a" } }, // ↖ { MODKEY, XK_g, cyclelayout, {.i = -1} },
{ Mod3Mask|ControlMask, XK_i, floatpos, {.v = " 0a -26a" } }, // ↑ { MODKEY | ShiftMask, XK_g, rotatelayoutaxis, {.i = -1} },
{ Mod3Mask|ControlMask, XK_o, floatpos, {.v = " 26a -26a" } }, // ↗ { MODKEY, XK_c, setlayout, {.v = &layouts[0]} },
{ Mod3Mask|ControlMask, XK_j, floatpos, {.v = "-26a 0a" } }, // ← // { MODKEY | ShiftMask, XK_c, spawn, {.v = (const char *[]){NULL}} }, /* TODO: reset axis */
{ Mod3Mask|ControlMask, XK_l, floatpos, {.v = " 26a 0a" } }, // → { MODKEY, XK_r, cyclelayout, {.i = +1} },
{ Mod3Mask|ControlMask, XK_m, floatpos, {.v = "-26a 26a" } }, // ↙ { MODKEY | ShiftMask, XK_r, rotatelayoutaxis, {.i = +1} },
{ Mod3Mask|ControlMask, XK_comma, floatpos, {.v = " 0a 26a" } }, // ↓ { MODKEY, XK_l, setmfact, {.f = +0.05} },
{ Mod3Mask|ControlMask, XK_period, floatpos, {.v = " 26a 26a" } }, // ↘ { MODKEY | ShiftMask, XK_l, setcfact, {.f = +0.05} },
/* Resize client, client center position is fixed which means that client expands in all directions */ // { MODKEY, XK_slash, spawn, {.v = (const char *[]){NULL}} },
{ Mod3Mask|ShiftMask, XK_u, floatpos, {.v = "-26w -26h" } }, // ↖ // { MODKEY | ShiftMask, XK_slash, spawn, {.v = (const char *[]){NULL}} },
{ Mod3Mask|ShiftMask, XK_i, floatpos, {.v = " 0w -26h" } }, // ↑ // { MODKEY, XK_equal, spawn, {.v = (const char *[]){NULL}} },
{ Mod3Mask|ShiftMask, XK_o, floatpos, {.v = " 26w -26h" } }, // ↗ // { MODKEY | ShiftMask, XK_equal, spawn, {.v = (const char *[]){NULL}} },
{ Mod3Mask|ShiftMask, XK_j, floatpos, {.v = "-26w 0h" } }, // ← // { MODKEY, XK_a, spawn, {.v = (const char *[]){NULL}} },
{ Mod3Mask|ShiftMask, XK_k, floatpos, {.v = "800W 800H" } }, // · // { MODKEY | ShiftMask, XK_a, spawn, {.v = (const char *[]){NULL}} },
{ Mod3Mask|ShiftMask, XK_l, floatpos, {.v = " 26w 0h" } }, // → { MODKEY, XK_o, togglescratch, {.v = spproc} },
{ Mod3Mask|ShiftMask, XK_m, floatpos, {.v = "-26w 26h" } }, // ↙ // { MODKEY | ShiftMask, XK_o, spawn, {.v = (const char *[]){NULL}} },
{ Mod3Mask|ShiftMask, XK_comma, floatpos, {.v = " 0w 26h" } }, // ↓ { MODKEY, XK_e, togglescratch, {.v = spfile} },
{ Mod3Mask|ShiftMask, XK_period, floatpos, {.v = " 26w 26h" } }, // ↘ // { MODKEY | ShiftMask, XK_e, spawn, {.v = (const char *[]){NULL}} },
/* Client is positioned in a floating grid, movement is relative to client's current position */ { MODKEY, XK_u, spawn, {.v = dmenucmd} },
{ Mod3Mask|Mod1Mask, XK_u, floatpos, {.v = "-1p -1p" } }, // ↖ // { MODKEY | ShiftMask, XK_u, spawn, {.v = (const char *[]){NULL}} },
{ Mod3Mask|Mod1Mask, XK_i, floatpos, {.v = " 0p -1p" } }, // ↑ { MODKEY, XK_i, spawn, {.v = (const char *[]){"dunstctl", "close", NULL}} },
{ Mod3Mask|Mod1Mask, XK_o, floatpos, {.v = " 1p -1p" } }, // ↗ { MODKEY | ShiftMask, XK_i, spawn, {.v = (const char *[]){"dunstctl", "history-pop", NULL}} },
{ Mod3Mask|Mod1Mask, XK_j, floatpos, {.v = "-1p 0p" } }, // ← { MODKEY, XK_d, spawn, {.v = (const char *[]){"dunstctl", "context", NULL}} },
{ Mod3Mask|Mod1Mask, XK_k, floatpos, {.v = " 0p 0p" } }, // · { MODKEY | ShiftMask, XK_d, spawn, {.v = (const char *[]){"dunstctl", "action", "0", NULL}} },
{ Mod3Mask|Mod1Mask, XK_l, floatpos, {.v = " 1p 0p" } }, // → { MODKEY, XK_h, setmfact, {.f = -0.05} },
{ Mod3Mask|Mod1Mask, XK_m, floatpos, {.v = "-1p 1p" } }, // ↙ { MODKEY | ShiftMask, XK_h, setcfact, {.f = -0.05} },
{ Mod3Mask|Mod1Mask, XK_comma, floatpos, {.v = " 0p 1p" } }, // ↓ { MODKEY, XK_t, spawn, {.v = (const char *[]){BROWSER, BROWSER_FLAG_1, NULL}} },
{ Mod3Mask|Mod1Mask, XK_period, floatpos, {.v = " 1p 1p" } }, // ↘ { MODKEY | ShiftMask, XK_t, spawn, {.v = (const char *[]){BROWSER, BROWSER_FLAG_1, BROWSER_FLAG_INCOG, NULL}} },
{ MODKEY|ControlMask, XK_comma, cyclelayout, {.i = -1 } }, { MODKEY, XK_n, focusstack, {.i = PREVSEL} },
{ MODKEY|ControlMask, XK_period, cyclelayout, {.i = +1 } }, { MODKEY | ShiftMask, XK_n, pushstack, {.i = PREVSEL} },
TAGKEYS( XK_1, 0) { MODKEY, XK_s, incnmaster, {.i = +1 } },
TAGKEYS( XK_2, 1) { MODKEY | ShiftMask, XK_s, incnmaster, {.i = -1 } },
TAGKEYS( XK_3, 2) // { MODKEY, XK_minus, spawn, {.v = (const char *[]){NULL}} }, /* TODO: reset nmaster */
TAGKEYS( XK_4, 3) // { MODKEY | ShiftMask, XK_minus, spawn, {.v = (const char *[]){NULL}} },
TAGKEYS( XK_5, 4) // { MODKEY, XK_backslash, spawn, {.v = (const char *[]){NULL}} },
TAGKEYS( XK_6, 5) // { MODKEY | ShiftMask, XK_backslash, spawn, {.v = (const char *[]){NULL}} },
TAGKEYS( XK_7, 6) { MODKEY, XK_Return, zoom, {0} },
TAGKEYS( XK_8, 7) { MODKEY | ShiftMask, XK_Return, mirrorlayout, {0} },
TAGKEYS( XK_9, 8) // { MODKEY, XK_semicolon, spawn, {.v = (const char *[]){NULL}} },
}; // { MODKEY | ShiftMask, XK_semicolon, spawn, {.v = (const char *[]){NULL}} },
{ MODKEY, XK_q, killclient, {0} },
// { MODKEY | ShiftMask, XK_q, spawn, {.v = (const char *[]){NULL}} },
{ MODKEY, XK_j, focusstack, {.i = INC(+1)} },
{ MODKEY | ShiftMask, XK_j, pushstack, {.i = INC(+1)} },
{ MODKEY, XK_k, focusstack, {.i = INC(-1)} },
{ MODKEY | ShiftMask, XK_k, pushstack, {.i = INC(-1)} },
{ MODKEY, XK_x, togglescratch, {.v = spcalc }},
// { MODKEY | ShiftMask, XK_x, spawn, {.v = (const char *[]){NULL}} },
{ MODKEY, XK_b, togglescratch, {.v = spinet} },
// { MODKEY | ShiftMask, XK_b, spawn, {.v = (const char *[]){NULL}} },
{ MODKEY, XK_m, togglescratch, {.v = spvolm} },
// { MODKEY | ShiftMask, XK_m, spawn, {.v = (const char *[]){NULL}} },
{ MODKEY, XK_w, togglescratch, {.v = spwiki} },
// { MODKEY | ShiftMask, XK_w, spawn, {.v = (const char *[]){NULL}} },
// { MODKEY, XK_v, spawn, {.v = (const char *[]){NULL}} },
// { MODKEY | ShiftMask, XK_v, spawn, {.v = (const char *[]){NULL}} },
// { MODKEY, XK_z, spawn, {.v = (const char *[]){NULL}} },
// { MODKEY | ShiftMask, XK_z, spawn, {.v = (const char *[]){NULL}} },
{ MODKEY, XK_space, spawn, {.v = termcmd} },
{ MODKEY | ShiftMask, XK_space, togglescratch, {.v = spterm} },
{ MODKEY, XK_Print, spawn, SHCMD("$HOME/.local/libexec/dwm/dmenurecord") },
{ MODKEY | ShiftMask, XK_Print, spawn, SHCMD("$HOME/.local/libexec/dwm/dmenurecord kill") },
{ 0, XK_Print, spawn, SHCMD("$HOME/.local/libexec/dwm/dmenumaim full") },
{ ShiftMask, XK_Print, spawn, SHCMD("$HOME/.local/libexec/dwm/dmenumaim") },
// { MODKEY, XK_scroll_lock, spawn, {.v = (const char *[]){NULL}} },
// { MODKEY | ShiftMask, XK_scroll_lock, spawn, {.v = (const char *[]){NULL}} },
// { MODKEY, XK_pause, spawn, {.v = (const char *[]){NULL}} },
// { MODKEY | ShiftMask, XK_pause, spawn, {.v = (const char *[]){NULL}} },
// { MODKEY, XK_insert, spawn, {.v = (const char *[]){NULL}} },
// { MODKEY | ShiftMask, XK_insert, spawn, {.v = (const char *[]){NULL}} },
// { MODKEY, XK_home, spawn, {.v = (const char *[]){NULL}} },
// { MODKEY | ShiftMask, XK_home, spawn, {.v = (const char *[]){NULL}} },
// { MODKEY, XK_page_up, spawn, {.v = (const char *[]){NULL}} },
// { MODKEY | ShiftMask, XK_page_up, spawn, {.v = (const char *[]){NULL}} },
// { MODKEY, XK_delete, spawn, {.v = (const char *[]){NULL}} },
// { MODKEY | ShiftMask, XK_delete, spawn, {.v = (const char *[]){NULL}} },
// { MODKEY, XK_End, spawn, {.v = (const char *[]){NULL}} },
{ MODKEY | ShiftMask, XK_End, quit, {0} },
// { MODKEY, XK_page_down, spawn, {.v = (const char *[]){NULL}} },
// { MODKEY | ShiftMask, XK_page_down, spawn, {.v = (const char *[]){NULL}} },
{ MODKEY, XK_Left, spawn, {.v = (const char *[]){"playerctl", "position", "5-", NULL}} },
{ MODKEY | ShiftMask, XK_Left, spawn, {.v = (const char *[]){"playerctl", "previous", NULL}} },
{ MODKEY, XK_Right, spawn, {.v = (const char *[]){"playerctl", "position", "5+", NULL}} },
{ MODKEY | ShiftMask, XK_Right, spawn, {.v = (const char *[]){"playerctl", "next", NULL}} },
{ MODKEY, XK_Up, spawn, SHCMD("$HOME/.local/libexec/pamixer-notify --allow-boost -i 5") },
{ MODKEY | ShiftMask, XK_Up, spawn, {.v = (const char *[]){"playerctl", "volume", "5+", NULL}} },
{ MODKEY, XK_Down, spawn, SHCMD("$HOME/.local/libexec/pamixer-notify --allow-boost -d 5") },
{ MODKEY | ShiftMask, XK_Down, spawn, {.v = (const char *[]){"playerctl", "volume", "5-", NULL}} },
{ 0, XF86XK_AudioMute, spawn, SHCMD("$HOME/.local/libexec/pamixer-notify -t") },
{ 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("$HOME/.local/libexec/pamixer-notify --allow-boost -i 5") },
{ 0, XF86XK_AudioLowerVolume, spawn, SHCMD("$HOME/.local/libexec/pamixer-notify --allow-boost -d 5") },
{ 0, XF86XK_AudioPrev, spawn, {.v = (const char *[]){"playerctl", "previous", NULL}} },
{ 0, XF86XK_AudioNext, spawn, {.v = (const char *[]){"playerctl", "next", NULL}} },
{ 0, XF86XK_AudioPause, spawn, {.v = (const char *[]){"playerctl", "pause", NULL}} },
{ 0, XF86XK_AudioPlay, spawn, {.v = (const char *[]){"playerctl", "play-pause", NULL}} }, // Most keyboards only have a play button
{ 0, XF86XK_AudioStop, spawn, {.v = (const char *[]){"playerctl", "stop", NULL}} },
{ 0, XF86XK_AudioRewind, spawn, {.v = (const char *[]){"playerctl", "position", "5-", NULL}} },
{ 0, XF86XK_AudioForward, spawn, {.v = (const char *[]){"playerctl", "position", "5+", NULL}} },
// { 0, XF86XK_AudioMedia, spawn, {.v = (const char *[]){NULL}} },
{ 0, XF86XK_AudioMicMute, spawn, {.v = (const char *[]){"pactl", "set-source-mute", "@DEFAULT_SOURCE@", "toggle", NULL}} }, /* TODO: Test this */
{ 0, XF86XK_PowerOff, spawn, {.v = (const char *[]){"dmenusys", NULL}} },
{ 0, XF86XK_Calculator, spawn, {.v = (const char *[]){TERM, "-e", "bc", "-li", NULL}} },
{ 0, XF86XK_Sleep, spawn, {.v = (const char *[]){"loginctl", "suspend", "-i", NULL}} },
{ 0, XF86XK_WWW, spawn, {.v = (const char *[]){BROWSER, BROWSER_FLAG_1, NULL}} },
// { 0, XF86XK_WLAN, spawn, {.v = (const char *[]){NULL}} },
{ 0, XF86XK_DOS, spawn, {.v = (const char *[]){TERM, NULL}} },
{ 0, XF86XK_ScreenSaver, spawn, {.v = (const char *[]){"xset", "s", "activate", NULL}} },
{ 0, XF86XK_TaskPane, spawn, {.v = (const char *[]){TERM, "-e", "htop", NULL}} },
// { 0, XF86XK_Mail, spawn, {.v = (const char *[]){NULL}} },
{ 0, XF86XK_MyComputer, spawn, {.v = (const char *[]){TERM, "-e", "lfX", "/", NULL}} },
// { 0, XF86XK_Battery, spawn, {.v = (const char *[]){NULL}} },
// { 0, XF86XK_Launch1, spawn, {.v = (const char *[]){NULL}} },
{ 0, XF86XK_TouchpadToggle, spawn, SHCMD("$HOME/.local/libexec/dwm/togtouchpad") },
{ 0, XF86XK_TouchpadOff, spawn, SHCMD("$HOME/.local/libexec/dwm/togtouchpad -n") },
{ 0, XF86XK_TouchpadOn, spawn, SHCMD("$HOME/.local/libexec/dwm/togtouchpad -y") },
{ 0, XF86XK_MonBrightnessUp, spawn, SHCMD("$HOME/.local/libexec/dwm/brightness-notify +5") },
{ 0, XF86XK_MonBrightnessDown, spawn, SHCMD("$HOME/.local/libexec/dwm/brightness-notify -5") },
/* WARN: If you have multiple backlight controllers this will fail */
};
/* button definitions */ /* button definitions */
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
static const Button buttons[] = { static const Button buttons[] = {
/* click event mask button function argument */ /* click event mask button function argument */
{ ClkLtSymbol, 0, Button1, setlayout, {0} }, { ClkLtSymbol, 0, Button1, layoutmenu, {0} },
{ ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, // { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
{ ClkWinTitle, 0, Button2, zoom, {0} }, // { ClkWinTitle, 0, Button2, zoom, {0} },
{ ClkStatusText, 0, Button1, sigstatusbar, {.i = 1 } }, { ClkStatusText, 0, Button1, sigstatusbar, {.i = 1 } },
{ ClkStatusText, 0, Button2, sigstatusbar, {.i = 2 } }, { ClkStatusText, 0, Button2, sigstatusbar, {.i = 2 } },
{ ClkStatusText, 0, Button3, sigstatusbar, {.i = 3 } }, { ClkStatusText, 0, Button3, sigstatusbar, {.i = 3 } },
{ ClkClientWin, MODKEY, Button1, movemouse, {0} }, { ClkClientWin, MODKEY, Button1, movemouse, {0} },
{ ClkClientWin, MODKEY, Button2, togglefloating, {0} }, { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} }, { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
{ ClkClientWin, MODKEY|ShiftMask, Button3, dragcfact, {0} }, // { ClkClientWin, MODKEY|ShiftMask, Button1, dragmfact, {0} },
{ ClkClientWin, MODKEY|ShiftMask, Button1, dragmfact, {0} }, // { ClkClientWin, MODKEY|ShiftMask, Button3, dragcfact, {0} },
{ ClkTagBar, 0, Button1, view, {0} }, { ClkTagBar, 0, Button1, view, {0} },
{ ClkTagBar, 0, Button3, toggleview, {0} }, { ClkTagBar, 0, Button3, toggleview, {0} },
{ ClkTagBar, MODKEY, Button1, tag, {0} }, // { ClkTagBar, MODKEY, Button1, tag, {0} },
{ ClkTagBar, MODKEY, Button3, toggletag, {0} }, // { ClkTagBar, MODKEY, Button3, toggletag, {0} },
}; };

View File

@ -74,7 +74,7 @@
* - The text of the menu items is for display only. Name them however you want. * - The text of the menu items is for display only. Name them however you want.
* https://dwm.suckless.org/patches/layoutmenu/ * https://dwm.suckless.org/patches/layoutmenu/
*/ */
#define BAR_LAYOUTMENU_PATCH 0 #define BAR_LAYOUTMENU_PATCH 1
/* Show layout symbol in bar */ /* Show layout symbol in bar */
#define BAR_LTSYMBOL_PATCH 1 #define BAR_LTSYMBOL_PATCH 1

4
todo
View File

@ -1,2 +1,2 @@
# TODO: Put this in picom conf: # TODO: Put this in picom conf: `shadow-exclude = [ "! _IS_FLOATING@:32c = 1" ];`
shadow-exclude = [ "! _IS_FLOATING@:32c = 1" ]; # TODO: customize layoutmenu patch