Compare commits

...

5 commits

Author SHA1 Message Date
4f35f775dc update config 2025-03-19 21:03:12 -06:00
49732861f9 some improvements 2025-03-12 08:31:40 -06:00
39a44a3442 removed bar patches 2025-02-14 23:43:58 -06:00
fdd3f2cadb added more layouts 2025-02-14 23:17:37 -06:00
16d6775ac2 dwl 7.0 2025-02-02 13:09:20 -06:00
10 changed files with 626 additions and 208 deletions

View file

@ -1,3 +1 @@
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,36 +1,13 @@
# Changelog
* [Unreleased](#unreleased)
* [0.7](#0.7)
* [0.6](#0.6)
* [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
This version is just 0.6 with wlroots 0.18 compatibility.
See also [0.6](#0.6) release notes. 0.7 builds against wlroots 0.18.x.
### Added
@ -41,9 +18,15 @@ This version is just 0.6 with wlroots 0.18 compatibility.
[601]: https://codeberg.org/dwl/dwl/issues/601
### Fixed
* Crash when re-mapping unmapped clients.
### Contributors
Guido Cella
Lennart Jablonka
## 0.6

View file

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

View file

@ -18,14 +18,22 @@ philosophy. Like dwm, dwl is:
- [autostart](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/autostart)
- [bar](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/bar)
- [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)
- [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)
- [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)
- [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)
- [setupenv](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/setupenv)
- [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)
## Getting Started:
@ -213,3 +221,4 @@ inspiration, and to the various contributors to the project, including:
[wiki]: https://codeberg.org/dwl/dwl/wiki/Home#compatible-status-bars
[Discord server]: https://discord.gg/jJxZnrGPWN
[Wayland]: https://wayland.freedesktop.org/

View file

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

View file

@ -7,21 +7,16 @@
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 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 showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
static const char *fonts[] = {"monospace:size=10"};
static const float rootcolor[] = COLOR(0x000000ff);
/* 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 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] = {
/* fg bg border */
[SchemeNorm] = { 0xbbbbbbff, 0x222222ff, 0x444444ff },
@ -57,10 +52,11 @@ 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) */
static const Rule rules[] = {
/* app_id title tags mask isfloating monitor */
/* app_id title tags mask isfloating isterm noswallow monitor */
/* examples: */
{ "Gimp_EXAMPLE", NULL, 0, 1, -1 }, /* Start on currently visible tags floating, not tiled */
{ "firefox_EXAMPLE", NULL, 1 << 8, 0, -1 }, /* Start on ONLY tag "9" */
{ "foot", NULL, 0, 0, 1, 1, -1 },
{ "Gimp_EXAMPLE", NULL, 0, 1, 0, 0, -1 }, /* Start on currently visible tags floating, not tiled */
{ "firefox_EXAMPLE", NULL, 1 << 8, 0, 0, 0, -1 }, /* Start on ONLY tag "9" */
};
/* layout(s) */
@ -69,6 +65,10 @@ static const Layout layouts[] = {
{ "[]=", tile },
{ "><>", NULL }, /* no layout function means floating behavior */
{ "[M]", monocle },
{ "|M|", centeredmaster },
{ "||", col },
{ "[D]", deck },
{ NULL, NULL }, /* terminate */
};
/* monitors */
@ -122,6 +122,7 @@ static const int natural_scrolling = 0;
static const int disable_while_typing = 1;
static const int left_handed = 0;
static const int middle_button_emulation = 0;
static const int enable_primary_selection = 0;
/* You can choose between:
LIBINPUT_CONFIG_SCROLL_NO_SCROLL
LIBINPUT_CONFIG_SCROLL_2FG
@ -211,9 +212,15 @@ static const Key keys[] = {
{ MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
{ MODKEY, XKB_KEY_space, setlayout, {0} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
{ MODKEY, XKB_KEY_e, togglefullscreen, {0} },
{ 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_n, nextlayout, {0} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {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_0, view, {.ui = ~0} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} },

View file

@ -10,12 +10,13 @@ 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 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 int enableautoswallow = 1; /* enables autoswallowing newly spawned clients */
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 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 topbar = 1; /* 0 means bottom bar */
static const char *fonts[] = {"inconsolata:size=11"};
static const char *fonts[] = {"Inconsolata:size=12"};
/* 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 */
@ -34,8 +35,10 @@ static int log_level = WLR_ERROR;
/* Environment variables */
static const Env envs[] = {
/* variable value */
/* variable value */
{ "XDG_CURRENT_DESKTOP", "wlroots" },
{ "XCURSOR_THEME", "macOS" },
{ "SDL_VIDEODRIVER", "wayland" },
};
/* Autostart */
@ -51,10 +54,12 @@ 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) */
static const Rule rules[] = {
/* app_id title tags mask isfloating monitor */
/* examples: */
{ "Gimp_EXAMPLE", NULL, 0, 1, -1 }, /* Start on currently visible tags floating, not tiled */
{ "firefox_EXAMPLE", NULL, 1 << 8, 0, -1 }, /* Start on ONLY tag "9" */
/* app_id title tags mask isfloating isterm noswallow monitor */
/* examples: */
{ "foot", NULL, 0, 0, 1, 1, -1 }, /* make foot swallow clients that are not foot */
{ "Gimp_EXAMPLE", NULL, 0, 1, 0, 0, -1 }, /* Start on currently visible tags floating, not tiled */
{ "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) */
@ -63,6 +68,10 @@ static const Layout layouts[] = {
{ "[]=", tile },
{ "><>", NULL }, /* no layout function means floating behavior */
{ "[M]", monocle },
{ "|M|", centeredmaster },
{ "||", col },
{ "[D]", deck },
{ NULL, NULL }, /* terminate */
};
/* monitors */
@ -97,7 +106,7 @@ static const struct xkb_rule_names xkb_rules[] = {
static const InputRule inputrules[] = {
/* name kbcreate ptrcreate */
/* ignore bad device - like a touchpad ;) */
{ "BAD DEVICE", NULL, NULL },
{ "Synaptics TM3276-022", NULL, NULL },
/* ungroup ydotool device - fixes a bug */
{ "ydotoold virtual device", createungroupedkeyboard, createpointer },
/* put your touchpad name here to enable toggle touchpad */
@ -116,6 +125,7 @@ static const int natural_scrolling = 0;
static const int disable_while_typing = 1;
static const int left_handed = 0;
static const int middle_button_emulation = 0;
static const int enable_primary_selection = 0;
/* You can choose between:
LIBINPUT_CONFIG_SCROLL_NO_SCROLL
LIBINPUT_CONFIG_SCROLL_2FG
@ -143,7 +153,7 @@ LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT
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.0;
static const double accel_speed = 0.3;
/* You can choose between:
LIBINPUT_CONFIG_TAP_MAP_LRM -- 1/2/3 finger tap maps to left/right/middle
@ -165,14 +175,18 @@ static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TA
/* commands */
static const char *termcmd[] = { "footclient", NULL }; // Terminal
static const char *menucmd[] = { "tofi-drun", NULL }; // Application launcher
static const char *menucmd[] = { "fuzzel", NULL }; // Application launcher
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 *ncmxcmd[] = { "footclient", "--title", "ncpamixer", "ncpamixer", NULL }; // Volume control
static const char *blthcmd[] = { "footclient", "--title", "bluetui", "bluetui", NULL }; // Bluetooth manager
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 *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[] = {
/* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */
@ -184,28 +198,33 @@ static const Key keys[] = {
{ MODKEY, XKB_KEY_b, spawn, {.v = blthcmd} },
{ MODKEY, XKB_KEY_v, spawn, {.v = ncmxcmd} },
{ 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_Q, spawn, {.v = pwmncmd} },
{ 0, XKB_KEY_XF86AudioMicMute, spawn,SHCMD("setvol -m mute") },
{ WLR_MODIFIER_SHIFT, XKB_KEY_XF86AudioLowerVolume, spawn,SHCMD("setvol -m down") },
{ WLR_MODIFIER_SHIFT, XKB_KEY_XF86AudioRaiseVolume, spawn,SHCMD("setvol -m up") },
{ 0, XKB_KEY_XF86AudioMute, spawn,SHCMD("setvol mute") },
{ 0, XKB_KEY_XF86AudioLowerVolume, spawn,SHCMD("setvol down") },
{ 0, XKB_KEY_XF86AudioRaiseVolume, spawn,SHCMD("setvol up") },
{ 0, XKB_KEY_XF86MonBrightnessUp, spawn,SHCMD("setbrightness increase")},
{ 0, XKB_KEY_XF86MonBrightnessDown,spawn,SHCMD("setbrightness decrease")},
{ MODKEY, XKB_KEY_Delete, spawn, {.v = btopcmd} },
{ MODKEY, XKB_KEY_m, spawn, {.v = musicmd} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_R, spawn, SHCMD("grim -g \"$(slurp -d)\" - | wl-copy") },
{ 0, XKB_KEY_XF86AudioMicMute, spawn,SHCMD("wpctl set-mute @DEFAULT_SOURCE@ toggle && pkill -RTMIN+3 slstatus") },
{ WLR_MODIFIER_SHIFT, XKB_KEY_XF86AudioLowerVolume, spawn,SHCMD("wpctl set-volume -l 1.0 @DEFAULT_SOURCE@ 5%- && pkill -RTMIN+3 slstatus") },
{ WLR_MODIFIER_SHIFT, XKB_KEY_XF86AudioRaiseVolume, spawn,SHCMD("wpctl set-volume -l 1.0 @DEFAULT_SOURCE@ 5%+ && pkill -RTMIN+3 slstatus") },
{ 0, XKB_KEY_XF86AudioMute, spawn,SHCMD("wpctl set-mute @DEFAULT_SINK@ toggle && pkill -RTMIN+2 slstatus") },
{ 0, XKB_KEY_XF86AudioLowerVolume, spawn,SHCMD("wpctl set-volume -l 1.0 @DEFAULT_SINK@ 5%- && pkill -RTMIN+3 slstatus") },
{ 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_S, togglesticky, {0} },
{ MODKEY, XKB_KEY_j, focusstack, {.i = +1} },
{ MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_A, incnmaster, {.i = -1} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_D, incnmaster, {.i = +1} },
{ MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_q, incnmaster, {.i = -1} },
{ MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_e, incnmaster, {.i = +1} },
{ MODKEY, XKB_KEY_a, rotatetags, {.i = VIEW_L} },
{ 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_D, rotatetags, {.i = SHIFT_R} },
{ MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_a, setmfact, {.f = -0.05f} },
{ MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_d, setmfact, {.f = +0.05f} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Z, setmfact, {.f = -0.05f} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_X, setmfact, {.f = +0.05f} },
{ MODKEY, XKB_KEY_w, switchxkbrule, {0} },
/*
{ MODKEY, XKB_KEY_h, incgaps, {.i = +1 } },
@ -226,18 +245,26 @@ static const Key keys[] = {
{ 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_O, incovgaps, {.i = -1 } },
*/
{ MODKEY, XKB_KEY_Return, zoom, {0} },
{ MODKEY, XKB_KEY_Tab, view, {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_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|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {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, XKB_KEY_0, view, {.ui = ~0} },

View file

@ -1,4 +1,4 @@
_VERSION = 0.8-dev
_VERSION = 0.7
VERSION = `git describe --tags --dirty 2>/dev/null || echo $(_VERSION)`
PKG_CONFIG = pkg-config
@ -8,29 +8,10 @@ PREFIX = /usr/local
MANDIR = $(PREFIX)/share/man
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 =
XLIBS =
# Uncomment to build XWayland support
#XWAYLAND = -DXWAYLAND
#XLIBS = xcb xcb-icccm
# 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
CC = gcc

579
dwl.c

File diff suppressed because it is too large Load diff

10
util.c
View file

@ -38,14 +38,14 @@ ecalloc(size_t nmemb, size_t size)
int
fd_set_nonblock(int fd) {
int flags = fcntl(fd, F_GETFL);
if (flags < 0) {
if (flags < 0) {
perror("fcntl(F_GETFL):");
return -1;
}
if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) < 0) {
return -1;
}
if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) < 0) {
perror("fcntl(F_SETFL):");
return -1;
}
}
return 0;
}