config.h (10223B)
1 /* appearance */ 2 static const int sloppyfocus = 1; /* focus follows mouse */ 3 static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */ 4 static int gaps = 1; /* 1 means gaps between windows are added */ 5 static const unsigned int gappx = 10; /* gap pixel between windows */ 6 static const unsigned int borderpx = 2; /* border pixel of windows */ 7 8 /* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */ 9 static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */ 10 11 /* tagging - TAGCOUNT must be no greater than 31 */ 12 #define TAGCOUNT (9) 13 14 /* logging */ 15 static int log_level = WLR_ERROR; 16 17 static const Rule rules[] = { 18 /* app_id title tags mask isfloating isterm noswallow monitor */ 19 { "foot", NULL, 0, 0, 1, 1, -1 }, 20 { "librewolf", NULL, 0, 0, 0, 1, -1 }, 21 { "firefox", NULL, 0, 0, 0, 1, -1 }, 22 { "scratchpad", NULL, 0, 1, 0, 1, -1 }, 23 { "nm-connection-editor", NULL, 0, 1, 0, 0, -1 }, 24 }; 25 26 /* layout(s) */ 27 enum LayoutFunction { 28 ltile = 0, 29 lfloat = 1, 30 lmonocle = 2, 31 lcenteredmaster = 3, 32 }; 33 34 static const Layout layouts[] = { 35 /* symbol arrange function */ 36 [ltile] = { "[]=", tile }, 37 [lfloat] = { "><>", NULL }, /* no layout function means floating behavior */ 38 [lmonocle] = { "[M]", monocle }, 39 [lcenteredmaster] = { "|M|", centeredmaster }, 40 }; 41 42 #define MODKEY WLR_MODIFIER_LOGO 43 44 #define TAGKEYS(KEY,SKEY,TAG) \ 45 { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ 46 { MODKEY|WLR_MODIFIER_CTRL, KEY, toggleview, {.ui = 1 << TAG} }, \ 47 { MODKEY|WLR_MODIFIER_SHIFT, SKEY, tag, {.ui = 1 << TAG} }, \ 48 { MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT,SKEY,toggletag, {.ui = 1 << TAG} } 49 50 /* helper for spawning shell commands in the pre dwm-5.0 fashion */ 51 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } 52 53 /* Special Keys */ 54 #define AUDIODOWN XKB_KEY_XF86AudioLowerVolume 55 #define AUDIOUP XKB_KEY_XF86AudioRaiseVolume 56 #define AUDIOMUTE XKB_KEY_XF86AudioMute 57 #define BRIGHTUP XKB_KEY_XF86MonBrightnessUp 58 #define BRIGHTDOWN XKB_KEY_XF86MonBrightnessDown 59 #define PLAYPAUSE XKB_KEY_XF86AudioPlay 60 61 /* commands */ 62 #define TERMINAL "foot" 63 #define BROWSER "librewolf" 64 static const char *bookmarkscmd[] = { "bookmarks", NULL }; 65 static const char *browsercmd[] = { BROWSER, NULL }; 66 static const char *brightupcmd[] = { "brightness", "up", NULL }; 67 static const char *brightdowncmd[] = { "brightness", "down", NULL }; 68 static const char *emacscmd[] = { "emacs", NULL }; 69 static const char *menucmd[] = { "bemenu-run", NULL }; 70 static const char *nmcmd[] = { "nm-connection-editor", NULL }; 71 static const char *passcmd[] = { "passmenu-otp", NULL }; 72 static const char *pavucmd[] = { "pavucontrol", NULL }; 73 static const char *playerctlcmd[] = { "playerctl", "play-pause", NULL }; 74 static const char *rdpmenucmd[] = { "rdpmenu", NULL }; 75 static const char *sshmenucmd[] = { "sshmenu", NULL }; 76 static const char *swaylockcmd[] = { "swaylock", "-f", "-c", "181818", NULL }; 77 static const char *termcmd[] = { TERMINAL, NULL }; 78 static const char *volmutecmd[] = { "wpctl", "set-mute", "@DEFAULT_AUDIO_SINK@", "toggle", NULL }; 79 static const char *voldowncmd[] = { "wpctl", "set-volume", "@DEFAULT_AUDIO_SINK@", "2%-", NULL }; 80 static const char *volupcmd[] = { "wpctl", "set-volume", "@DEFAULT_AUDIO_SINK@", "2%+", NULL }; 81 82 #define WOFICMD SHCMD("wofi_style -I --show drun") 83 static const Key keys[] = { 84 /* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */ 85 /* modifier key function argument */ 86 { MODKEY, XKB_KEY_p, spawn, WOFICMD }, 87 { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_P, spawn, {.v = menucmd} }, 88 { MODKEY, XKB_KEY_Return, spawn, {.v = termcmd} }, 89 { MODKEY, XKB_KEY_F1, spawn, {.v = pavucmd} }, 90 { MODKEY, XKB_KEY_F3, spawn, {.v = nmcmd} }, 91 { MODKEY, XKB_KEY_slash, spawn, {.v = bookmarkscmd} }, 92 { MODKEY, XKB_KEY_backslash, spawn, {.v = sshmenucmd} }, 93 { MODKEY, XKB_KEY_F12, spawn, {.v = passcmd} }, 94 { MODKEY, XKB_KEY_minus, spawn, SHCMD(TERMINAL " -a scratchpad") }, 95 { MODKEY, XKB_KEY_n, spawn, SHCMD(TERMINAL " -e newsboat") }, 96 { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_N, spawn, SHCMD(TERMINAL " -e neomutt") }, 97 { MODKEY, XKB_KEY_s, spawn, SHCMD("grimshot copy area") }, 98 { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_S, spawn, SHCMD("grimshot save area - | swappy -f -") }, 99 { MODKEY, XKB_KEY_b, spawn, {.v = browsercmd} }, 100 { MODKEY, XKB_KEY_r, spawn, {.v = rdpmenucmd} }, 101 { MODKEY, XKB_KEY_Delete, spawn, {.v = swaylockcmd} }, 102 { MODKEY, XKB_KEY_e, spawn, {.v = emacscmd} }, 103 { MODKEY, XKB_KEY_F2, togglebar, {0} }, 104 { MODKEY, XKB_KEY_g, togglegaps, {0} }, 105 { MODKEY, XKB_KEY_j, focusstack, {.i = +1} }, 106 { MODKEY, XKB_KEY_k, focusstack, {.i = -1} }, 107 { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_J, movestack, {.i = +1} }, 108 { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_K, movestack, {.i = -1} }, 109 { MODKEY, XKB_KEY_i, incnmaster, {.i = +1} }, 110 { MODKEY, XKB_KEY_d, incnmaster, {.i = -1} }, 111 { MODKEY, XKB_KEY_h, setmfact, {.f = -0.05f} }, 112 { MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} }, 113 { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, zoom, {0} }, 114 { MODKEY, XKB_KEY_Tab, view, {0} }, 115 { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, killclient, {0} }, 116 { MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[ltile]} }, 117 { MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[lfloat]} }, 118 { MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[lmonocle]} }, 119 { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_M, setlayout, {.v = &layouts[lcenteredmaster]} }, 120 { MODKEY, XKB_KEY_space, setlayout, {0} }, 121 { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} }, 122 { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_F, togglefullscreen, {0} }, 123 { MODKEY, XKB_KEY_0, view, {.ui = ~0} }, 124 { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} }, 125 { MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} }, 126 { MODKEY, XKB_KEY_period, focusmon, {.i = WLR_DIRECTION_RIGHT} }, 127 { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_less, tagmon, {.i = WLR_DIRECTION_LEFT} }, 128 { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_greater, tagmon, {.i = WLR_DIRECTION_RIGHT} }, 129 130 { 0, AUDIODOWN, spawn, {.v = voldowncmd} }, 131 { 0, AUDIOUP, spawn, {.v = volupcmd} }, 132 { 0, AUDIOMUTE, spawn, {.v = volmutecmd} }, 133 { 0, PLAYPAUSE, spawn, {.v = playerctlcmd} }, 134 135 { 0, BRIGHTUP, spawn, {.v = brightupcmd} }, 136 { 0, BRIGHTDOWN, spawn, {.v = brightdowncmd} }, 137 138 { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Q, quit, {0} }, 139 140 TAGKEYS( XKB_KEY_1, XKB_KEY_exclam, 0), 141 TAGKEYS( XKB_KEY_2, XKB_KEY_at, 1), 142 TAGKEYS( XKB_KEY_3, XKB_KEY_numbersign, 2), 143 TAGKEYS( XKB_KEY_4, XKB_KEY_dollar, 3), 144 TAGKEYS( XKB_KEY_5, XKB_KEY_percent, 4), 145 TAGKEYS( XKB_KEY_6, XKB_KEY_asciicircum, 5), 146 TAGKEYS( XKB_KEY_7, XKB_KEY_ampersand, 6), 147 TAGKEYS( XKB_KEY_8, XKB_KEY_asterisk, 7), 148 TAGKEYS( XKB_KEY_9, XKB_KEY_parenleft, 8), 149 150 /* Ctrl-Alt-Backspace and Ctrl-Alt-Fx used to be handled by X server */ 151 { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_Terminate_Server, quit, {0} }, 152 /* Ctrl-Alt-Fx is used to switch to another VT, if you don't know what a VT is 153 * do not remove them. 154 */ 155 #define CHVT(n) { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_XF86Switch_VT_##n, chvt, {.ui = (n)} } 156 CHVT(1), CHVT(2), CHVT(3), CHVT(4), CHVT(5), CHVT(6), 157 CHVT(7), CHVT(8), CHVT(9), CHVT(10), CHVT(11), CHVT(12), 158 }; 159 160 static const Button buttons[] = { 161 { MODKEY, BTN_LEFT, moveresize, {.ui = CurMove} }, 162 { MODKEY, BTN_MIDDLE, togglefloating, {0} }, 163 { MODKEY, BTN_RIGHT, moveresize, {.ui = CurResize} }, 164 };