Colors are either [X color names](http://en.wikipedia.org/wiki/X11_color_names) or *#RRGGBB*, booleans are *true* or *false*.
+All the boolean settings are *false* by default.
+
- `focused_border_color` — Color of the border of a focused window of a focused monitor.
- `active_border_color` — Color of the border of a focused window of an unfocused monitor.
- `wm_name` — The value that shall be used for the `_NET_WM_NAME` property of the root window.
-- `borderless_monocle` — Whether to remove borders for tiled windows in monocle mode.
+- `borderless_monocle` — Remove borders for tiled windows in monocle mode.
+
+- `gapless_monocle` — Remove gaps for tiled windows in monocle mode.
-- `gapless_monocle` — Whether to remove gaps for tiled windows in monocle mode.
+- `focus_follows_pointer` — Focus the window under the pointer.
-- `focus_follows_pointer` — Whether to focus the window under the pointer.
+- `pointer_follows_monitor` — When focusing a monitor, put the pointer at its center.
- `adaptative_raise` — Prevent floating windows from being raised when they might cover other floating windows.
- `apply_shadow_property` — Enable shadows for floating windows via the `_COMPTON_SHADOW` property.
-- `auto_alternate` — Whether to interpret two consecutive identical `use` messages as an `alternate` message.
+- `auto_alternate` — Interpret two consecutive identical `use` messages as an `alternate` message.
-- `focus_by_distance` — Whether to use window or leaf distance for focus movement.
+- `focus_by_distance` — Use window or leaf distance for focus movement.
## Environment Variables
{
local messages='get set list list_desktops list_monitors list_windows list_rules list_history presel cancel ratio pad focus shift swap push pull cycle nearest biggest circulate grab_pointer track_pointer ungrab_pointer toggle_fullscreen toggle_floating toggle_locked toggle_visibility close kill send_to drop_to send_to_monitor drop_to_monitor use use_monitor alternate alternate_desktop alternate_monitor add add_in rename_monitor rename remove_desktop send_desktop_to cycle_monitor cycle_desktop layout cycle_layout rotate flip balance rule remove_rule put_status adopt_orphans restore_layout restore_history quit'
- local settings='focused_border_color active_border_color normal_border_color presel_border_color focused_locked_border_color active_locked_border_color normal_locked_border_color urgent_border_color border_width window_gap split_ratio top_padding right_padding bottom_padding left_padding wm_name borderless_monocle gapless_monocle focus_follows_pointer adaptative_raise apply_shadow_property auto_alternate focus_by_distance'
+ local settings='focused_border_color active_border_color normal_border_color presel_border_color focused_locked_border_color active_locked_border_color normal_locked_border_color urgent_border_color border_width window_gap split_ratio top_padding right_padding bottom_padding left_padding wm_name borderless_monocle gapless_monocle focus_follows_pointer pointer_follows_monitor adaptative_raise apply_shadow_property auto_alternate focus_by_distance'
COMPREPLY=()
.BI quit " [EXIT_STATUS]"
Quit.
.SH SETTINGS
+.P
Colors are either
.B X
color names (cf.
.I #RRGGBB
, booleans are
.IR "true " "or " false .
+.P
+All the boolean settings are
+.I false
+by default.
.TP
.I focused_border_color
Color of the border of a focused window of a focused monitor.
property of the root window.
.TP
.I borderless_monocle
-Whether to remove borders for tiled windows in monocle mode.
+Remove borders for tiled windows in monocle mode.
.TP
.I gapless_monocle
-Whether to remove gaps for tiled windows in monocle mode.
+Remove gaps for tiled windows in monocle mode.
.TP
.I focus_follows_pointer
-Whether to focus the window under the pointer.
+Focus the window under the pointer.
+.TP
+.I pointer_follows_monitor
+When focusing a monitor, put the pointer at its center.
.TP
.I adaptative_raise
Prevent floating windows from being raised when they might cover other floating windows.
property.
.TP
.I auto_alernate
-Whether to interpret two consecutive identical
+Interpret two consecutive identical
.B use
messages as an
.B alternate
message.
.TP
.I focus_by_distance
-Whether to use window or leaf distance for focus movement.
+Use window or leaf distance for focus movement.
.SH ENVIRONMENT VARIABLES
.TP
.I BSPWM_SOCKET
focus_follows_pointer = b;
}
return;
+ } else if (strcmp(name, "pointer_follows_monitor") == 0) {
+ bool b;
+ if (parse_bool(value, &b))
+ pointer_follows_monitor = b;
+ return;
} else if (strcmp(name, "adaptative_raise") == 0) {
bool b;
if (parse_bool(value, &b))
snprintf(rsp, BUFSIZ, "%s", BOOLSTR(gapless_monocle));
else if (strcmp(name, "focus_follows_pointer") == 0)
snprintf(rsp, BUFSIZ, "%s", BOOLSTR(focus_follows_pointer));
+ else if (strcmp(name, "pointer_follows_monitor") == 0)
+ snprintf(rsp, BUFSIZ, "%s", BOOLSTR(pointer_follows_monitor));
else if (strcmp(name, "adaptative_raise") == 0)
snprintf(rsp, BUFSIZ, "%s", BOOLSTR(adaptative_raise));
else if (strcmp(name, "apply_shadow_property") == 0)
borderless_monocle = BORDERLESS_MONOCLE;
gapless_monocle = GAPLESS_MONOCLE;
focus_follows_pointer = FOCUS_FOLLOWS_POINTER;
+ pointer_follows_monitor = POINTER_FOLLOWS_MONITOR;
adaptative_raise = ADAPTATIVE_RAISE;
apply_shadow_property = APPLY_SHADOW_PROPERTY;
auto_alternate = AUTO_ALTERNATE;
#define WINDOW_GAP 6
#define SPLIT_RATIO 0.5
-#define BORDERLESS_MONOCLE false
-#define GAPLESS_MONOCLE false
-#define FOCUS_FOLLOWS_POINTER false
-#define ADAPTATIVE_RAISE false
-#define APPLY_SHADOW_PROPERTY false
-#define AUTO_ALTERNATE false
-#define FOCUS_BY_DISTANCE false
+#define BORDERLESS_MONOCLE false
+#define GAPLESS_MONOCLE false
+#define FOCUS_FOLLOWS_POINTER false
+#define POINTER_FOLLOWS_MONITOR false
+#define ADAPTATIVE_RAISE false
+#define APPLY_SHADOW_PROPERTY false
+#define AUTO_ALTERNATE false
+#define FOCUS_BY_DISTANCE false
char focused_border_color[MAXLEN];
char active_border_color[MAXLEN];
bool borderless_monocle;
bool gapless_monocle;
bool focus_follows_pointer;
+bool pointer_follows_monitor;
bool adaptative_raise;
bool apply_shadow_property;
bool auto_alternate;
last_mon = mon;
mon = m;
+ if (pointer_follows_monitor)
+ center_pointer(m);
+
ewmh_update_current_desktop();
}
{
xcb_set_input_focus(dpy, XCB_INPUT_FOCUS_POINTER_ROOT, root, XCB_CURRENT_TIME);
}
+
+void center_pointer(monitor_t *m)
+{
+ int16_t cx = m->rectangle.x + m->rectangle.width / 2;
+ int16_t cy = m->rectangle.y + m->rectangle.height / 2;
+ xcb_warp_pointer(dpy, XCB_NONE, root, 0, 0, 0, 0, cx, cy);
+}
void disable_motion_recorder(void);
void update_motion_recorder(void);
void clear_input_focus(void);
+void center_pointer(monitor_t *);
#endif