wm_name
The value that shall be used for the _NET_WM_NAME property of the root window.
+ button_modifier
+ The modifier mask used for mouse bindings (possible values: 'mod1' ... 'mod5').
+
borderless_monocle
Whether to remove borders for tiled windows in monocle mode.
## Mouse Bindings
- M4 + Left Button
+ button_modifier + left mouse button
Move the window under the pointer.
- M4 + Middle Button
+ button_modifier + middle mouse button
Focus the window under the pointer.
- M4 + Middle Button
+ button_modifier + right mouse button
Resize the window under the pointer (by moving one of its four corners).
-Where *M4* is the fourth modifier mask (generally bound to *Super*).
-
## Panel
`dzen2` fed with the output of `ewmhstatus`. Example: [launchpanel](https://github.com/baskerville/bin/blob/master/launchpanel).
err("another WM is already running\n");
}
- xcb_grab_button(dpy, false, screen->root, XCB_EVENT_MASK_BUTTON_PRESS, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC, XCB_NONE, XCB_NONE, XCB_BUTTON_INDEX_1, BUTTON_MODIFIER);
- xcb_grab_button(dpy, false, screen->root, XCB_EVENT_MASK_BUTTON_PRESS, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC, XCB_NONE, XCB_NONE, XCB_BUTTON_INDEX_2, BUTTON_MODIFIER);
- xcb_grab_button(dpy, false, screen->root, XCB_EVENT_MASK_BUTTON_PRESS, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC, XCB_NONE, XCB_NONE, XCB_BUTTON_INDEX_3, BUTTON_MODIFIER);
+}
+
+void grab_buttons(void)
+{
+ xcb_grab_button(dpy, false, screen->root, XCB_EVENT_MASK_BUTTON_PRESS, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC, XCB_NONE, XCB_NONE, XCB_BUTTON_INDEX_1, button_modifier);
+ xcb_grab_button(dpy, false, screen->root, XCB_EVENT_MASK_BUTTON_PRESS, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC, XCB_NONE, XCB_NONE, XCB_BUTTON_INDEX_2, button_modifier);
+ xcb_grab_button(dpy, false, screen->root, XCB_EVENT_MASK_BUTTON_PRESS, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC, XCB_NONE, XCB_NONE, XCB_BUTTON_INDEX_3, button_modifier);
}
void setup(void)
load_settings();
run_autostart();
ewmh_update_wm_name();
+ grab_buttons();
while (running) {
#define ROOT_EVENT_MASK (XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT | XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY)
#define CLIENT_EVENT_MASK (XCB_EVENT_MASK_PROPERTY_CHANGE | XCB_EVENT_MASK_ENTER_WINDOW)
-#define BUTTON_MODIFIER XCB_MOD_MASK_4
xcb_connection_t *dpy;
int default_screen, screen_width, screen_height;
bool running;
void register_events(void);
+void grab_buttons(void);
void handle_zombie(int);
void setup(void);
void quit(void);
strncpy(wm_name, value, sizeof(wm_name));
ewmh_update_wm_name();
return;
+ } else if (strcmp(name, "button_modifier") == 0) {
+ unsigned int m;
+ if (parse_modifier_mask(value, &m))
+ button_modifier = m;
+ return;
} else {
snprintf(rsp, BUFSIZ, "unknown setting: %s", name);
return;
}
return false;
}
+
+bool parse_modifier_mask(char *s, unsigned int *m)
+{
+ if (strcmp(s, "mod1") == 0) {
+ *m = XCB_MOD_MASK_1;
+ return true;
+ } else if (strcmp(s, "mod2") == 0) {
+ *m = XCB_MOD_MASK_2;
+ return true;
+ } else if (strcmp(s, "mod3") == 0) {
+ *m = XCB_MOD_MASK_3;
+ return true;
+ } else if (strcmp(s, "mod4") == 0) {
+ *m = XCB_MOD_MASK_4;
+ return true;
+ } else if (strcmp(s, "mod5") == 0) {
+ *m = XCB_MOD_MASK_5;
+ return true;
+ }
+ return false;
+}
bool parse_corner(char *, corner_t *);
bool parse_rotate(char *, rotate_t *);
bool parse_fence_move(char *, fence_move_t *);
+bool parse_modifier_mask(char *, unsigned int *);
#endif
urgent_border_color_pxl = get_color(urgent_border_color);
strncpy(wm_name, WM_NAME, sizeof(wm_name));
+ button_modifier = BUTTON_MODIFIER;
inner_border_width = INNER_BORDER_WIDTH;
main_border_width = MAIN_BORDER_WIDTH;
#define WM_NAME "bspwm"
#define AUTOSTART_FILE "autostart"
+#define BUTTON_MODIFIER XCB_MOD_MASK_4
#define FOCUSED_BORDER_COLOR "#7D7F8A"
#define ACTIVE_BORDER_COLOR "#7D7F8A"
bool focus_follows_mouse;
char wm_name[MAXLEN];
+unsigned int button_modifier;
void load_settings(void);
void run_autostart(void);