d2c5a1ba4b7ac6584c3370e4d3d48c0b50d9c439
1 /* See LICENSE file for copyright and license details. */
3 #include <X11/XF86keysym.h>
6 static const unsigned int borderpx
= 1; /* border pixel of windows */
7 static const unsigned int gappx
= 8; /* gap pixel between windows */
8 static const unsigned int snap
= 16; /* snap pixel */
9 static const unsigned int systraypinning
= 1; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */
10 static const unsigned int systrayspacing
= 2; /* systray spacing */
11 static const int systraypinningfailfirst
= 1; /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor*/
12 static const int showsystray
= 1; /* 0 means no systray */
13 static const int showbar
= 1; /* 0 means no bar */
14 static const int topbar
= 1; /* 0 means bottom bar */
15 static const char *fonts
[] = { "monospace:size=10", "JoyPixels:pixelsize=10:antialias=true:autohint=true" };
16 static const char dmenufont
[] = "monospace:size=10";
17 static const char col_gray1
[] = "#222222";
18 static const char col_gray2
[] = "#444444";
19 static const char col_gray3
[] = "#bbbbbb";
20 static const char col_gray4
[] = "#eeeeee";
21 static const char col_cyan
[] = "#007799";
22 static const char *colors
[][3] = {
24 [SchemeNorm
] = { col_gray3
, col_gray1
, col_gray2
},
25 [SchemeSel
] = { col_gray4
, col_cyan
, col_cyan
},
29 static const char *tags
[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
31 static const Rule rules
[] = {
33 * WM_CLASS(STRING) = instance, class
34 * WM_NAME(STRING) = title
36 /* class instance title tags mask isfloating monitor */
37 { "Gimp", NULL
, NULL
, 0, 1, -1 },
38 { "Firefox", NULL
, NULL
, 1 << 8, 0, -1 },
42 static const float mfact
= 0.55; /* factor of master area size [0.05..0.95] */
43 static const int nmaster
= 1; /* number of clients in master area */
44 static const int resizehints
= 1; /* 1 means respect size hints in tiled resizals */
46 static const Layout layouts
[] = {
47 /* symbol arrange function */
48 { "◧", tile
}, /* first entry is default */
49 { "🗗", NULL
}, /* no layout function means floating behavior */
50 { "🔍", monocle
}, // TODO hide unfocused windows for background transparency?
54 #define MODKEY Mod4Mask
55 #define TAGKEYS(KEY,TAG) \
56 { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
57 { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
58 { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
59 { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
60 #define MEDIAKEY(KEY,CMD) {0, KEY, spawn, {.v = (const char *[]){ "sh", "-c", CMD, NULL } } } /* TODO don't fire up unnecessary shells */
62 /* helper for spawning shell commands in the pre dwm-5.0 fashion */
63 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
66 static char dmenumon
[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
67 static const char *dmenucmd
[] = { "dmenu_run", "-m", dmenumon
, "-fn", dmenufont
, "-nb", col_gray1
, "-nf", col_gray3
, "-sb", col_cyan
, "-sf", col_gray4
, NULL
};
68 static const char *termcmd
[] = { "st", NULL
};
69 static const char *helpcmd
[] = { "st", "-e", "man", "dwm", NULL
};
70 static const char *killx
[] = { "pkill", "xinit", NULL
};
73 /* modifier key function argument */
74 { MODKEY
, XK_p
, spawn
, {.v
= dmenucmd
} },
75 { MODKEY
|ShiftMask
, XK_Return
, spawn
, {.v
= termcmd
} },
76 { MODKEY
, XK_b
, togglebar
, {0} },
77 { MODKEY
, XK_j
, focusstack
, {.i
= +1 } },
78 { MODKEY
, XK_k
, focusstack
, {.i
= -1 } },
79 { MODKEY
, XK_i
, incnmaster
, {.i
= +1 } },
80 { MODKEY
, XK_d
, incnmaster
, {.i
= -1 } },
81 { MODKEY
, XK_h
, setmfact
, {.f
= -0.05} },
82 { MODKEY
, XK_l
, setmfact
, {.f
= +0.05} },
83 { MODKEY
, XK_Return
, zoom
, {0} },
84 { MODKEY
, XK_Tab
, view
, {0} },
85 { MODKEY
|ShiftMask
, XK_c
, killclient
, {0} },
86 { MODKEY
, XK_t
, setlayout
, {.v
= &layouts
[0]} },
87 { MODKEY
, XK_f
, setlayout
, {.v
= &layouts
[1]} },
88 { MODKEY
, XK_m
, setlayout
, {.v
= &layouts
[2]} },
89 { MODKEY
, XK_space
, setlayout
, {0} },
90 { MODKEY
|ShiftMask
, XK_space
, togglefloating
, {0} },
91 { MODKEY
, XK_0
, view
, {.ui
= ~0 } },
92 { MODKEY
|ShiftMask
, XK_0
, tag
, {.ui
= ~0 } },
93 { MODKEY
, XK_comma
, focusmon
, {.i
= -1 } },
94 { MODKEY
, XK_period
, focusmon
, {.i
= +1 } },
95 { MODKEY
|ShiftMask
, XK_comma
, tagmon
, {.i
= -1 } },
96 { MODKEY
|ShiftMask
, XK_period
, tagmon
, {.i
= +1 } },
106 { MODKEY
|ShiftMask
, XK_r
, quit
, {0} }, // just exits dwm, allows for restart
107 { MODKEY
|ShiftMask
, XK_q
, spawn
, {.v
= killx
} }, // kills x session
109 { MODKEY
|ShiftMask
, XK_h
, spawn
, {.v
= helpcmd
} },
110 { MODKEY
, XK_w
, spawn
, {.v
= (const char*[]){ "tabbed", "-cdps+1", "surf", "-e", NULL
} } },
111 { MODKEY
|ShiftMask
, XK_w
, spawn
, {.v
= (const char*[]){ "chromium", NULL
} } },
112 { MODKEY
|ShiftMask
, XK_x
, spawn
, {.v
= (const char*[]){ "st", "-c", "ish", "-t", "ish", "ish", NULL
} } },
113 { MODKEY
|ShiftMask
, XK_p
, spawn
, SHCMD("mpc toggle; pkill -USR1 dbar") },
114 { MODKEY
|ShiftMask
, XK_n
, spawn
, SHCMD("mpc next; pkill -USR1 dbar") },
117 MEDIAKEY( XF86XK_MonBrightnessUp
, "xbacklight -time 100 -inc 5"),
118 MEDIAKEY( XF86XK_MonBrightnessDown
, "xbacklight -time 100 -dec 5"),
119 MEDIAKEY( XF86XK_AudioMute
, "pactl set-sink-mute @DEFAULT_SINK@ toggle; pkill -USR1 dbar"),
120 MEDIAKEY( XF86XK_AudioLowerVolume
, "pactl set-sink-volume @DEFAULT_SINK@ -10%; pkill -USR1 dbar"),
121 MEDIAKEY( XF86XK_AudioRaiseVolume
, "pactl set-sink-volume @DEFAULT_SINK@ +5%; pkill -USR1 dbar"),
122 MEDIAKEY( XF86XK_AudioMicMute
, "pactl set-source-mute @DEFAULT_SOURCE@ toggle; pkill -USR1 dbar"),
123 MEDIAKEY( XF86XK_WebCam
, "mpv --untimed /dev/video0"),
127 /* button definitions */
128 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
129 static Button buttons
[] = {
130 /* click event mask button function argument */
131 { ClkLtSymbol
, 0, Button1
, setlayout
, {0} },
132 { ClkLtSymbol
, 0, Button3
, setlayout
, {.v
= &layouts
[2]} },
133 { ClkWinTitle
, 0, Button2
, zoom
, {0} },
134 { ClkStatusText
, 0, Button2
, spawn
, {.v
= termcmd
} },
135 { ClkClientWin
, MODKEY
, Button1
, movemouse
, {0} },
136 { ClkClientWin
, MODKEY
, Button2
, togglefloating
, {0} },
137 { ClkClientWin
, MODKEY
, Button3
, resizemouse
, {0} },
138 { ClkTagBar
, 0, Button1
, view
, {0} },
139 { ClkTagBar
, 0, Button3
, toggleview
, {0} },
140 { ClkTagBar
, MODKEY
, Button1
, tag
, {0} },
141 { ClkTagBar
, MODKEY
, Button3
, toggletag
, {0} },