aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphilw <dscr@duck.com>2024-04-05 11:34:53 +0200
committerphilw <dscr@duck.com>2024-04-05 11:34:53 +0200
commit7fbe6160c167589fd656240042117a6978ec95aa (patch)
treebcc1b9428b2b0d9e3357f936bdee343b3aa8818a
parent499b51cde360a59e2fe09e5699f8ab233b360c37 (diff)
parent0a651fceabd63940bab513dc3635f562a59ed4dd (diff)
downloaddwm-7fbe6160c167589fd656240042117a6978ec95aa.tar.gz
dwm-7fbe6160c167589fd656240042117a6978ec95aa.zip
Merge branch 'master' of codeberg.org:philw/philw-dwm
-rw-r--r--config.def.h221
-rw-r--r--config.h2
-rw-r--r--dwm.c1
3 files changed, 111 insertions, 113 deletions
diff --git a/config.def.h b/config.def.h
index b678309..9f6be48 100644
--- a/config.def.h
+++ b/config.def.h
@@ -1,137 +1,132 @@
1static const unsigned int borderpx = 0; /* border pixel of windows */ 1static const unsigned int borderpx = 0; /* border pixel of windows */
2static const unsigned int snap = 32; /* snap pixel */ 2static const unsigned int snap = 32; /* snap pixel */
3static const unsigned int gappih = 10; /* horiz inner gap between windows */ 3static const unsigned int systraypinning =
4static const unsigned int gappiv = 10; /* vert inner gap between windows */ 4 0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor
5static const unsigned int gappoh = 10; /* horiz outer gap between windows and screen edge */ 5 X */
6static const unsigned int gappov = 10; /* vert outer gap between windows and screen edge */ 6static const unsigned int systrayonleft =
7static const int smartgaps = 0; /* 1 means no outer gap when there is only one window */ 7 0; /* 0: systray in the right corner, >0: systray on left of status text */
8static const int showbar = 1; /* 0 means no bar */ 8static const unsigned int systrayspacing = 2; /* systray spacing */
9static const int topbar = 1; /* 0 means bottom bar */ 9static const int systraypinningfailfirst =
10static const char *fonts[] = { "monospace:size=10" }; 10 1; /* 1: if pinning fails, display systray on the first monitor, False:
11static const char dmenufont[] = "monospace:size=10"; 11 display systray on the last monitor*/
12static const char col_gray1[] = "#222222"; 12static const int showsystray = 1; /* 0 means no systray */
13static const char col_gray2[] = "#444444"; 13static const unsigned int gappih = 10; /* horiz inner gap between windows */
14static const char col_gray3[] = "#bbbbbb"; 14static const unsigned int gappiv = 10; /* vert inner gap between windows */
15static const char col_gray4[] = "#eeeeee"; 15static const unsigned int gappoh =
16static const char col_cyan[] = "#005577"; 16 10; /* horiz outer gap between windows and screen edge */
17static const char *colors[][3] = { 17static const unsigned int gappov =
18 /* fg bg border */ 18 10; /* vert outer gap between windows and screen edge */
19 [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, 19static const int smartgaps =
20 [SchemeSel] = { col_gray4, col_cyan, col_cyan }, 20 0; /* 1 means no outer gap when there is only one window */
21static const int swallowfloating =
22 1; /* 1 means no outer gap when there is only one window */
23static const int showbar = 0; /* 0 means no bar */
24static const int topbar = 1; /* 0 means bottom bar */
25static const char *fonts[] = {"monospace:size=10"};
26static const char dmenufont[] = "monospace:size=10";
27static const char col_gray1[] = "#222222";
28static const char col_gray2[] = "#444444";
29static const char col_gray3[] = "#bbbbbb";
30static const char col_gray4[] = "#eeeeee";
31static const char col_cyan[] = "#005577";
32static const char norm_fg[] = "#bfbfbf";
33static const char norm_bg[] = "#000001";
34static const char norm_border[] = "#3f3f40";
35
36static const char sel_fg[] = "#bfbfbf";
37static const char sel_bg[] = "#5A4A63";
38static const char sel_border[] = "#bfbfbf";
39
40static const char urg_fg[] = "#bfbfbf";
41static const char urg_bg[] = "#501C61";
42static const char urg_border[] = "#501C61";
43
44static const char *colors[][3] = {
45 /* fg bg border */
46 [SchemeNorm] = {norm_fg, norm_bg, norm_border}, // unfocused wins
47 [SchemeSel] = {sel_fg, sel_bg, sel_border}, // the focused win
21}; 48};
22 49
23/* tagging */ 50/* tagging */
24static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; 51static const char *tags[] = {"1", "2", "3", "4", "5", "6", "7", "8", "9"};
25 52
26static const Rule rules[] = { 53static const Rule rules[] = {
27 /* xprop(1): 54 /* class instance title tags mask isfloating isterminal
28 * WM_CLASS(STRING) = instance, class 55 noswallow monitor */
29 * WM_NAME(STRING) = title 56 {"St", NULL, NULL, 0, 0, 1, 0, -1},
30 */ 57 {NULL, NULL, "Event Tester", 0, 0, 0, 1, -1}, /* xev */
31 /* class instance title tags mask isfloating isterminal noswallow monitor */
32 { "Gimp", NULL, NULL, 0, 1, 0, 0, -1 },
33 { "Brave", NULL, NULL, 1 << 8, 0, 0, -1, -1 },
34 { "St", NULL, NULL, 0, 0, 1, 0, -1 },
35 { NULL, NULL, "Event Tester", 0, 0, 0, 1, -1 }, /* xev */
36}; 58};
37 59
38/* layout(s) */ 60/* layout(s) */
39static const float mfact = 0.50; /* factor of master area size [0.05..0.95] */ 61static const float mfact = 0.50; /* factor of master area size [0.05..0.95] */
40static const int nmaster = 1; /* number of clients in master area */ 62static const int nmaster = 1; /* number of clients in master area */
41static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ 63static const int resizehints =
42static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ 64 0; /* 1 means respect size hints in tiled resizals */
65static const int lockfullscreen =
66 1; /* 1 will force focus on the fullscreen window */
43 67
44static const Layout layouts[] = { 68static const Layout layouts[] = {
45 /* symbol arrange function */ 69 /* symbol arrange function */
46 { "[]=", tile }, /* first entry is default */ 70 {"[]=", tile}, /* first entry is default */
47 { "><>", NULL }, /* no layout function means floating behavior */ 71 {"><>", NULL}, /* no layout function means floating behavior */
48 { "[M]", monocle }, 72 {"[M]", monocle},
49}; 73};
50 74
51/* key definitions */ 75/* key definitions */
52#define MODKEY Mod1Mask 76#define MODKEY Mod4Mask
53#define TAGKEYS(KEY,TAG) \ 77#define TAGKEYS(KEY, TAG) \
54 { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ 78 {MODKEY, KEY, view, {.ui = 1 << TAG}}, \
55 { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ 79 {MODKEY | ControlMask, KEY, toggleview, {.ui = 1 << TAG}}, \
56 { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ 80 {MODKEY | ShiftMask, KEY, tag, {.ui = 1 << TAG}}, \
57 { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, 81 {MODKEY | ControlMask | ShiftMask, KEY, toggletag, {.ui = 1 << TAG}},
58 82
59/* helper for spawning shell commands in the pre dwm-5.0 fashion */ 83/* helper for spawning shell commands in the pre dwm-5.0 fashion */
60#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } 84#define SHCMD(cmd) \
85 { \
86 .v = (const char *[]) { "/bin/sh", "-c", cmd, NULL } \
87 }
61 88
62/* commands */ 89/* commands */
63static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ 90static char dmenumon[2] =
64static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; 91 "0"; /* component of dmenucmd, manipulated in spawn() */
65static const char *termcmd[] = { "st", NULL }; 92// static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn",
93// dmenufont, "-nb", norm_bg, "-nf", norm_fg, "-sb", sel_bg, "-sf", sel_fg, NULL
94// };
95static const char *dmenucmd[] = {"dmenu_run", "-m", dmenumon, NULL};
96static const char *termcmd[] = {"st", NULL};
66 97
67static const Key keys[] = { 98static const Key keys[] = {
68 /* modifier key function argument */ 99 /* modifier key function argument */
69 { MODKEY, XK_p, spawn, {.v = dmenucmd } }, 100 {MODKEY, XK_d, spawn, {.v = dmenucmd}},
70 { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, 101 {MODKEY, XK_Return, spawn, {.v = termcmd}},
71 { MODKEY, XK_b, togglebar, {0} }, 102 {MODKEY, XK_b, togglebar, {0}},
72 { MODKEY, XK_j, focusstack, {.i = +1 } }, 103 {MODKEY, XK_q, killclient, {0}},
73 { MODKEY, XK_k, focusstack, {.i = -1 } }, 104 {MODKEY, XK_f, togglefullscr, {0}},
74 { MODKEY, XK_i, incnmaster, {.i = +1 } }, 105 {MODKEY, XK_space, setlayout, {0}},
75 { MODKEY, XK_d, incnmaster, {.i = -1 } }, 106 {MODKEY | ShiftMask, XK_space, togglefloating, {0}},
76 { MODKEY, XK_h, setmfact, {.f = -0.05} }, 107 TAGKEYS(XK_1, 0) TAGKEYS(XK_2, 1) TAGKEYS(XK_3, 2) TAGKEYS(XK_4, 3)
77 { MODKEY, XK_l, setmfact, {.f = +0.05} }, 108 TAGKEYS(XK_5, 4) TAGKEYS(XK_6, 5) TAGKEYS(XK_7, 6) TAGKEYS(XK_8, 7)
78 { MODKEY|Mod4Mask, XK_h, incrgaps, {.i = +1 } }, 109 TAGKEYS(XK_9, 8){MODKEY | ShiftMask, XK_q, quit, {0}},
79 { MODKEY|Mod4Mask, XK_l, incrgaps, {.i = -1 } }, 110 { 0, XF86XK_MonBrightnessUp, spawn, {.v = (const char*[]){ "xbacklight", "-inc", "15", NULL } } },
80 { MODKEY|Mod4Mask|ShiftMask, XK_h, incrogaps, {.i = +1 } }, 111 { 0, XF86XK_MonBrightnessDown, spawn, {.v = (const char*[]){ "xbacklight", "-dec", "15", NULL } } },
81 { MODKEY|Mod4Mask|ShiftMask, XK_l, incrogaps, {.i = -1 } },
82 { MODKEY|Mod4Mask|ControlMask, XK_h, incrigaps, {.i = +1 } },
83 { MODKEY|Mod4Mask|ControlMask, XK_l, incrigaps, {.i = -1 } },
84 { MODKEY|Mod4Mask, XK_0, togglegaps, {0} },
85 { MODKEY|Mod4Mask|ShiftMask, XK_0, defaultgaps, {0} },
86 { MODKEY, XK_y, incrihgaps, {.i = +1 } },
87 { MODKEY, XK_o, incrihgaps, {.i = -1 } },
88 { MODKEY|ControlMask, XK_y, incrivgaps, {.i = +1 } },
89 { MODKEY|ControlMask, XK_o, incrivgaps, {.i = -1 } },
90 { MODKEY|Mod4Mask, XK_y, incrohgaps, {.i = +1 } },
91 { MODKEY|Mod4Mask, XK_o, incrohgaps, {.i = -1 } },
92 { MODKEY|ShiftMask, XK_y, incrovgaps, {.i = +1 } },
93 { MODKEY|ShiftMask, XK_o, incrovgaps, {.i = -1 } },
94 { MODKEY, XK_Return, zoom, {0} },
95 { MODKEY, XK_Tab, view, {0} },
96 { MODKEY|ShiftMask, XK_c, killclient, {0} },
97 { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
98 { MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
99 { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
100 { MODKEY, XK_space, setlayout, {0} },
101 { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
102 { MODKEY|ShiftMask, XK_f, togglefullscr, {0} },
103 { MODKEY, XK_0, view, {.ui = ~0 } },
104 { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
105 { MODKEY, XK_comma, focusmon, {.i = -1 } },
106 { MODKEY, XK_period, focusmon, {.i = +1 } },
107 { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
108 { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
109 TAGKEYS( XK_1, 0)
110 TAGKEYS( XK_2, 1)
111 TAGKEYS( XK_3, 2)
112 TAGKEYS( XK_4, 3)
113 TAGKEYS( XK_5, 4)
114 TAGKEYS( XK_6, 5)
115 TAGKEYS( XK_7, 6)
116 TAGKEYS( XK_8, 7)
117 TAGKEYS( XK_9, 8)
118 { MODKEY|ShiftMask, XK_q, quit, {0} },
119}; 112};
120 113
121/* button definitions */ 114/* button definitions */
122/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ 115/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle,
116 * ClkClientWin, or ClkRootWin */
123static const Button buttons[] = { 117static const Button buttons[] = {
124 /* click event mask button function argument */ 118 /* click event mask button function argument */
125 { ClkTagBar, MODKEY, Button1, tag, {0} }, 119 {ClkLtSymbol, 0, Button1, setlayout, {0}},
126 { ClkTagBar, MODKEY, Button3, toggletag, {0} }, 120 {ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]}},
127 { ClkWinTitle, 0, Button2, zoom, {0} }, 121 {ClkTagBar, MODKEY, Button1, tag, {0}},
128 { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, 122 {ClkTagBar, MODKEY, Button3, toggletag, {0}},
129 { ClkClientWin, MODKEY, Button1, movemouse, {0} }, 123 {ClkWinTitle, 0, Button2, zoom, {0}},
130 { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, 124 {ClkStatusText, 0, Button2, spawn, {.v = termcmd}},
131 { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, 125 {ClkClientWin, MODKEY, Button1, movemouse, {0}},
132 { ClkTagBar, 0, Button1, view, {0} }, 126 {ClkClientWin, MODKEY, Button2, togglefloating, {0}},
133 { ClkTagBar, 0, Button3, toggleview, {0} }, 127 {ClkClientWin, MODKEY, Button3, resizemouse, {0}},
134 { ClkTagBar, MODKEY, Button1, tag, {0} }, 128 {ClkTagBar, 0, Button1, view, {0}},
135 { ClkTagBar, MODKEY, Button3, toggletag, {0} }, 129 {ClkTagBar, 0, Button3, toggleview, {0}},
130 {ClkTagBar, MODKEY, Button1, tag, {0}},
131 {ClkTagBar, MODKEY, Button3, toggletag, {0}},
136}; 132};
137
diff --git a/config.h b/config.h
index 2bd345f..ef8e703 100644
--- a/config.h
+++ b/config.h
@@ -107,6 +107,8 @@ static const Key keys[] = {
107 TAGKEYS(XK_1, 0) TAGKEYS(XK_2, 1) TAGKEYS(XK_3, 2) TAGKEYS(XK_4, 3) 107 TAGKEYS(XK_1, 0) TAGKEYS(XK_2, 1) TAGKEYS(XK_3, 2) TAGKEYS(XK_4, 3)
108 TAGKEYS(XK_5, 4) TAGKEYS(XK_6, 5) TAGKEYS(XK_7, 6) TAGKEYS(XK_8, 7) 108 TAGKEYS(XK_5, 4) TAGKEYS(XK_6, 5) TAGKEYS(XK_7, 6) TAGKEYS(XK_8, 7)
109 TAGKEYS(XK_9, 8){MODKEY | ShiftMask, XK_q, quit, {0}}, 109 TAGKEYS(XK_9, 8){MODKEY | ShiftMask, XK_q, quit, {0}},
110 { 0, XF86XK_MonBrightnessUp, spawn, {.v = (const char*[]){ "xbacklight", "-inc", "15", NULL } } },
111 { 0, XF86XK_MonBrightnessDown, spawn, {.v = (const char*[]){ "xbacklight", "-dec", "15", NULL } } },
110}; 112};
111 113
112/* button definitions */ 114/* button definitions */
diff --git a/dwm.c b/dwm.c
index fee7bfe..22f228a 100644
--- a/dwm.c
+++ b/dwm.c
@@ -49,6 +49,7 @@
49 49
50#include "drw.h" 50#include "drw.h"
51#include "util.h" 51#include "util.h"
52#include <X11/XF86keysym.h>
52 53
53/* macros */ 54/* macros */
54#define BUTTONMASK (ButtonPressMask|ButtonReleaseMask) 55#define BUTTONMASK (ButtonPressMask|ButtonReleaseMask)