Port of dwm's accessnthmon. Adds functions to tag and focus monitor by index.
Automatically center floating windows.
Newly created windows are placed at the bottom of the client tile stack.
This is a port of attachtop patch for dwm: https://dwm.suckless.org/patches/attachtop
New client attaches below the last master/on top of the stack.
Behavior feels very intuitive as it doesn't disrupt existing masters no matter the amount of them, it only pushes the clients in stack down.
Allow dwl to execute commands from autostart array in your config.h file. And when you exit dwl all processes from autostart array will be killed.
Note: Commands from array are executed using execvp(). So if you need to execute shell command you need to prefix it with "sh", "-c" (change sh to any shell you like).
Add a bar identical to dwm's bar.
To use a status-bar, you can pass in status text via stdin:
slstatus -s | dwl
Below is a preview of the patch.
For colors, they are in RRRR, GGGG, BBBB, AAAA
format
due to inheriting the pixman_color_t
type, an example for
the color 0x282a36
would be
0x2828, 0x2a2a, 0x3636, 0xffff
Add a system tray next to the bar. Heed the warning, this is far from suckless ^^
The patch applies on top of the bar patch. That needs to be applied first.
The patch creates subdirectories lib
and
include
. After patching, but before make
,
install libstatusnotifier-systray-gtk4.a
and
snsystray.h
from statusnotifier-systray-gtk4 in the
directories. One possible way to do that:
$ meson setup --default-library=static --prefix=/ -Dgir=false -Dvala=false -Ddocs=false build
$ meson compile -C build
$ DESTDIR=$DWLDIR meson install -C build
, where $DWLDIR
is the path to dwl root.make
.Add a border around the bar similar to how a client is given a border.
Add support for colored status text to the bar. Text can be
colored in the same manner as with dwlb, namely by wrapping it between
^fg(color)
and ^fg()
or
^bg(color)
and ^bg()
, where color
is a 6-digit hexadecimal value.
Adds the ability to change the bar's height.
Add vertical and horizontal space between the bar and the edge of the screen.
Adds 2 more borders to each side (top, bottom, left, right) of every window.
With the following config:static const unsigned int borderpx = 9; /* border pixel of windows */ static const unsigned int borderspx = 3; /* width of the border that start from outside the windows */ static const unsigned int borderepx = 3; /* width of the border that start from inside the windows */
and
border_color_type
set toBrdOriginal
:and
border_color_type
set toBrdStart
:and
border_color_type
set toBrdEnd
:and
border_color_type
set toBrdStartEnd
:![]()
bstack and bstackhoriz are two stack layouts for dwl.
bstack (TTT) bstackhoriz (===)
+-----------------+ +-----------------+
| | | |
| | | |
| | | |
+-----+-----+-----+ +-----------------+
| | | | +-----------------+
| | | | +-----------------+
+-----+-----+-----+ +-----------------+
Adds "state" (enum wlr_button_state
) to configure a
button action on either press or release. This basically enables release
to be used for button actions.
Add a keybinding that toggles centering the terminally horizontally when it's the only window, while still tiling multiple windows.
This limits the width of long text making it easier to read, and avoids covering the wallpaper more than necessary.
This is a port of centeredmaster patch for dwm: https://dwm.suckless.org/patches/centeredmaster
centeredmaster centers the nmaster area on screen, using mfact *
monitor width & height, with the stacked windows distributed to the
left and right. It can be selected with Alt+c
.
With one and two clients in master respectively this results in:
+------------------------------+ +------------------------------+
|+--------++--------++--------+| |+--------++--------++--------+|
|| || || || || || || ||
|| || || || || || M1 || ||
|| || || || || || || ||
|| S2 || M || S1 || || |+--------+| ||
|| || || || || |+--------+| ||
|| || || || || || || ||
|| || || || || || M2 || ||
|| || || || || || || ||
|+--------++--------++--------+| |+--------++--------++--------+|
+------------------------------+ +------------------------------+
A port of the dwm cfacts patch (with the limits removed)
Clients with higher weight are allocated more space!
+---------------------+
| | 0.5 |
| 1.0 +----------+
+----------+ |
| | 1.0 |
| +----------+
| 2.0 | |
| | 1.0 |
+----------+----------+`
Port of the cfact patch for the centeredmaster layout.
Inspired by the original patch for dwm (https://dwm.suckless.org/patches/cfacts/)
This patch requires both cfact and centeredmaster patches.
Implements chained keybindings (like the dwm keychain patch).
Bindings can share a leading chain key. This chain key will be triggered when Mod+chain is pressed. A subsequent keypress will be matched against bindings for that chain key. If it is configured the action will be triggered, otherwise the keypress will be ignored.
This patch adds default transparency parameters to config.h which specify the starting transparencies of all windows.
It also adds opacities to the ruleset, enabling override of the opacities on a per client basis.
Additionally, it adds some shortcuts:
[MODKEY]+[o] -> increase focus opacity of currently focused window
[MODKEY]+[Shift]+[o] -> decrease focus opacity of currently focused window
A column layout patch. This patch just puts the visible clients into equal-width columns on the screen.
Generate a coredump if dwl exited abnormally (to be more usefull you need to compile dwl and wlroots with debug symbols)
Adds ability to change cursor's theme and size.
static const char *cursor_theme = NULL;
static const char cursor_size[] = "24"; /* Make sure it's a valid integer, otherwise things will break */
Rules for floating windows support default x, y, width, height. Defaults to the center of the screen and the client size.
If the width or height is less than or equal to 1, then the value will be interpreted as a percentage. For example, 0.5 represents 50%, 0.25 represents 25%, and 1 represents 100%. NOTE: Some clients, like Thunar, have minimum width/height
The variable center_relative_to_monitor
allows the user
to choose whether to center relative to the monitor or relative to the
window area.
The "Monitor area" refers to the space enclosed by the green rectangle, while the "Window area" refers to the space enclosed by the red rectangle.![]()
Adds a layout with a monocle layout for clients in the stack (port of the deck layout for dwm); stacked clients are like a deck of cards (see below)
Tile:
+-----------------+--------+
| | |
| | S1 |
| | |
| M +--------+
| | |
| | S2 |
| | |
+-----------------+--------+
Deck:
+-----------------+--------+
| | |
| | |
| | |
| M | S1 |
| | |
| | |
| | |
+-----------------+--------+
This patch adds the ability to define the modkey with a make argument like so:
make MODKEY=WLR_MODIFIER_ALT
make MODKEY=WLR_MODIFIER_LOGO
make MODKEY=WLR_MODIFIER_CTRL
make MODKEY=WLR_MODIFIER_SHIFT
It can be used to compile multiple times quickly, you can also have a main session and sub session with different modkeys.
Implements dimming of clients which are unfocused.
The code also allows any color dimming. There is also an additional
option in Rule
, which allows you to keep the client
neverdim
, that is, as if it is focused.
There are also two functions that can be bound to a Key
or Button
,
toggledimming
: Which toggles dimming for all windows
(except for Rule
s)toggledimmingclient
: Which toggles dimming for the
focused window, as if the client had neverdim
applied to
it. This overwrites an applied Rule
.Change mfact by dragging the mouse.
implement rio-like window resizing
select window to resize (mod+middleclick by default) then drag out an area for it to occupy
Always use the English keymap to get keycodes, so key bindings work even when using a non-English keyboard layout.
Input device configuration (click method, tap-and-drag, acceleration, etc), border size and colors via environment variables.
Allow setting fake fullscreen per client
Tries a different display mode if the preferred mode doesn't work.
A revive of the floatBorderColor patch.
This patch allows you to set a color for floating windows when they are unfocused.
Focus the window to the left, right, above or below the current focused window
Implement foreign-toplevel-management
, it add handlers
for activate, close, fullscreen and destroy request events, it's missing
minimize and maximize request handlers.
Arranges windows in a grid. Except it adjusts the number of windows in the first few columns to avoid empty cells.
Adds gaps between clients, providing the ability to disable them at run-time.
smartgaps
can also be changed to remove gaps when there
is only one client present.
Add swipe gestures to trigger functions, similar to libinput-gestures.
It supports the following gestures: SWIPE_UP
,
SWIPE_DOWN
, SWIPE_LEFT
and
SWIPE_RIGHT
NOTE: It requires that you have previously applied pointer-gestures-unstable-v1
static const Gesture gestures[] = {
/* modifier gesture fingers_count function argument */
{ MODKEY, SWIPE_LEFT, 4, shiftview, { .i = 1 } },
{ 0, SWIPE_RIGHT, 4, shiftview, { .i = -1 } },
};
NOTE: the example above requires the following patch shiftview
This patch adds ability to pass specified in config header keys globally, somewhat in hyprlands approach. This might deal with waylands lack of global shortcuts.
Example:
static const PassKeypressRule pass_rules[] = {
ADDPASSRULE("com.obsproject.Studio", MODKEY, XKB_KEY_Home),
ADDPASSRULE("discord", 0, XKB_KEY_n),
/* xkb key is case ignored */
};
will pass MODKEY + Home
key to obs(flatpak version)
regardless of what client is currently focused if any. String
"com.obsproject.Studio" should be exact match for appid of the client.
To get appid use dwlmsg, or run stock dwl
from a terminal then launch the needed application inside, dwl will
print all the info to the stdout.
Note that if popup (like fuzzel) is focused, no key will be globally passed. This is done so these menus don't get closed after hitting some of the global keys.
Implements swaymsg create_output
command, it allows you
to create virtual/headless outputs. But in combination with a VNC server
(for example wayvnc), this allows you to essentially have additional
monitors, by connecting to the VNC server with an appropiate client (for
example on an tablet or laptop).
If you plan to use wayvnc, you'll need virtual-pointer patch as well
Hide all clients (and layer surfaces) behind the current client if it is fullscreen, only the background (layer surfaces at the background layer) will be shown
Hide all clients behind the focused one in the monocle layout
Prevent bar from drawing tags with no clients (i.e. vacant). It also stops drawing empty rectangles on the bar for non-vacant tags as there is no need anymore to distinguish vacant tags and it offers a more visible contrast than if there were filled/empty rectangles.
Adds a ishidden
option to client rules, that allows
hiding any matching clients entirely.
Input device rules implemented using custom device create functions for keyboards and pointing devices.
Examples provided:
Largely based on raphi's somebar, this patch provides an ipc for wayland clients to get and set dwl state. The ipc is intended for status bars, but can also be scripted with tools like dwlmsg.
Status information to stdout is currently disabled as dwl tends to
freeze. For now, dwlmsg -w
should act as a drop-in
replacement.
Note to pertag users: apply this for ipc tagsetting to work as expected
This patch adds per-client keyboard layout and ability to send current keyboard layout information to a status bar.
Only per-client feature is enabled by default. You can edit
kblayout_file
and kblayout_cmd
variables to
notify a status bar about keyboard layout.
Someblocks config that
works with the example settings in config.h
:
static const Block blocks[] = {
/*Icon*/ /*Command*/ /*Update Interval*/ /*Update Signal*/
{"", "cat /tmp/dwl-kblayout", 0, 1},
};
Both of these features are included in one patch because their
implementation happens to share some code. If you don't need any of
these features, just disable it in config.h
.
Allows clients to use the keyboard-shortcuts-inhibit protocol to block the compositor from using keybinds. This is useful for virtualization software like looking-glass which requires this protocol to run.
Use keycodes instead of keysyms. This way, input is independent from
keyboard layout (you can use the keys.h file to customize, or get the
keycodes with wev
or
xkbcli interactive-wayland
(x11-libs/libxkbcommon[tools] in
gentoo)).
(run in DWL source directory)
export XKB_DEFAULT_VARIANT=yourbestkeyboardlayout
cc -lxkbcommon -o generate-keys generate-keys.c
./generate-keys
Adds touchscreen functionality.
This patch was based on the simple-touch-input but instead of emulating mouse movement, this now forwards the appropriate event notifications to clients.
KNOWN BUGS:
Limits nmaster to within the range of currently-opened windows (nmaster will not change past the full horizontal split layout)
This patch allows you to add keybindings to the lockscreen.
static const Key lockedkeys[] = {
/* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */
/* modifier key function argument */
/* Ctrl-Alt-Backspace and Ctrl-Alt-Fx used to be handled by X server */
{ WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_Terminate_Server, quit, {0} },
#define CHVT(n) { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_XF86Switch_VT_##n, chvt, {.ui = (n)} }
(1), CHVT(2), CHVT(3), CHVT(4), CHVT(5), CHVT(6),
CHVT(7), CHVT(8), CHVT(9), CHVT(10), CHVT(11), CHVT(12),
CHVT};
This patch adds a layout, mastercol
, in which the
windows in the master area are arranged in columns of equal size. The
number of columns is always nmaster + 1, and the last column is a stack
of leftover windows (as in the normal tile layout). It effectively
differs from the default tile layout only in that master windows are
arranged horizontally rather than vertically.
For gaps, apply mastercolumn-gaps.patch
on top of
mastercolumn.patch
and gaps.patch
.
mastercolumn.patch
mastercolumn-gaps.patch
This patch adds menu
command, which allows dwl to
interface with dmenu-like programs.
By default, two menus are available:
Alt+o
Alt+Shift+o
Edit menus
array in config.h
to add/change
menus and use a different dmenu program.
Add the meson build system.
This is useful for people who do not want to self-manage a wlroots installation.
To enable Xwayland support, you will need to enable it in the wlroots subproject:
meson setup -Dwlroots:xwayland=enabled build
It is also reccomended to see the wlroots meson project configuration
logs for any unusual checks, such as requiring hwdata
for
the DRM backend.
Dynamically adjusts the borders between adjacent windows to make them visually merge
NOTE: to disable minimalborders after applying this
patch, set draw_minimal_borders
to 0
static const int draw_minimal_borders = 0; /* disable minimalborders */
with:static const unsigned int borderpx = 10; /* border pixel of windows */
Before applying the patch
After applying the patch
![]()
Implement modes, that way each mapping is associated with a mode and
is only active while in that mode, default mode is
NORMAL
In the example below, you declare a mode: BROWSER
, which
is activated when you press modkey + b. Then, you
can press f to launch Firefox
and return to the
default NORMAL
mode.
enum {
,
BROWSER};
const char *modes_labels[] = {
"browser",
};
static const Key keys[] = {
// ...
{ MODKEY, XKB_KEY_b, entermode, {.i = BROWSER} },
// ...
};
static const Modekey modekeys[] = {
/* mode modifier key function argument */
{ BROWSER, { 0, XKB_KEY_f, spawn, SHCMD("firefox") } },
{ BROWSER, { 0, XKB_KEY_f, entermode, {.i = NORMAL} } },
{ BROWSER, { 0, XKB_KEY_Escape, entermode, {.i = NORMAL} } },
};
Allows more monitor configuration in config.h
This patch is no longer being maintained by me wochap, since I'm now using a different patch specific to my use case: https://codeberg.org/wochap/dwl/src/branch/v0.6-c/betterfloat/betterfloat-diff.patch.
This patch provides a keybinding to center the focused floating window.
Press MODKEY + x to center the focused floating window.
It does NOT center windows that are not floating.
The variable respect_monitor_reserved_area
allows the
user to choose whether to center relative to the monitor or relative to
the window area.
The "Monitor area" refers to the space enclosed by the green rectangle, while the "Window area" refers to the space enclosed by the red rectangle.![]()
This allows the user to change size and placement of floating windows using only the keyboard, default keybindings:
Keybinding | Action |
---|---|
MODKEY + Up | move 40px up |
MODKEY + Down | move 40px down |
MODKEY + Left | move 40px left |
MODKEY + Right | move 40px right |
MODKEY + Shift + Up | shrink height 40px |
MODKEY + Shift + Down | grow height 40px |
MODKEY + Shift + Left | shrink width 40px |
MODKEY + Shift + Right | grow width 40px |
Allows you to move a window up and down the stack.
Allows for the creation of multiple scratchpad windows, each assigned to a different keybinding. In simple terms, it enables 'run or raise' functionality
This patch adds the following functions:
togglescratch
: simply toggles the scratchpad
windowfocusortogglescratch
: change the focus to the
scratchpad window if it is visible and toggles it if it is already in
focusfocusortogglematchingscratch
: similar to
focusortogglescratch
but also closes all other scratchpad
windowsIf you don't assign keybindings to any of the above functions and so get a compiler warning about them not being used, just remove them from your dwl branch to stop the warning.
Set natural scrolling only for trackpads.
Change the current layout to the next available one.
Allows activating numlock or capslock at startup.
allows pausing keybind handling
also allows for bitcarrying-esque control of nested instances
default keybind is Ctrl+Logo+Alt+Shift+Esc, can be customized in config.h
Replace the singular keyboard and pointer input configuration with an array allowing to set different variables matching by name.
Tip to find the names: Grep for device_name
and add a
line after it to print to stdout. Then run EX:
dwl > /tmp/print_device_names.log
, exit dwl, and should
see the names.
Makes layout, mwfact and nmaster individual for every tag.
Forward the following events to client: swipe_begin, swipe_update, swipe_end, pinch_begin, pinch_update and pinch_end
This patch allows you to pinch zoom in Chrome, for example. In combination with the following patches gestures and shiftview, it would allow you to switch workspaces by performing a 3-finger swipe on your touchpad.
This patch adds 3 additional options to the Key
struct,
on_press
, on_repeat
and
on_release
which can be used to control which events a key
binding should be triggered on.
NOTE: Due to concerns about patching difficulties this patch does NOT
include any changes to config.def.h
. After applying you
will need to add the 3 additional initializers to each key binding that
you would like to modify. Any key binding that is not updated will cause
a build warning but should function as it does in vanilla.
Adds a config option to disable/enable primary selection (middle-click paste).
Adds functions pushup
and pushdown
to move
windows within the tiling order.
Allows the use of regular expressions for window rules "app_id" and "title"
static const Rule rules[] = {
// ...
{ "kitty-htop", NULL, 1 << 8, 0, -1 },
{ "^kitty$", NULL, 0, 0, -1 },
// ...
};
This patch will allow for a program to be used and have the current window regions on all monitors to be passed to the program as standard input.
example is grim -g "$(slurp)"
When resizing windows, the mouse will jump and resize the window in the quadrant that the resize starts at.
This patch modifies the behavior when selecting tags so that selecting a tag will also enable any other tags that were previously visible.
For example:
Moves clients to their old output when it is reattached.
Put newly connected monitors on the right, like X does.
Sets the current maximum open file descriptors to the maximum available limit.
This patch is useful - and solves issue #628 for running heavy Xwayland applications on systems that do not provide limits out of the box.
This patch provides the ability to rotate the tagset left / right. It implements a new function rotatetags which modifies the current tagset. Same as original dwm patch. Also adds ability to move focused client to left / right adjacent tag by specifying appropriate enum value as argument.
Implement https://github.com/wlrfx/scenefx
/* available options */
static const int opacity = 0; /* flag to enable opacity */
static const float opacity_inactive = 0.5;
static const float opacity_active = 1.0;
static const int shadow = 1; /* flag to enable shadow */
static const int shadow_only_floating = 0; /* only apply shadow to floating windows */
static const struct wlr_render_color shadow_color = COLOR(0x0000FFff);
static const struct wlr_render_color shadow_color_focus = COLOR(0xFF0000ff);
static const int shadow_blur_sigma = 20;
static const int shadow_blur_sigma_focus = 40;
static const char *const shadow_ignore_list[] = { "xdg-desktop-portal-gtk", NULL }; /* list of app-id to ignore */
static const int corner_radius = 0; /* 0 disables corner_radius */
static const int blur = 1; /* flag to enable blur */
static const int blur_optimized = 1;
static const int blur_ignore_transparent = 1;
static const struct blur_data blur_data = {
.radius = 5,
.num_passes = 3,
.noise = 0.02,
.brightness = 0.9,
.contrast = 0.9,
.saturation = 1.1,
};
NOTE: If you are using nix with flakes, scenefx has a flake for scenefx https://github.com/wlrfx/scenefx/blob/main/flake.nix
NOTE: Some GTK apps are being cut off when they have shadows enabled. You can use the
shadow_ignore_list
option to prevent shadows from being rendered on those apps
NOTE: Blur doesn't work on windows with opacity set (opacity_active, opacity_inactive)
NOTE: In DWL's Makefile
scenefx
must be placed before wlroots, e.g.PKGS = scenefx wlroots wayland-server ...
IMPORTANT: This patch only works with the
2ec3505248e819191c37cb831197629f373326fb
commit on the
main
branch of scenefx
, therefore, it does not
support blur.
IMPORTANT: This patch requires you to build DWL with the following dependencies
IMPORTANT: This patch only works with the
de4ec10e1ff9347b5833f00f8615d760d9378c99
commit on the
wlr_scene_blur
branch of scenefx
, as it adds
support for blur.
IMPORTANT: This patch requires you to build DWL with the dependencies of WLROOTS:
This patch adds scroll factor to dwl. The settings can be found in the trackpad section of the config. This allows user to control the sensitivity of 2-finger touchpad scrolling.
Allow configuring environment variables in config.h
Add keybindings to cycle through tags with visible clients.
Like smartborders. Don't put borders when there is only one window on the screen.
Restricts layout to only having one client in the master area.
Single set of tags shared between multiple monitors.
This patch allows all the tags to be shared between both (or more) monitors. So a single set of tags from 1 to 9 can be viewed on any monitor, as opposed to having separate tag sets 1 to 9 on each monitor.
Originally based on the dwm single_tagset patch: https://dwm.suckless.org/patches/single_tagset/
Pertag keeps layouts, mfact and nmaster per tag instead of per output.
This adapted version of pertag contains one version of the rules per all outputs, instead of one per output. This makes switching to tags from other monitors keep the window layout.
This patch expects singletagset patch to be already in your tree committed. It applies onto it.
This patch is incompatible with pertag.
Makes sticky work as expected with singletagset. The sticky window will stay on original output until you explicitely put it to a different monitor.
This patch expects both singletagset and sticky patches to be already in your tree committed. It applies onto them.
Adds a rule-based ability to skip automatically focusing a window on creation. Expected use-case is for transient windows like notifications etc. The window can still be focused by mouse or keyboard movement.
skipfocus value |
effect |
---|---|
0 | usual |
1 | skipautofocus |
2 | skipfocus entirely |
The borders of a window aren't drawn when the window is the only tiling window in its tag OR if the window is in a monocle layout.
Adds a spiral-inspired layout for wide screens.
Adds support for the gaps patch to the snail layout patch.
Install the gaps patch and the snail patch first.
Stacker is a patch that allows moving around the stack more freely. With only one keybinding, quickly move, swap and jump around the window stack.
relativeswap
.This patch is heavily inspired by the original stacker dwm patch.
MODKEY
+ {q
, w
,
e
, r
}: jump to the first, second, third and
last window of the stackMODKEY
+ SHIFT
+ {Q
,
W
, E
, R
}: swap the selected with
the first, second, third and last window of the stackMODKEY
+ SHIFT
+ {J
,
K
}: move the selected window up & down the stackJumping to the last selected window is not yet implemented.
allow passing startup command on argv
e.g. dwl -s foot -s
launches foot -s
put sh -c
right after dwl -s
to emulate
normal behaviour
Adds a toggleable function that makes a sticky client that is visible on all tags.
Originally based on dwm sticky patch.
Terminals swallow windows that they are the parent of.
foot is the terminal by default, you can change it in client rules in config.h.
2023-08-16 and up are made to also work with x windows: https://codeberg.org/dwl/dwl/issues/331
for freebsd users: apply swallow-freebsd.patch on top of swallow.patch
Focus the window (floating or no) to the left, right, above, or below the current focused window.
Swap the focused window with the window (no floating) to the left, right, above, or below.
NOTE: this patch uses the same algorithm that River uses to select the window in the given direction.
Add a rule option to switch to the configured tag when a window opens, then switch back when it closes.
Add a tab bar or window title to the top or bottom of windows.
implements wlr-tablet-v2 for drawing tablets and supports cursor emulation
inspired by @guyuming76's branch, with coding help from @Palanix and testing by @Thanatos
This patch adds support for tearing protocol. To get it working
export WLR_DRM_NO_ATOMIC=1
is probably required. Setting
ForceTearingRule
is also probably required since surfaces
always receive presentation hint 0 (VSYNC) as far as i can tell.
Set rules in the config.h (exact string match):
static const ForceTearingRule force_tearing[] = {
{.title = "", .appid = "oni.exe"},
{.title = "", .appid = "hl_linux"},
{.title = "", .appid = "steam_app_210970"},
};
Whenever a client title changes set the client's urgent flag.
Hacky solution I use to deal with qutebrowser not setting urgent flag when a new tab is opened.
Adds a function called togglepointerconstraints to turn pointer constraint enforcement on and off with a keybind.
Add a binding for the togglepointerconstraints function in the keys[] array of config.h. The function does not take any argument. Pointer constraints default to enabled, and can be toggled on and off with the function from there.
Example:
{ MODKEY, XKB_KEY_c, togglepointerconstraints, {0}},
This patch is no longer being maintained by me wochap, since I'm now using a different patch specific to my use case: https://codeberg.org/wochap/dwl/src/branch/v0.6-b/xkb-rules-switcher/xkb-rules-switcher.patch
Switch between multiple keyboard layouts at runtime.
Switch between multiple keyboard layouts, variants, and options at runtime.
Hide the mouse cursor if it isn't being used for a certain period of time.
Ungroup keyboard input devices based on device name.
I wrote this patch was because keyboard device grouping breaks the behaviour of the ydotool virtual device. This patch fixes my issue #558 in the codeberg issue tracker.
See the inputdevicerules patch for a more generalised version of this idea.
Adds (inner) gaps between client windows and (outer) gaps between windows and the screen edge in a flexible manner.
A variable column layout.
This layout behaves much the same as the tile
layout,
but adds key bindings that can be used to:
left
columnleft
columnView the next or previous tag, skipping any tags that do not have any clients.
implement wlr_virtual_pointer_v1 for things like wayvnc server to work
NOTE: no longer neccessary if you are using a DWL version after https://codeberg.org/dwl/dwl/commit/ac6074f4fdb8cc263c877f08e16a5805d3bb22d2
Warp cursor to the centre of newly focused clients.
Only moves the cursor if the cursor is currently not on the new client.
This is my version of the orphaned cursorwarp patch except I left out the config flag as I think it is unnecessary.
Implements the function winview
which switches the
visible tags to the tags on which the current client is visible.
This patch is inspired from https://dwm.suckless.org/patches/winview/. Citing the description of the dwm patch:
Dwm tags are a powerfull feature that allows organizing windows in workspaces. Sometime it can be difficult to remember the tag to activate to unhide a window. With the winview patch the window to unhide can be selected from the all-window view. The user switches to the all-window view (Mod1-0), selects the window (Mod1-j/k or using the mouse) and press Mod1-o. The key Mod1-o switches the view to the selected window tag.
Recommend patches
The grid layout is well adapted to display many windows in a limited space. Using both grid and pertag patches you will be able to select this layout for the all-window view while keeping your preferred layout for the other views. Configuration and Installation Using the default configuration file
Make sure the directory where you build dwm does not contain a config.h file; Apply the patch; Run make and make install.
Using an existing customised configuration file
Apply the patch; Add the following element in the keys array:
{ MODKEY, XK_o, winview, {0} },
Run make and make install.
An example of how to insert this line can be found in the default config file template, config.def.h.
Some windows (wine) games go black screen after losing focus and never recover https://github.com/swaywm/sway/issues/4324. This patch fixes this by handling minimize requests that some xwayland clients do.
This patch swaps the current window (C) with the previous master (P) when zooming.
Original behaviour :
+-----------------+-------+
| | |
| | |
| | |
| P +-------|
| | |
| | C |
| | |
+-----------------+-------+
+-----------------+-------+
| | |
| | P |
| | |
| C +-------|
| | |
| | |
| | |
+-----------------+-------+
New Behaviour :
+-----------------+-------+
| | |
| | |
| | |
| C +-------+
| | |
| | P |
| | |
+-----------------+-------+
+-----------------+-------+
| | |
| | |
| | |
| P +-------+
| | |
| | C |
| | |
+-----------------+-------+
This implements the DRM lease protocol, which is needed to use devices such as VR headsets.
Utilizing the /usr/include/X11/XF86keysym.h header file to change the volume via the appropriate keys.
Adds configurable transparency for focused and unfocused windows.
Newly created windows are placed above the currently selected window in the stack.
This is a port of attachtop patch for dwm: https://dwm.suckless.org/patches/attachtop
New client attaches below the last master/on top of the stack.
Behavior feels very intuitive as it doesn't disrupt existing masters no matter the amount of them, it only pushes the clients in stack down.
Adds keybindings for screen rotation and auto rotation from an accelerometer.
Find an accelerometer device in sysfs
(cat /sys/bus/iio/devices/iio*/name
, or using a script: monitor-iio.sh)
Find the raw output file of the accelerometer (e.g.
cat /sys/bus/iio/devices/iio:device0/in_accel_x_raw
should
output an integer).
Add the raw output file names to the dwl configuration
accel_*.
Add a udev rule to uniquely identify the device, for example:
sudo echo 'SUBSYSTEM=="iio", KERNEL=="iio*", ATTR{name}=="accel_3d", GROUP="input", SYMLINK+="input/accel"' >> /etc/udev/rules.d/99-accel.rules
sudo udevadm control --reload-rules && sudo udevadm trigger
(the device is probably already in /dev/ e.g.
/dev/iio:device0
but on my computer the number changes
after a reboot)
A symlink to the device should now be available in
/dev/input/
and accessible to input group members.
Add the device path to the dwl configuration
accel_path.
rotation_enabled
: If the auto rotation is enabled on
startup.rotation_delay
: How often to check the accelerometer
values in milliseconds.rotation_flat
: Threshold on the normalized Z axis to
consider the device flat and stop the auto rotation.rotation_thresh
: Rotation threshold after which the
screen flips (values less than 0.5 will cause a back and forth).accel_path
: The path to the accelerometer device file
(e.g. "/dev/input/accel").accel_x
: The name of the sysfs file for the
accelerometer x axis.accel_y
: The name of the sysfs file for the
accelerometer y axis.accel_z
: The name of the sysfs file for the
accelerometer z axis.Default keybindings:
<Modkey>
+ <Shift>
+
<Arrows>
: Change the screen rotation manually
(doesn't disable the auto rotation).<Modkey>
+ <Shift>
+
<R>
: Enable/disable the auto rotation.Adds a rule to automatically center clients on the current monitor.
Store your clipboard history using clipman
clipboard
manager without your KeePassXC passwords leaking into clipman.
Ensure these dependencies are installed (instructions for debian, other distros are left as an exercise...):
apt install clipman libmodern-perl-perl moreutils wl-clipboard
Change your command to launch dwl
to something like the
following:
dwl -s 'pee somebar dwl-getwindowtitle'
Ensure the following command is running in the background of your
dwl
session. Put it whereever your auto-started stuff
is.
exec wl-paste -t text --watch dwl-clipman
This solution is based on the following reddit post, modified to
support dwl
. https://www.reddit.com/r/swaywm/comments/ljl0dh/keeping_secrets_secret_with_keepassxc_clipman_and/
Feel free to use this code however you want, but I can't guarantee it
will work for what you are trying to do. Licenced under the same license
as dwl
, "WITHOUT WARRANTY OF ANY KIND".
Adds clipboard functionality. Requires the ipc patch for dwl and
wl-clipboard
to be installed. By default, requires clipman for the clipboard
and dwl-state for
getting the appid of the focused application, but you can change these
in the script if you have alternatives. You may change which
applications to not record by modifying the excludes
array
in dwl-cliboard-watcher
. Make sure
wl-paste -t text -w dwl-clipboard-watcher
is running after
dwl.
Adds function to cycle through available layouts.
Arranges windows in a Fibonacci spiral or dwindle.
+-----------+-----------+ +-----------+-----------+
| | | | | |
| | 2 | | | 2 |
| | | | | |
| 1 +--+--+-----+ | 1 +-----+-----+
| | 5|-.| | | | | 4 |
| +--+--+ 3 | | | 3 +--+--+
| | 4 | | | | | 5|-.|
+-----------+-----+-----+ +-----------+-----+-----+
spiral dwindle
Implements focusmon()
function that moves the cursor to
the focused monitor.
Focus the window left, right, above or below the current focused window
Focus the master regardless of the current focus.
This patch is a modified version of vanitygaps that adds gaps around clients regardless of a layout. It means you can apply any layout patch and the gaps will be shown properly as long as the layout does not add any gaps on its own.
This works by allowing a layout to place clients normally without
gaps, and then correcting positions and dimensions of clients afterwards
to add gaps around them. To make it work, I had to modify
resize()
function, and, as a side effect, this change fixed
some flickering I experienced when using snail layout.
2023-11-24:
gappih
, gappiv
,
gappoh
and gappov
with only
gappx
. They don't do anything anyways.Arranges windows in a grid of equal sizes.
Hide the cursor when typing
Allow for keyboard rules to be used; This allows for keyboard-specific options or layouts.
The keyboard's names can be retrieved from
libinput list-devices | grep Device
, example:
static const KeyboardRule kbrules[] = {
{ "AT Translated Set 2 keyboard", { .options = "altwin:swap_alt_win,caps:swapescape" } },
};
This patch implements sequences for chained keybindings (like the dwm keychord patch).
Notes:
5
in the
Keychord
struct for a given keybindingThe default values for MODKEY
and PREFIXKEY
can be changed in config.def.h
and/or
config.h
.
In the example below, the firefox
command is bound to
the key sequence alt-s alt-u f
.
static const Keychord keychords[] = {
/* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */
/* count key_sequences function argument */
{ 3, {{MODKEY, XKB_KEY_s}, {MODKEY, XKB_KEY_u}, {MOD_NONE, XKB_KEY_f}}, spawn, SHCMD("firefox") },
};
In the example below, the firefox
command is bound to
the key sequence alt-s u f
.
static const Keychord keychords[] = {
/* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */
/* count key_sequences function argument */
{ 3, {{MODKEY, XKB_KEY_s}, {MOD_NONE, XKB_KEY_u}, {MOD_NONE, XKB_KEY_f}}, spawn,SHCMD("firefox") },
};
Print current keyboard layout to stdout
Show the master area to the right.
I created this patch for a user on Discord and I have never used it.
This patch adds the option to let the cursor jump to the center of new clients, as well as move the cursor to the center of clients that gains focus.
Extend the movestack patch to let you also focus, or move, a client to the top or bottom of the stack.
Prevent focus on mouseover.
Only exit when no windows are open
Adds the -u option that allows users to pass a desired uid to drop to after becoming DRM master.
When resizing windows, the mouse will no longer jump to the bottom right corner and only resize from that corner. Instead, the mouse will resize the window in the quadrant that the resize starts at. This is the same resize behavior as Sway and is similar to the resizehere dwm patch.
This patch allows you to restart dwl with a keybinding.
NOTE: that all of your applications are gonna get
killed on dwl restart.
The function creates a file at /tmp/restart_dwl and
exits dwl.
You have to modify your dwl launch script in order for this patch to
work.
Example dwl launch script:
do=true
while $do || [ -f /tmp/restart_dwl ]; do
do=false
rm -rf /tmp/restart_dwl > /dev/null 2>&1
dwl
done
It's a do-while that checks if /tmp/restart_dwl
exists after the first run of dwl.
If this file exists delete it and start dwl again.
All floating windows become tiling when switching to a different layout.
Add a rule to clients to spawn them sticky on start up. I personally use it to make dragon show up on all tags.
Apply on top of sticky patch.
Implements just enough of the sway-ipc
protocol to
facilitate status bars. Tested with waybar
and
rootbar
.
Adds SIMPLE touchscreen functionality.
Currently emulates mouse
movement and button presses.
A tiled layout optimized for wide vertical monitors.
|---------------------------|
| |
| |
| M |
| |
| |
|---------------------------|
| t1 |
|---------------------------|
| t2 |
|---------------------------|
| t3 |
|---------------------------|
Set cursor theme and size via XCURSOR_THEME
and
XCURSOR_SIZE
environmental variables.