Compare commits

..

No commits in common. "4f35f775dc5f146ed300d0890db914d52e1b61a5" and "c930463debea5f664c03023fdab1fd55f35402b5" have entirely different histories.

10 changed files with 208 additions and 626 deletions

View file

@ -1 +1,3 @@
Lennart Jablonka <humm@ljabl.com> <hummsmith42@gmail.com> Lennart Jablonka <humm@ljabl.com> <hummsmith42@gmail.com>
Leonardo Hernández Hernández <leohdz172@proton.me> <leohdz172@outlook.com>
Leonardo Hernández Hernández <leohdz172@proton.me> <leohdz172@protonmail.com>

View file

@ -1,13 +1,36 @@
# Changelog # Changelog
* [Unreleased](#unreleased)
* [0.7](#0.7) * [0.7](#0.7)
* [0.6](#0.6) * [0.6](#0.6)
* [0.5](#0.5) * [0.5](#0.5)
## Unreleased
### Added
* Support for the linux-drm-syncobj-v1 protocol ([wlroots!4715][wlroots!4715], [#685][685])
* Allow the use of non-system wlroots library ([#646][646])
[wlroots!4715]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4715
[685]: https://codeberg.org/dwl/dwl/pulls/685
[646]: https://codeberg.org/dwl/dwl/pulls/646
### Changed
### Deprecated
### Removed
### Fixed
* Crash when a client is created while all outputs are disabled.
### Security
### Contributors
## 0.7 ## 0.7
See also [0.6](#0.6) release notes. 0.7 builds against wlroots 0.18.x. This version is just 0.6 with wlroots 0.18 compatibility.
### Added ### Added
@ -18,15 +41,9 @@ See also [0.6](#0.6) release notes. 0.7 builds against wlroots 0.18.x.
[601]: https://codeberg.org/dwl/dwl/issues/601 [601]: https://codeberg.org/dwl/dwl/issues/601
### Fixed
* Crash when re-mapping unmapped clients.
### Contributors ### Contributors
Guido Cella Guido Cella
Lennart Jablonka
## 0.6 ## 0.6

View file

@ -6,15 +6,15 @@ include config.mk
# flags for compiling # flags for compiling
DWLCPPFLAGS = -I. -DWLR_USE_UNSTABLE -D_POSIX_C_SOURCE=200809L \ DWLCPPFLAGS = -I. -DWLR_USE_UNSTABLE -D_POSIX_C_SOURCE=200809L \
-DVERSION=\"$(VERSION)\" $(XWAYLAND) -DVERSION=\"$(VERSION)\" $(XWAYLAND)
DWLDEVCFLAGS = -g -pedantic -Wall -Wextra -Wdeclaration-after-statement \ DWLDEVCFLAGS = -g -Wpedantic -Wall -Wextra -Wdeclaration-after-statement \
-Wno-unused-parameter -Wshadow -Wunused-macros -Werror=strict-prototypes \ -Wno-unused-parameter -Wshadow -Wunused-macros -Werror=strict-prototypes \
-Werror=implicit -Werror=return-type -Werror=incompatible-pointer-types \ -Werror=implicit -Werror=return-type -Werror=incompatible-pointer-types \
-Wfloat-conversion -Wfloat-conversion
# CFLAGS / LDFLAGS # CFLAGS / LDFLAGS
PKGS = wlroots-0.18 wayland-server xkbcommon libinput pixman-1 fcft $(XLIBS) PKGS = wayland-server xkbcommon libinput pixman-1 fcft $(XLIBS)
DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(DWLCPPFLAGS) $(DWLDEVCFLAGS) $(CFLAGS) DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(WLR_INCS) $(DWLCPPFLAGS) $(DWLDEVCFLAGS) $(CFLAGS)
LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` -lm $(LIBS) LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` $(WLR_LIBS) -lm $(LIBS)
all: dwl all: dwl
dwl: dwl.o util.o dwl: dwl.o util.o
@ -61,6 +61,7 @@ dist: clean
install: dwl install: dwl
mkdir -p $(DESTDIR)$(PREFIX)/bin mkdir -p $(DESTDIR)$(PREFIX)/bin
rm -f $(DESTDIR)$(PREFIX)/bin/dwl
cp -f dwl $(DESTDIR)$(PREFIX)/bin cp -f dwl $(DESTDIR)$(PREFIX)/bin
chmod 755 $(DESTDIR)$(PREFIX)/bin/dwl chmod 755 $(DESTDIR)$(PREFIX)/bin/dwl
mkdir -p $(DESTDIR)$(MANDIR)/man1 mkdir -p $(DESTDIR)$(MANDIR)/man1

View file

@ -18,22 +18,14 @@ philosophy. Like dwm, dwl is:
- [autostart](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/autostart) - [autostart](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/autostart)
- [bar](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/bar) - [bar](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/bar)
- [barheight](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/barheight) - [barheight](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/barheight)
- [centeredmaster](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/centeredmaster)
- [column](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/column)
- [cursortheme](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/cursortheme) - [cursortheme](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/cursortheme)
- [deck](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/deck)
- [en-keycodes](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/en-keycodes) - [en-keycodes](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/en-keycodes)
- [genericgaps](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/genericgaps) - [genericgaps](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/genericgaps/)
- [hide_vacant_tags](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/hide_vacant_tags) - [hide_vacant_tags](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/hide_vacant_tags)
- [inputdevicerules](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/inputdevicerules) - [inputdevicerules](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/inputdevicerules)
- [nextlayout](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/nextlayout)
- [pertag](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/pertag)
- [primaryselection](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/primaryselection)
- [rotatetags](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/rotatetags) - [rotatetags](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/rotatetags)
- [setupenv](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/setupenv) - [setupenv](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/setupenv)
- [sticky](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/sticky) - [sticky](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/sticky)
- [swallow](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/swallow)
- [swallow-freebsd](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/swallow)
- [xkb-rules-switcher](https://codeberg.org/wochap/dwl/src/branch/v0.6-b/xkb-rules-switcher/xkb-rules-switcher.patch) - [xkb-rules-switcher](https://codeberg.org/wochap/dwl/src/branch/v0.6-b/xkb-rules-switcher/xkb-rules-switcher.patch)
## Getting Started: ## Getting Started:
@ -221,4 +213,3 @@ inspiration, and to the various contributors to the project, including:
[wiki]: https://codeberg.org/dwl/dwl/wiki/Home#compatible-status-bars [wiki]: https://codeberg.org/dwl/dwl/wiki/Home#compatible-status-bars
[Discord server]: https://discord.gg/jJxZnrGPWN [Discord server]: https://discord.gg/jJxZnrGPWN
[Wayland]: https://wayland.freedesktop.org/ [Wayland]: https://wayland.freedesktop.org/

View file

@ -126,27 +126,14 @@ client_get_appid(Client *c)
{ {
#ifdef XWAYLAND #ifdef XWAYLAND
if (client_is_x11(c)) if (client_is_x11(c))
return c->surface.xwayland->class; return c->surface.xwayland->class ? c->surface.xwayland->class : "broken";
#endif #endif
return c->surface.xdg->toplevel->app_id; return c->surface.xdg->toplevel->app_id ? c->surface.xdg->toplevel->app_id : "broken";
}
static inline int
client_get_pid(Client *c)
{
pid_t pid;
#ifdef XWAYLAND
if (client_is_x11(c))
return c->surface.xwayland->pid;
#endif
wl_client_get_credentials(c->surface.xdg->client->client, &pid, NULL, NULL);
return pid;
} }
static inline void static inline void
client_get_clip(Client *c, struct wlr_box *clip) client_get_clip(Client *c, struct wlr_box *clip)
{ {
struct wlr_box xdg_geom = {0};
*clip = (struct wlr_box){ *clip = (struct wlr_box){
.x = 0, .x = 0,
.y = 0, .y = 0,
@ -159,9 +146,8 @@ client_get_clip(Client *c, struct wlr_box *clip)
return; return;
#endif #endif
wlr_xdg_surface_get_geometry(c->surface.xdg, &xdg_geom); clip->x = c->surface.xdg->geometry.x;
clip->x = xdg_geom.x; clip->y = c->surface.xdg->geometry.y;
clip->y = xdg_geom.y;
} }
static inline void static inline void
@ -176,7 +162,7 @@ client_get_geometry(Client *c, struct wlr_box *geom)
return; return;
} }
#endif #endif
wlr_xdg_surface_get_geometry(c->surface.xdg, geom); *geom = c->surface.xdg->geometry;
} }
static inline Client * static inline Client *
@ -212,9 +198,9 @@ client_get_title(Client *c)
{ {
#ifdef XWAYLAND #ifdef XWAYLAND
if (client_is_x11(c)) if (client_is_x11(c))
return c->surface.xwayland->title; return c->surface.xwayland->title ? c->surface.xwayland->title : "broken";
#endif #endif
return c->surface.xdg->toplevel->title; return c->surface.xdg->toplevel->title ? c->surface.xdg->toplevel->title : "broken";
} }
static inline int static inline int
@ -313,17 +299,6 @@ client_notify_enter(struct wlr_surface *s, struct wlr_keyboard *kb)
wlr_seat_keyboard_notify_enter(seat, s, NULL, 0, NULL); wlr_seat_keyboard_notify_enter(seat, s, NULL, 0, NULL);
} }
static inline void
client_restack_surface(Client *c)
{
#ifdef XWAYLAND
if (client_is_x11(c))
wlr_xwayland_surface_restack(c->surface.xwayland, NULL,
XCB_STACK_MODE_ABOVE);
#endif
return;
}
static inline void static inline void
client_send_close(Client *c) client_send_close(Client *c)
{ {
@ -356,6 +331,13 @@ client_set_fullscreen(Client *c, int fullscreen)
wlr_xdg_toplevel_set_fullscreen(c->surface.xdg->toplevel, fullscreen); wlr_xdg_toplevel_set_fullscreen(c->surface.xdg->toplevel, fullscreen);
} }
static inline void
client_set_scale(struct wlr_surface *s, float scale)
{
wlr_fractional_scale_v1_notify_scale(s, scale);
wlr_surface_set_preferred_buffer_scale(s, (int32_t)ceilf(scale));
}
static inline uint32_t static inline uint32_t
client_set_size(Client *c, uint32_t width, uint32_t height) client_set_size(Client *c, uint32_t width, uint32_t height)
{ {
@ -376,8 +358,11 @@ static inline void
client_set_tiled(Client *c, uint32_t edges) client_set_tiled(Client *c, uint32_t edges)
{ {
#ifdef XWAYLAND #ifdef XWAYLAND
if (client_is_x11(c)) if (client_is_x11(c)) {
wlr_xwayland_surface_set_maximized(c->surface.xwayland,
edges != WLR_EDGE_NONE, edges != WLR_EDGE_NONE);
return; return;
}
#endif #endif
if (wl_resource_get_version(c->surface.xdg->toplevel->resource) if (wl_resource_get_version(c->surface.xdg->toplevel->resource)
>= XDG_TOPLEVEL_STATE_TILED_RIGHT_SINCE_VERSION) { >= XDG_TOPLEVEL_STATE_TILED_RIGHT_SINCE_VERSION) {
@ -403,8 +388,8 @@ client_wants_focus(Client *c)
{ {
#ifdef XWAYLAND #ifdef XWAYLAND
return client_is_unmanaged(c) return client_is_unmanaged(c)
&& wlr_xwayland_or_surface_wants_focus(c->surface.xwayland) && wlr_xwayland_surface_override_redirect_wants_focus(c->surface.xwayland)
&& wlr_xwayland_icccm_input_model(c->surface.xwayland) != WLR_ICCCM_INPUT_MODEL_NONE; && wlr_xwayland_surface_icccm_input_model(c->surface.xwayland) != WLR_ICCCM_INPUT_MODEL_NONE;
#endif #endif
return 0; return 0;
} }

View file

@ -7,6 +7,14 @@
static const int sloppyfocus = 1; /* focus follows mouse */ static const int sloppyfocus = 1; /* focus follows mouse */
static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */ static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */
static const unsigned int borderpx = 1; /* border pixel of windows */ static const unsigned int borderpx = 1; /* border pixel of windows */
static const int smartgaps = 0; /* 1 means no outer gap when there is only one window */
static const int monoclegaps = 0; /* 1 means outer gaps in monocle layout */
static const unsigned int gappih = 10; /* horiz inner gap between windows */
static const unsigned int gappiv = 10; /* vert inner gap between windows */
static const unsigned int gappoh = 10; /* horiz outer gap between windows and screen edge */
static const unsigned int gappov = 10; /* vert outer gap between windows and screen edge */
static const char *cursor_theme = NULL;
static const char cursor_size[] = "24"; /* Make sure it's a valid integer, otherwise things will break */
static const int user_bh = 30; /* 0 means that dwl will calculate barheight, >= 1 means dwl will use user_bh as the bar height. */ static const int user_bh = 30; /* 0 means that dwl will calculate barheight, >= 1 means dwl will use user_bh as the bar height. */
static const int showbar = 1; /* 0 means no bar */ static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */ static const int topbar = 1; /* 0 means bottom bar */
@ -14,9 +22,6 @@ static const char *fonts[] = {"monospace:size=10"};
static const float rootcolor[] = COLOR(0x000000ff); static const float rootcolor[] = COLOR(0x000000ff);
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */ /* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */ static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
static int enableautoswallow = 1; /* enables autoswallowing newly spawned clients */
static const char *cursor_theme = NULL;
static const char cursor_size[] = "24"; /* Make sure it's a valid integer, otherwise things will break */
static uint32_t colors[][3] = { static uint32_t colors[][3] = {
/* fg bg border */ /* fg bg border */
[SchemeNorm] = { 0xbbbbbbff, 0x222222ff, 0x444444ff }, [SchemeNorm] = { 0xbbbbbbff, 0x222222ff, 0x444444ff },
@ -52,11 +57,10 @@ static const char *const autostart[] = {
/* NOTE: ALWAYS keep a rule declared even if you don't use rules (e.g leave at least one example) */ /* NOTE: ALWAYS keep a rule declared even if you don't use rules (e.g leave at least one example) */
static const Rule rules[] = { static const Rule rules[] = {
/* app_id title tags mask isfloating isterm noswallow monitor */ /* app_id title tags mask isfloating monitor */
/* examples: */ /* examples: */
{ "foot", NULL, 0, 0, 1, 1, -1 }, { "Gimp_EXAMPLE", NULL, 0, 1, -1 }, /* Start on currently visible tags floating, not tiled */
{ "Gimp_EXAMPLE", NULL, 0, 1, 0, 0, -1 }, /* Start on currently visible tags floating, not tiled */ { "firefox_EXAMPLE", NULL, 1 << 8, 0, -1 }, /* Start on ONLY tag "9" */
{ "firefox_EXAMPLE", NULL, 1 << 8, 0, 0, 0, -1 }, /* Start on ONLY tag "9" */
}; };
/* layout(s) */ /* layout(s) */
@ -65,10 +69,6 @@ static const Layout layouts[] = {
{ "[]=", tile }, { "[]=", tile },
{ "><>", NULL }, /* no layout function means floating behavior */ { "><>", NULL }, /* no layout function means floating behavior */
{ "[M]", monocle }, { "[M]", monocle },
{ "|M|", centeredmaster },
{ "||", col },
{ "[D]", deck },
{ NULL, NULL }, /* terminate */
}; };
/* monitors */ /* monitors */
@ -122,7 +122,6 @@ static const int natural_scrolling = 0;
static const int disable_while_typing = 1; static const int disable_while_typing = 1;
static const int left_handed = 0; static const int left_handed = 0;
static const int middle_button_emulation = 0; static const int middle_button_emulation = 0;
static const int enable_primary_selection = 0;
/* You can choose between: /* You can choose between:
LIBINPUT_CONFIG_SCROLL_NO_SCROLL LIBINPUT_CONFIG_SCROLL_NO_SCROLL
LIBINPUT_CONFIG_SCROLL_2FG LIBINPUT_CONFIG_SCROLL_2FG
@ -212,15 +211,9 @@ static const Key keys[] = {
{ MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} }, { MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} }, { MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} }, { MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
{ MODKEY, XKB_KEY_c, setlayout, {.v = &layouts[3]} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, setlayout, {.v = &layouts[4]} },
{ MODKEY, XKB_KEY_p, setlayout, {.v = &layouts[5]} },
{ MODKEY, XKB_KEY_space, setlayout, {0} }, { MODKEY, XKB_KEY_space, setlayout, {0} },
{ MODKEY, XKB_KEY_n, nextlayout, {0} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
{ MODKEY, XKB_KEY_e, togglefullscreen, {0} }, { MODKEY, XKB_KEY_e, togglefullscreen, {0} },
{ WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT, XKB_KEY_a, toggleswallow, {0} },
{ WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT, XKB_KEY_A, toggleautoswallow,{0} },
{ MODKEY, XKB_KEY_u, togglepointer, {0} }, { MODKEY, XKB_KEY_u, togglepointer, {0} },
{ MODKEY, XKB_KEY_0, view, {.ui = ~0} }, { MODKEY, XKB_KEY_0, view, {.ui = ~0} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} },

View file

@ -10,13 +10,12 @@ static const unsigned int gappih = 4; /* horiz inner gap between windo
static const unsigned int gappiv = 4; /* vert inner gap between windows */ static const unsigned int gappiv = 4; /* vert inner gap between windows */
static const unsigned int gappoh = 1; /* horiz outer gap between windows and screen edge */ static const unsigned int gappoh = 1; /* horiz outer gap between windows and screen edge */
static const unsigned int gappov = 1; /* vert outer gap between windows and screen edge */ static const unsigned int gappov = 1; /* vert outer gap between windows and screen edge */
static int enableautoswallow = 1; /* enables autoswallowing newly spawned clients */
static const char *cursor_theme = "macOS"; static const char *cursor_theme = "macOS";
static const char cursor_size[] = "28"; /* Make sure it's a valid integer, otherwise things will break */ static const char cursor_size[] = "28"; /* Make sure it's a valid integer, otherwise things will break */
static const int user_bh = 30; /* 0 means that dwl will calculate barheight, >= 1 means dwl will use user_bh as the bar height. */ static const int user_bh = 30; /* 0 means that dwl will calculate barheight, >= 1 means dwl will use user_bh as the bar height. */
static const int showbar = 1; /* 0 means no bar */ static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */ static const int topbar = 1; /* 0 means bottom bar */
static const char *fonts[] = {"Inconsolata:size=12"}; static const char *fonts[] = {"inconsolata:size=11"};
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */ /* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */ static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
@ -37,8 +36,6 @@ static int log_level = WLR_ERROR;
static const Env envs[] = { static const Env envs[] = {
/* variable value */ /* variable value */
{ "XDG_CURRENT_DESKTOP", "wlroots" }, { "XDG_CURRENT_DESKTOP", "wlroots" },
{ "XCURSOR_THEME", "macOS" },
{ "SDL_VIDEODRIVER", "wayland" },
}; };
/* Autostart */ /* Autostart */
@ -54,12 +51,10 @@ static const char *const autostart[] = {
/* NOTE: ALWAYS keep a rule declared even if you don't use rules (e.g leave at least one example) */ /* NOTE: ALWAYS keep a rule declared even if you don't use rules (e.g leave at least one example) */
static const Rule rules[] = { static const Rule rules[] = {
/* app_id title tags mask isfloating isterm noswallow monitor */ /* app_id title tags mask isfloating monitor */
/* examples: */ /* examples: */
{ "foot", NULL, 0, 0, 1, 1, -1 }, /* make foot swallow clients that are not foot */ { "Gimp_EXAMPLE", NULL, 0, 1, -1 }, /* Start on currently visible tags floating, not tiled */
{ "Gimp_EXAMPLE", NULL, 0, 1, 0, 0, -1 }, /* Start on currently visible tags floating, not tiled */ { "firefox_EXAMPLE", NULL, 1 << 8, 0, -1 }, /* Start on ONLY tag "9" */
{ "firefox_EXAMPLE", NULL, 1 << 8, 0, 0, 0, -1 }, /* Start on ONLY tag "9" */
{ "mpv", "webcam", 0, 1, 0, 0, -1 }, /* Launch camera as floating only*/
}; };
/* layout(s) */ /* layout(s) */
@ -68,10 +63,6 @@ static const Layout layouts[] = {
{ "[]=", tile }, { "[]=", tile },
{ "><>", NULL }, /* no layout function means floating behavior */ { "><>", NULL }, /* no layout function means floating behavior */
{ "[M]", monocle }, { "[M]", monocle },
{ "|M|", centeredmaster },
{ "||", col },
{ "[D]", deck },
{ NULL, NULL }, /* terminate */
}; };
/* monitors */ /* monitors */
@ -106,7 +97,7 @@ static const struct xkb_rule_names xkb_rules[] = {
static const InputRule inputrules[] = { static const InputRule inputrules[] = {
/* name kbcreate ptrcreate */ /* name kbcreate ptrcreate */
/* ignore bad device - like a touchpad ;) */ /* ignore bad device - like a touchpad ;) */
{ "Synaptics TM3276-022", NULL, NULL }, { "BAD DEVICE", NULL, NULL },
/* ungroup ydotool device - fixes a bug */ /* ungroup ydotool device - fixes a bug */
{ "ydotoold virtual device", createungroupedkeyboard, createpointer }, { "ydotoold virtual device", createungroupedkeyboard, createpointer },
/* put your touchpad name here to enable toggle touchpad */ /* put your touchpad name here to enable toggle touchpad */
@ -125,7 +116,6 @@ static const int natural_scrolling = 0;
static const int disable_while_typing = 1; static const int disable_while_typing = 1;
static const int left_handed = 0; static const int left_handed = 0;
static const int middle_button_emulation = 0; static const int middle_button_emulation = 0;
static const int enable_primary_selection = 0;
/* You can choose between: /* You can choose between:
LIBINPUT_CONFIG_SCROLL_NO_SCROLL LIBINPUT_CONFIG_SCROLL_NO_SCROLL
LIBINPUT_CONFIG_SCROLL_2FG LIBINPUT_CONFIG_SCROLL_2FG
@ -153,7 +143,7 @@ LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT
LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE
*/ */
static const enum libinput_config_accel_profile accel_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE; static const enum libinput_config_accel_profile accel_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE;
static const double accel_speed = 0.3; static const double accel_speed = 0.0;
/* You can choose between: /* You can choose between:
LIBINPUT_CONFIG_TAP_MAP_LRM -- 1/2/3 finger tap maps to left/right/middle LIBINPUT_CONFIG_TAP_MAP_LRM -- 1/2/3 finger tap maps to left/right/middle
@ -175,18 +165,14 @@ static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TA
/* commands */ /* commands */
static const char *termcmd[] = { "footclient", NULL }; // Terminal static const char *termcmd[] = { "footclient", NULL }; // Terminal
static const char *menucmd[] = { "fuzzel", NULL }; // Application launcher static const char *menucmd[] = { "tofi-drun", NULL }; // Application launcher
static const char *fmgrcmd[] = { "footclient", "--title", "lf", "lf", NULL }; // File manager static const char *fmgrcmd[] = { "footclient", "--title", "lf", "lf", NULL }; // File manager
static const char *sptfcmd[] = { "footclient", "--title", "Spotify", "spotify_player", NULL }; // Spotify client static const char *sptfcmd[] = { "footclient", "--title", "Spotify", "spotify_player", NULL }; // Spotify client
static const char *ncmxcmd[] = { "footclient", "--title", "ncpamixer", "ncpamixer", NULL }; // Volume control static const char *ncmxcmd[] = { "footclient", "--title", "ncpamixer", "ncpamixer", NULL }; // Volume control
static const char *blthcmd[] = { "footclient", "--title", "bluetui", "bluetui", NULL }; // Bluetooth manager static const char *blthcmd[] = { "footclient", "--title", "bluetui", "bluetui", NULL }; // Bluetooth manager
static const char *lockcmd[] = { "swaylock", NULL }; // Launch swaylock static const char *lockcmd[] = { "swaylock", NULL }; // Launch swaylock
static const char *camrcmd[] = { "camera", NULL }; // Launch mpv window showing my camera
static const char *recscmd[] = { "recordscreen", NULL }; // Launch recording menu
static const char *pwmncmd[] = { "powermenu", NULL }; // Launch powermenu static const char *pwmncmd[] = { "powermenu", NULL }; // Launch powermenu
static const char *emojcmd[] = { "tofiunicode", NULL }; // Launch emoji menu static const char *emojcmd[] = { "tofiunicode", NULL }; // Launch emoji menu
static const char *btopcmd[] = { "footclient", "--title", "btop", "btop", NULL }; // Launch btop
static const char *musicmd[] = { "footclient", "--title", "cmus", "cmus", NULL }; // cmus player
static const Key keys[] = { static const Key keys[] = {
/* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */ /* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */
@ -198,33 +184,28 @@ static const Key keys[] = {
{ MODKEY, XKB_KEY_b, spawn, {.v = blthcmd} }, { MODKEY, XKB_KEY_b, spawn, {.v = blthcmd} },
{ MODKEY, XKB_KEY_v, spawn, {.v = ncmxcmd} }, { MODKEY, XKB_KEY_v, spawn, {.v = ncmxcmd} },
{ MODKEY, XKB_KEY_l, spawn, {.v = lockcmd} }, { MODKEY, XKB_KEY_l, spawn, {.v = lockcmd} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, spawn, {.v = camrcmd} },
{ WLR_MODIFIER_SHIFT, XKB_KEY_Print, spawn, {.v = recscmd} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_E, spawn, {.v = emojcmd} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_E, spawn, {.v = emojcmd} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Q, spawn, {.v = pwmncmd} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Q, spawn, {.v = pwmncmd} },
{ MODKEY, XKB_KEY_Delete, spawn, {.v = btopcmd} }, { 0, XKB_KEY_XF86AudioMicMute, spawn,SHCMD("setvol -m mute") },
{ MODKEY, XKB_KEY_m, spawn, {.v = musicmd} }, { WLR_MODIFIER_SHIFT, XKB_KEY_XF86AudioLowerVolume, spawn,SHCMD("setvol -m down") },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_R, spawn, SHCMD("grim -g \"$(slurp -d)\" - | wl-copy") }, { WLR_MODIFIER_SHIFT, XKB_KEY_XF86AudioRaiseVolume, spawn,SHCMD("setvol -m up") },
{ 0, XKB_KEY_XF86AudioMicMute, spawn,SHCMD("wpctl set-mute @DEFAULT_SOURCE@ toggle && pkill -RTMIN+3 slstatus") }, { 0, XKB_KEY_XF86AudioMute, spawn,SHCMD("setvol mute") },
{ WLR_MODIFIER_SHIFT, XKB_KEY_XF86AudioLowerVolume, spawn,SHCMD("wpctl set-volume -l 1.0 @DEFAULT_SOURCE@ 5%- && pkill -RTMIN+3 slstatus") }, { 0, XKB_KEY_XF86AudioLowerVolume, spawn,SHCMD("setvol down") },
{ WLR_MODIFIER_SHIFT, XKB_KEY_XF86AudioRaiseVolume, spawn,SHCMD("wpctl set-volume -l 1.0 @DEFAULT_SOURCE@ 5%+ && pkill -RTMIN+3 slstatus") }, { 0, XKB_KEY_XF86AudioRaiseVolume, spawn,SHCMD("setvol up") },
{ 0, XKB_KEY_XF86AudioMute, spawn,SHCMD("wpctl set-mute @DEFAULT_SINK@ toggle && pkill -RTMIN+2 slstatus") }, { 0, XKB_KEY_XF86MonBrightnessUp, spawn,SHCMD("setbrightness increase")},
{ 0, XKB_KEY_XF86AudioLowerVolume, spawn,SHCMD("wpctl set-volume -l 1.0 @DEFAULT_SINK@ 5%- && pkill -RTMIN+3 slstatus") }, { 0, XKB_KEY_XF86MonBrightnessDown,spawn,SHCMD("setbrightness decrease")},
{ 0, XKB_KEY_XF86AudioRaiseVolume, spawn,SHCMD("wpctl set-volume -l 1.0 @DEFAULT_SINK@ 5%+ && pkill -RTMIN+2 slstatus") },
{ 0, XKB_KEY_XF86MonBrightnessUp, spawn,SHCMD("brillo -a -u 125000 -q -A 5")},
{ 0, XKB_KEY_XF86MonBrightnessDown,spawn,SHCMD("brillo -a -u 125000 -q -U 5")},
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_B, togglebar, {0} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_B, togglebar, {0} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_S, togglesticky, {0} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_S, togglesticky, {0} },
{ MODKEY, XKB_KEY_j, focusstack, {.i = +1} }, { MODKEY, XKB_KEY_j, focusstack, {.i = +1} },
{ MODKEY, XKB_KEY_k, focusstack, {.i = -1} }, { MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
{ MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_q, incnmaster, {.i = -1} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_A, incnmaster, {.i = -1} },
{ MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_e, incnmaster, {.i = +1} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_D, incnmaster, {.i = +1} },
{ MODKEY, XKB_KEY_a, rotatetags, {.i = VIEW_L} }, { MODKEY, XKB_KEY_a, rotatetags, {.i = VIEW_L} },
{ MODKEY, XKB_KEY_d, rotatetags, {.i = VIEW_R} }, { MODKEY, XKB_KEY_d, rotatetags, {.i = VIEW_R} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_A, rotatetags, {.i = SHIFT_L} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_A, rotatetags, {.i = SHIFT_L} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_D, rotatetags, {.i = SHIFT_R} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_D, rotatetags, {.i = SHIFT_R} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Z, setmfact, {.f = -0.05f} }, { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_a, setmfact, {.f = -0.05f} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_X, setmfact, {.f = +0.05f} }, { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_d, setmfact, {.f = +0.05f} },
{ MODKEY, XKB_KEY_w, switchxkbrule, {0} }, { MODKEY, XKB_KEY_w, switchxkbrule, {0} },
/* /*
{ MODKEY, XKB_KEY_h, incgaps, {.i = +1 } }, { MODKEY, XKB_KEY_h, incgaps, {.i = +1 } },
@ -245,26 +226,18 @@ static const Key keys[] = {
{ MODKEY|WLR_MODIFIER_LOGO, XKB_KEY_o, incohgaps, {.i = -1 } }, { MODKEY|WLR_MODIFIER_LOGO, XKB_KEY_o, incohgaps, {.i = -1 } },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Y, incovgaps, {.i = +1 } }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Y, incovgaps, {.i = +1 } },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_O, incovgaps, {.i = -1 } }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_O, incovgaps, {.i = -1 } },
*/
{ MODKEY, XKB_KEY_Return, zoom, {0} }, { MODKEY, XKB_KEY_Return, zoom, {0} },
{ MODKEY, XKB_KEY_Tab, view, {0} }, { MODKEY, XKB_KEY_Tab, view, {0} },
*/
{ MODKEY, XKB_KEY_q, killclient, {0} }, { MODKEY, XKB_KEY_q, killclient, {0} },
/*
{ MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} }, { MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} }, { MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} }, { MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
{ MODKEY, XKB_KEY_c, setlayout, {.v = &layouts[3]} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, setlayout, {.v = &layouts[4]} },
{ MODKEY, XKB_KEY_p, setlayout, {.v = &layouts[5]} },
*/
{ MODKEY, XKB_KEY_n, nextlayout, {0} },
/* /*
{ MODKEY, XKB_KEY_space, setlayout, {0} }, { MODKEY, XKB_KEY_space, setlayout, {0} },
*/ */
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_F, togglefullscreen, {0} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_F, togglefullscreen, {0} },
{ MODKEY, XKB_KEY_g, toggleswallow, {0} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_G, toggleautoswallow,{0} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_U, togglepointer, {0} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_U, togglepointer, {0} },
/* /*
{ MODKEY, XKB_KEY_0, view, {.ui = ~0} }, { MODKEY, XKB_KEY_0, view, {.ui = ~0} },

View file

@ -1,4 +1,4 @@
_VERSION = 0.7 _VERSION = 0.8-dev
VERSION = `git describe --tags --dirty 2>/dev/null || echo $(_VERSION)` VERSION = `git describe --tags --dirty 2>/dev/null || echo $(_VERSION)`
PKG_CONFIG = pkg-config PKG_CONFIG = pkg-config
@ -8,10 +8,29 @@ PREFIX = /usr/local
MANDIR = $(PREFIX)/share/man MANDIR = $(PREFIX)/share/man
DATADIR = $(PREFIX)/share DATADIR = $(PREFIX)/share
WLR_INCS = `$(PKG_CONFIG) --cflags wlroots-0.19`
WLR_LIBS = `$(PKG_CONFIG) --libs wlroots-0.19`
# Allow using an alternative wlroots installations
# This has to have all the includes required by wlroots, e.g:
# Assuming wlroots git repo is "${PWD}/wlroots" and you only ran "meson setup build && ninja -C build"
#WLR_INCS = -I/usr/include/pixman-1 -I/usr/include/elogind -I/usr/include/libdrm \
# -I$(PWD)/wlroots/include
# Set -rpath to avoid using the wrong library.
#WLR_LIBS = -Wl,-rpath,$(PWD)/wlroots/build -L$(PWD)/wlroots/build -lwlroots-0.19
# Assuming you ran "meson setup --prefix ${PWD}/0.19 build && ninja -C build install"
#WLR_INCS = -I/usr/include/pixman-1 -I/usr/include/elogind -I/usr/include/libdrm \
# -I$(PWD)/wlroots/0.19/include/wlroots-0.19
#WLR_LIBS = -Wl,-rpath,$(PWD)/wlroots/0.19/lib64 -L$(PWD)/wlroots/0.19/lib64 -lwlroots-0.19
XWAYLAND = XWAYLAND =
XLIBS = XLIBS =
# Uncomment to build XWayland support # Uncomment to build XWayland support
#XWAYLAND = -DXWAYLAND #XWAYLAND = -DXWAYLAND
#XLIBS = xcb xcb-icccm #XLIBS = xcb xcb-icccm
CC = gcc # dwl itself only uses C99 features, but wlroots' headers use anonymous unions (C11).
# To avoid warnings about them, we do not use -std=c99 and instead of using the
# gmake default 'CC=c99', we use cc.
CC = cc

561
dwl.c

File diff suppressed because it is too large Load diff