-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.h
234 lines (207 loc) · 13.4 KB
/
config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
/* See LICENSE file for copyright and license details. */
/* appearance */
static const unsigned int dwmmode = 0; /* laptop = 0 or tablet = 1 */
static const unsigned int borderpx = 3; /* border pixel of windows */
static const unsigned int gappx = 3; /* gaps between windows */
static const unsigned int snap = 32; /* snap pixel */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
static const int vertpad = 3; /* vertical padding of bar */
static const int sidepad = 3; /* horizontal padding of bar */
static const Bool viewontag = True; /* Switch view on tag switch */
static const char *fonts[] = { dwmmode
? "SauceCodePro Nerd Font Mono:style=Blod:pixelsize=34:type=Black:antialias=true:autohint=true"
: "SauceCodePro Nerd Font Mono:style=Blod:pixelsize=18:type=Black:antialias=true:autohint=true" };
static const char col_gray1[] = "#2d2c2c";
static const char col_gray2[] = "#2d2c2c";//灰黑
static const char col_gray3[] = "#e8e4e4";//灰白
static const char col_gray4[] = "#9b8bee";//蓝紫
static const char col_cyan[] = "#005577";//蓝色
// dwm6.3 update
static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
//alpha补丁
static const unsigned int baralpha = 0xd0;
static const unsigned int borderalpha = OPAQUE;
static const char *colors[][3] = {
/* fg bg border */
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
[SchemeSel] = { col_gray3, col_gray4, col_gray4 },
};
//alpha补丁
static const unsigned int alphas[][3] = {
/* fg bg border */
[SchemeNorm] = { OPAQUE, baralpha, borderalpha },
[SchemeSel] = { OPAQUE, baralpha, borderalpha },
};
/* tagging */
static const char *tags[] = { "", "", "", "", "", "" };
static const Rule rules[] = {
/* xprop(1):
* WM_CLASS(STRING) = instance, class
* WM_NAME(STRING) = title
*/
/* class instance title tags mask isfloating monitor */
{ "Alacritty", "Alacritty", "Alacritty - AutoStart", 1 << 0, 0, -1 },
{ "Google-chrome", "google-chrome", NULL, 1 << 1, 0, -1 },
{ "firefox", NULL, NULL, 0, 0, -1 },
{ "Alacritty", "Alacritty", "musicfox", 0, 0, -1 },
{ "Alacritty", "Alacritty", "ncmpcpp", 0, 1, -1 },
{ "Alacritty", "Alacritty", "bluetuith", 0, 1, -1 },
{ "Gimp", NULL, NULL, 0, 1, -1 },
{ "wps", "wps", NULL, 0, 1, -1 },
{ "QQ", "qq", NULL, 0, 1, -1 },
};
/* layout(s) */
static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
static const int nmaster = 1; /* number of clients in master area */
static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
static const int attachdirection = 0; /* 0 default, 1 above, 2 aside, 3 below, 4 bottom, 5 top */
static const int newclientathead = 0; /* 定义默认平铺布局新窗口在栈顶还是栈底 */
/* overview */
static const int overviewgappi = 24; /* overview时 窗口与边缘 缝隙大小 */
static const int overviewgappo = 60; /* overview时 窗口与窗口 缝隙大小 */
static const char *overviewtag = "OVERVIEW";
static const Layout overviewlayout = { "", overview };
static const Layout layouts[] = {
/* symbol arrange function */
{ "", tile }, /* first entry is default */
{ "", NULL }, /* no layout function means floating behavior */
{ "", monocle },
{ "", magicgrid },
};
/* 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 } }
#define STATUSBAR "dwmblocks"
/* commands */
static const char *termcmd[] = { "alacritty", NULL };
/*rofi配置*/
static const char *dmenucmd[] = { "rofi", "-show", "drun", NULL };
/*alacritty小窗口*/
static const char scratchpadname[] = "alacritty small window";
static const char *scratchpadcmd[] = { "alacritty", "-t" ,scratchpadname, NULL };
/*其它小窗口*/
static const char *bluetuithcmd[] = {"alacritty", "-t", "bluetuith", "-e", "bluetuith", NULL };
static const char *musiccmd[] = {"alacritty", "-t", "ncmpcpp", "-e", "ncmpcpp", NULL };
static const char *systraycmd[] = {"/home/orange/Dwm/Scripts/system/trayer.sh", NULL };
/*锁屏*/
static const char *forceoffandclockcmd[] = { "/home/orange/Dwm/Scripts/system/forceoff_lock.sh", NULL };
/*触摸板*/
static const char *touchpadcmd[] = { "/home/orange/Dwm/Scripts/system/touchpad.sh", NULL };
/*休眠*/
static const char *hibernatecmd[] = { "systemctl", "hibernate", NULL };
/*关机*/
static const char *poweroffcmd[] = { "poweroff", NULL };
/*重启*/
static const char *rebootcmd[] = { "reboot", NULL };
static const Key keys[] = {
/* modifier key function argument */
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
{ MODKEY, XK_Return, spawn, {.v = termcmd } },
/*脚本按键绑定*/
/*Super*/
{ MODKEY, XK_F1, spawn, SHCMD("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle; pkill -RTMIN+5 dwmblocks") },
{ MODKEY, XK_F2, spawn, SHCMD("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-; pkill -RTMIN+5 dwmblocks") },
{ MODKEY, XK_F3, spawn, SHCMD("wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 5%+; pkill -RTMIN+5 dwmblocks") },
{ MODKEY, XK_F4, spawn, {.v = bluetuithcmd } },
{ MODKEY, XK_F5, spawn, SHCMD("light -U 5; pkill -RTMIN+4 dwmblocks") },
{ MODKEY, XK_F6, spawn, SHCMD("light -A 5; pkill -RTMIN+4 dwmblocks") },
{ MODKEY, XK_F7, spawn, {.v = forceoffandclockcmd } } ,
{ MODKEY, XK_F8, spawn, {.v = systraycmd } } ,
{ MODKEY, XK_F9, spawn, {.v = musiccmd } } ,
{ MODKEY, XK_F10, spawn, {.v = touchpadcmd } } ,
{ MODKEY, XK_Escape, spawn, SHCMD("flameshot gui; pkill -RTMIN+10 dwmblocks") }, //Esc
/*Super+Shift*/
{ MODKEY|ShiftMask, XK_Escape, spawn, {.v = hibernatecmd } }, //休眠
{ MODKEY|ShiftMask, XK_F1, spawn, {.v = poweroffcmd } },
{ MODKEY|ShiftMask, XK_F2, spawn, {.v = rebootcmd } },
{ MODKEY, XK_v, togglebar, {0} },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_o, incnmaster, {.i = +1 } },
{ MODKEY, XK_y, incnmaster, {.i = -1 } },
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
/*补丁*/
{ MODKEY, XK_w, togglescratch, {.v = scratchpadcmd } },
{ MODKEY, XK_e, swapscratch, {.v = scratchpadcmd} },
{ MODKEY, XK_f, togglefullscr, {0} },
{ MODKEY, XK_u, rotatestack, {.i = +1 } },
{ MODKEY, XK_i, rotatestack, {.i = -1 } },
{ MODKEY, XK_minus, setgaps, {.i = -1 } },
{ MODKEY, XK_equal, setgaps, {.i = +1 } },
{ MODKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } },
{ MODKEY|ShiftMask, XK_k, aspectresize, {.i = +24} },
{ MODKEY|ShiftMask, XK_j, aspectresize, {.i = -24} },
{ MODKEY, XK_space, moveplace, {.ui = WIN_C }},
{ MODKEY, XK_Up, moveplace, {.ui = WIN_N }},
{ MODKEY, XK_Left, moveplace, {.ui = WIN_W }},
{ MODKEY, XK_Right, moveplace, {.ui = WIN_E }},
{ MODKEY, XK_Down, moveplace, {.ui = WIN_S }},
{ MODKEY|ShiftMask, XK_Up, moveplace, {.ui = WIN_NW }},
{ MODKEY|ShiftMask, XK_Right, moveplace, {.ui = WIN_NE }},
{ MODKEY|ShiftMask, XK_Left, moveplace, {.ui = WIN_SW }},
{ MODKEY|ShiftMask, XK_Down, moveplace, {.ui = WIN_SE }},
{ MODKEY|ControlMask, XK_l, movekeyboard_x, {.i = 20}},
{ MODKEY|ControlMask, XK_h, movekeyboard_x, {.i = -20}},
{ MODKEY|ControlMask, XK_j, movekeyboard_y, {.i = 20}},
{ MODKEY|ControlMask, XK_k, movekeyboard_y, {.i = -20}},
{MODKEY, XK_x, hidewin, {0}},
{MODKEY|ShiftMask, XK_x, restorewin, {0}},
{MODKEY, XK_z, hideotherwins, {0}},
{MODKEY|ShiftMask, XK_z, restoreotherwins, {0}},
{ MODKEY|ShiftMask, XK_space, zoom, {0} },
{ MODKEY, XK_Tab, view, {0} },
{ MODKEY, XK_c, killclient, {0} },
{ MODKEY, XK_a, toggleoverview, {0} },
{ MODKEY, XK_b, setlayout, {.v = &layouts[0]} },
{ MODKEY, XK_n, setlayout, {.v = &layouts[1]} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
{ MODKEY, XK_g, setlayout, {.v = &layouts[3]} },
{ MODKEY|ShiftMask, XK_b, setlayout, {0} },
{ MODKEY|ShiftMask, XK_f, togglefloating, {0} },
{ MODKEY, XK_0, view, {.ui = ~0 } },
{ MODKEY|ShiftMask, XK_w, floattag, {.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 } },
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} },
};
/* button definitions */
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
static const Button buttons[] = {
/* click event mask button function argument */
{ ClkTagBar, 0, Button1, view, {0} },
{ ClkTagBar, 0, Button2, spawn, {.v = forceoffandclockcmd } },
{ ClkTagBar, 0, Button3, toggleview, {0} },
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
{ ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
{ ClkWinTitle, 0, Button1, spawn, {.v = dmenucmd} }, // 左键点击中间弹出rofi应用
{ ClkWinTitle, 0, Button3, killclient, {0} }, // 中键点击中间退出应用
/* dwmblock patch*/
{ ClkStatusText, 0, Button1, sigstatusbar, {.i = 1} },
{ ClkStatusText, 0, Button2, sigstatusbar, {.i = 2} },
{ ClkStatusText, 0, Button3, sigstatusbar, {.i = 3} },
{ ClkStatusText, 0, Button4, sigstatusbar, {.i = 4} },
{ ClkStatusText, 0, Button5, sigstatusbar, {.i = 5} },
{ ClkStatusText, MODKEY, Button1, sigstatusbar, {.i = 6} },
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
{ ClkClientWin, MODKEY, Button2, togglefloating, {0} },
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
};