98 Commits

Author SHA1 Message Date
Leonardo Hernández Hernández 31d8a67eda use level 0 keysyms
this allow do not have to change the keysym when WLR_MODIFIER_SHIFT is active
2022-07-23 17:48:59 -05:00
Leonardo Hernández Hernández b04c73be3d make sure we do not create a double fullscreen_bg
and also make sure we do not destroy it if it does not exist
Fixes: #274
2022-07-23 13:28:15 -05:00
Leonardo Hernández Hernández 8cdb997126 conform the xdg-protocol with fullscreen translucent clients
see `setfullscreen()` for more info
2022-07-23 02:17:00 -05:00
Leonardo Hernández Hernández 90a12c90a0 always set the same monitor and tags for child clients of a client
fixes #272
2022-07-19 20:13:56 -05:00
Leonardo Hernández Hernández e082292606 do not focus clients if a layer surface is focused 2022-07-19 12:24:24 -05:00
Dima Krasner deb48ff48b force line-buffered stdout if stdout is not a tty 2022-07-19 12:18:16 -05:00
Leonardo Hernández Hernández c70db2d06a Revert "only call wlr_seat_keyboard_notify_enter() if a keyboard is found"
This reverts commit 8e03bce621.
fixes #270
2022-07-19 11:52:42 -05:00
Leonardo Hernández Hernández e98719f552 remove a useless check
if `s->role_data == NULL`, wlr_*_surface_from_wlr_surface() will return NULL
and we are checking it
2022-07-15 00:48:28 -05:00
David-Valters af12e777f2 Update README.md 2022-07-13 20:19:43 -05:00
Leonardo Hernández Hernández 8e03bce621 only call wlr_seat_keyboard_notify_enter() if a keyboard is found 2022-07-07 00:21:51 -05:00
Leonardo Hernández Hernández 87fc3a58ab check pointer focus in arrange() 2022-07-06 23:48:53 -05:00
Leonardo Hernández Hernández 0eff78d6c2 include DWLCFLAGS into linking step 2022-07-06 23:41:42 -05:00
Leonardo Hernández Hernández c6d97f1db7 arrange client's monitor if size has change since last commit 2022-07-06 22:20:21 -05:00
Leonardo Hernández Hernández 829dec6598 resize now takes struct wlr_box as parameter 2022-07-06 22:18:46 -05:00
Leonardo Hernández Hernández ff70337c16 check current and pending geometry to set c->resize to zero
Fixes #260
2022-07-06 22:16:00 -05:00
Ben Jargowsky 7cc6c640e2 Checks for overflows for client max width and height 2022-06-29 00:35:06 +02:00
Leonardo Hernández Hernández 72e0a560d9 respect size hints 2022-06-24 19:19:20 -05:00
Leonardo Hernández Hernández 2aa391361c inline unmaplayersurface() into unmaplayersurfacenotify()
unmap signal is guaranted to be emitted before destroy signal
so is useless checking if it is mapped at destroy
2022-06-24 15:36:13 -05:00
Leonardo Hernández Hernández 549335ae54 avoid layer surface popups appearing below x{dg,wayland} clients 2022-06-24 14:46:08 -05:00
Leonardo Hernández Hernández 097b4a30f5 unconstrain layer shell popups from monitor size
unconstrain other popups from monitor usable area
2022-06-24 14:30:52 -05:00
Leonardo Hernández Hernández c1578bc14d use LayerSurface.mon when possible 2022-06-21 16:03:20 -05:00
Leonardo Hernández Hernández 9b84940e37 unconstrain layer shell popups
also unconstrain popups from monitor's usable area
2022-06-21 00:23:21 -05:00
Leonardo Hernández Hernández 79ad72413d don't set c->isfullscreen to zero
calloc initializes all fields to zero
2022-06-20 18:05:16 -05:00
Sevz 74fce9d918 Merge pull request #257 from fauxmight/bar_options
Add known dwl status bar options to README
2022-06-18 13:00:08 -05:00
A Frederick Christensen 553ba5b7c8 Add known dwl tag status bar options to README.md 2022-06-18 03:04:00 -05:00
Leonardo Hernández Hernández 4ae6d0f387 move ugglyness to client.h 2022-06-16 15:54:13 -05:00
Leonardo Hernández Hernández 2ef5abfb72 remove unneeded check in focusclient() 2022-06-16 15:36:27 -05:00
Sevz 8076b47cc6 Merge pull request #251 from gwnichol/fixinstall
Fix make install while files are in use
2022-06-14 15:43:09 -05:00
Sevz 3a77f02919 Merge pull request #247 from Humm42/xkboptions
initialize xkb_rules.options to a null pointer
2022-06-14 15:42:47 -05:00
Leonardo Hernández Hernández d26ddfc7fd kill child process in cleanup() 2022-06-14 15:31:39 -05:00
Grant Nichol 671a9b450b Fix make install while files are in use
When the dwl executable is in use, cp fails without the -f flag.

POSIX defines this flag with:
> If a file descriptor for a destination file cannot be obtained,
> as described in step 3.a.ii., attempt to unlink the destination
> file and proceed.
2022-06-12 15:58:38 -05:00
Leonardo Hernández Hernández 583f471cfe add some blank lines 2022-06-10 12:32:22 -05:00
Marco Siedentopf 8bce3b1583 add click method configuration option
Add the libinput configuration option to choose between Software Button Areas and Clickfinger
2022-06-10 12:27:40 -05:00
Leonardo Hernández Hernández c008bf2a7d add $(LIBS) to $(LDLIBS) 2022-06-10 12:21:23 -05:00
Dima Krasner c990dbd441 fix link failure with --as-needed 2022-06-10 19:26:45 +03:00
Leonardo Hernández Hernández d969289baf use LDFLAGS to build dwl target 2022-06-06 23:36:45 -05:00
Leonardo Hernández Hernández 50b6630f3d do not generate *-protocol.{c,o}
according with
https://gitlab.freedesktop.org/wlroots/wlroots/-/commit/62fbf3f4ba1b2993e29dfb46f077e5806f7aac1c
they are unused and wlroots-based compositors don't need to do this
2022-06-06 22:54:40 -05:00
Leonardo Hernández Hernández 14641560b0 include xcb only when building with xwayland support 2022-06-06 22:53:36 -05:00
KawaiiAmber 7b42232ad1 convert makefile to be more portable 2022-06-06 22:53:36 -05:00
Leonardo Hernández Hernández a5a0674f6a improve client_from_wlr_surface() 2022-06-06 22:51:58 -05:00
Leonardo Hernández Hernández 4dfa45659a fix compiler error with gcc complaining about parentheses
dwl.c: In function ‘unmaplayersurface’:
dwl.c:2253:9: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
 2253 |         layersurface->layer_surface->mapped = layersurface->mapped = 0;
      |         ^~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [<builtin>: dwl.o] Error 1

clang not affected
2022-06-05 16:57:20 -05:00
Leonardo Hernández Hernández b91017e713 disable scene node at unmaplayersurface() 2022-06-05 15:27:40 -05:00
Lennart Jablonka 70da04a714 initialize xkb_rules.options to a null pointer
Initializing it to an empty string had broken configuring xkbcommon
through the environment (XKB_DEFAULT_OPTIONS).

Fixes: ae31391115 ("initialize rules and xkb_rules")
2022-06-03 01:23:35 +02:00
Leonardo Hernández Hernández 2623a96ebf call client_set-size() if client has a resize 2022-05-27 00:19:17 -05:00
Leonardo Hernández Hernández 52e0d00942 check client_surface() returning NULL
now client_surface()->data is a pointer to the wlr_scene_tree of clients
which allows us to not call wlr_scene_node_lower_to_bottom() for every clients
2022-05-25 17:12:44 -05:00
Leonardo Hernández Hernández 7018b9b65c correct libinput function name for drag_lock 2022-05-25 15:01:38 -05:00
Leonardo Hernández Hernández 48ec914f43 destroy layersurface's scene node in destroylayersurfacenotify() 2022-05-25 14:49:32 -05:00
Leonardo Hernández Hernández 40449fa64f add a new function to get a client from a wlr_surface 2022-05-23 10:55:28 -05:00
Ben Jargowsky ecbc2c61db Add configuration options for touchpads 2022-05-23 00:01:47 +02:00
Leonardo Hernández Hernández 8870ba0bb8 implement urgency hints for xwayland clients 2022-05-17 14:38:18 -05:00
Leonardo Hernández Hernández 5de68ba713 sync manpage and help info
Signed-off-by: Leonardo Hernández Hernández <leohdz172@protonmail.com>
2022-05-17 13:26:57 -05:00
Ben Jargowsky 2f8736b986 Check if XWayland client size_hints are NULL 2022-05-15 23:09:21 +02:00
Leonardo Hernández Hernández 3c11ad9aa6 fix segfault when dragging chromium tabs 2022-05-14 00:29:35 -05:00
Ben Jargowsky 06d9230a96 Run focusclient when switching to monocle layout 2022-05-13 10:20:28 +02:00
Leonardo Hernández Hernández 22bd75226b remove trailing whitespaces 2022-05-10 11:42:40 -05:00
Leonardo Hernández Hernández 063736f898 add -v flag to the manpage
Thanks @Humm42
2022-05-10 11:39:33 -05:00
Leonardo Hernández Hernández d5a741c9b4 add dist target 2022-05-09 16:25:03 -05:00
Leonardo Hernández Hernández 5d8084daa7 add flag to print version and exit 2022-05-09 16:24:36 -05:00
Sevz 07d56c6d7b Merge pull request #230 from BenJarg/null-wlr_seat_get_keyboard
Handle 'wlr_seat_get_keyboard' possibly returning null.
2022-05-09 13:18:19 -05:00
Ben Jargowsky e0d310fd84 Handle 'wlr_seat_get_keyboard' possibly returning null. 2022-05-09 14:00:21 +02:00
Leonardo Hernández Hernández 3a4b7d104f restack xwayland surface on focusclient() 2022-04-29 17:45:02 -05:00
Ben Jargowsky d071a899f3 Run printstatus() when a monitor is removed 2022-04-25 13:50:53 -07:00
Leonardo Hernández Hernández a48ce99e6a use pointer math in xytonode() 2022-04-15 17:40:02 -05:00
Leonardo Hernández Hernández b86fcf6504 add missing return in client_is_floating_type()
This causes all Xwayland clients to be treated as floating
2022-04-10 21:38:48 -05:00
Leonardo Hernández Hernández c00697e643 abc 2022-04-05 23:04:04 -05:00
Leonardo Hernández Hernández af741e586b typedefs: abc 2022-04-05 22:15:46 -05:00
Leonardo Hernández Hernández 02ac9378c4 includes: abc 2022-04-05 22:07:59 -05:00
Devin J. Pohly 437aea8662 It's past my bedtime. 2022-04-03 00:14:08 -05:00
Devin J. Pohly 6901743b0c Remove removed fields from struct instances 2022-04-03 00:13:11 -05:00
Devin J. Pohly 720f56161e Remove vestigial monitor configuration info
The x/y fields in monitor rules are unused and were meant to be deleted.
Also removes the outdated comment in config.h.
2022-04-03 00:01:52 -05:00
Leonardo Hernández Hernández 4d3adea683 die on pipe failure 2022-03-31 15:32:30 -06:00
Raphael Robatsch 79b7e755b0 Layer shell: Prevent infinte configure/commit loop
Check the wlr_layer_surface_v1_state.committed bitmask to see if we need
to rearrange. This is also what sway does.

Without this check, every commit request (even if only the attached buffer
changed) will lead to another configure event, which will lead to another
commit, etc.

This loop results in swaybg consuming 100% CPU.

Co-authored-by: Owen Rafferty <owen@owenrafferty.com>
2022-03-31 15:27:13 -06:00
Leonardo Hernández Hernández b424602ebc add DESTDIR 2022-03-31 09:43:56 -06:00
Leonardo Hernández Hernández ae31391115 initialize rules and xkb_rules
to fix compile errors with `-pedantic`
2022-03-31 09:34:22 -06:00
Leonardo Hernández Hernández 2d6f932ecf don't let -pedantic be overridable by environment 2022-03-31 09:21:27 -06:00
Leonardo Hernández Hernández aab397c30b new functions ecalloc() and die()
die() replaces EBARF and BARF
and allow us to add `-pedantic` to CFLAGS
2022-03-28 15:02:09 -06:00
Leonardo Hernández Hernández cb4265ac8c check m in commitlayersurfacenotify() 2022-03-24 14:19:08 -06:00
Leonardo Hernández Hernández a95338ca43 implement input-inhibitor protocol 2022-03-24 11:41:24 -06:00
Leonardo Hernández Hernández ae614ee512 implement idle-inhibitor protocol
This allows clients to disable idle monitoring
2022-03-24 11:35:19 -06:00
Leonardo Hernández Hernández feb972acd0 fix drag icon's surface returned by xytonode 2022-03-23 15:34:17 -06:00
Leonardo Hernández Hernández bf8cc526de set position of the drag icon in startdrag() 2022-03-23 15:30:35 -06:00
Leonardo Hernández Hernández 7a2e0eef74 Revert "clients now works as expected in drag motion"
This reverts commit 9aec6049ec.

this problem is caused because xytonode() returns the surface of the
drag icon
2022-03-23 15:29:32 -06:00
Guido Cella 3bace9ce6b inline the presentation variable
This variable can be removed since with scene-graph
wlr_presentation_surface_sampled_on_output no longer needs to be called.
2022-03-23 22:01:04 +01:00
Leonardo Hernández Hernández 4ef8999624 add note about how to change MODKEY for windows key 2022-03-23 14:03:43 -06:00
Palanix 7d724dc7f3 Fix dwl freezing when resizing 2022-03-23 12:09:24 -06:00
Quentin Rameau 326eee1444 Add a configuration option for fullscreen locking
Some people are annoyed to have this new behaviour forced for some
application which use fake fullscreen.
2022-03-22 23:51:56 -06:00
Leonardo Hernández Hernández d8f430accf add sway LICENSE file
part of the code in dwl is taken from sway, so credit it.
dwm and sway are both licensed under the MIT license
2022-03-22 23:44:53 -06:00
Sevz 6aed9dc1ac Merge pull request #137 from guidocella/libera
update IRC channel
2022-03-22 17:49:06 -06:00
Sevz 358562e2df Merge pull request #180 from Humm42/manpage
add dwl(1)
2022-03-22 16:26:38 -06:00
Leonardo Hernández Hernández 9aec6049ec clients now works as expected in drag motion 2022-03-22 15:02:02 -06:00
Guido Cella 330792b1fc implement drag and drop
For brevity, only a single drag icon at a time is supported.

Co-authored-by: Leonardo Hernández Hernández <leohdz172@protonmail.com>
2022-03-22 01:10:08 -06:00
Sevz 86fe15f76c Update issue templates 2022-03-21 22:34:30 -06:00
Leonardo Hernández Hernández ee1a72211d only skip frames if there are visible clients that have a resize 2022-03-21 21:41:38 -06:00
Leonardo Hernández Hernández 2bc01debdc remove a useless resize in mapnotify()
applyrules() calls setmon() which calls resize()
2022-03-21 14:21:33 -06:00
Leonardo Hernández Hernández c50f187c1f improve floating detection
mostly copied from sway
2022-03-21 14:21:31 -06:00
Leonardo Hernández Hernández 0dea553428 destroy scene_output in cleanupmon() 2022-03-20 19:09:28 -06:00
Humm 0c4740b277 add dwl(1)
Documentation is good.  Man pages are documentation.  A program without
a man page is worthless.
2022-03-13 00:46:24 +01:00
Guido Cella 8aa50dfdf1 update IRC channel 2021-08-03 06:29:26 +02:00
13 changed files with 917 additions and 369 deletions
+12
View File
@@ -7,4 +7,16 @@ assignees: ''
--- ---
## Info
dwl's commit:
wlroots version:
## Description
<!--
Only report bugs that can be reproduced on the main line
Report patch issues to their respective authors
If the patch author doesn't respond within a reasonable time, email me:
Leonardo Hernández Hernández <leohdz172@protonmail.com>
but note that I'm NOT making any promises
-->
+1 -1
View File
@@ -2,7 +2,7 @@ dwl - dwm for Wayland
Copyright © 2020 dwl team Copyright © 2020 dwl team
See also the files LICENSE.tinywl and LICENSE.dwm. See also the files LICENSE.tinywl, LICENSE.dwm and LICENSE.sway.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
+19
View File
@@ -0,0 +1,19 @@
Copyright (c) 2016-2017 Drew DeVault
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+47 -41
View File
@@ -1,63 +1,69 @@
.POSIX:
.SUFFIXES:
include config.mk include config.mk
CFLAGS += -I. -DWLR_USE_UNSTABLE -std=c99 # flags for compiling
DWLCPPFLAGS = -I. -DWLR_USE_UNSTABLE -DVERSION=\"$(VERSION)\"
WAYLAND_PROTOCOLS=$(shell pkg-config --variable=pkgdatadir wayland-protocols) # Wayland utils
WAYLAND_SCANNER=$(shell pkg-config --variable=wayland_scanner wayland-scanner) WAYLAND_PROTOCOLS = `pkg-config --variable=pkgdatadir wayland-protocols`
WAYLAND_SCANNER = `pkg-config --variable=wayland_scanner wayland-scanner`
PKGS = wlroots wayland-server xcb xkbcommon libinput # CFLAGS / LDFLAGS
CFLAGS += $(foreach p,$(PKGS),$(shell pkg-config --cflags $(p))) PKGS = wlroots wayland-server xkbcommon libinput $(XLIBS)
LDLIBS += $(foreach p,$(PKGS),$(shell pkg-config --libs $(p))) DWLCFLAGS = `pkg-config --cflags $(PKGS)` $(DWLCPPFLAGS) $(CFLAGS) $(XWAYLAND)
LDLIBS = `pkg-config --libs $(PKGS)` $(LIBS)
all: dwl # build rules
clean:
rm -f dwl *.o *-protocol.h *-protocol.c
install: dwl
install -D dwl $(PREFIX)/bin/dwl
uninstall:
rm -f $(PREFIX)/bin/dwl
.PHONY: all clean install uninstall
# wayland-scanner is a tool which generates C headers and rigging for Wayland # wayland-scanner is a tool which generates C headers and rigging for Wayland
# protocols, which are specified in XML. wlroots requires you to rig these up # protocols, which are specified in XML. wlroots requires you to rig these up
# to your build system yourself and provide them in the include path. # to your build system yourself and provide them in the include path.
all: dwl
dwl: dwl.o util.o
$(CC) dwl.o util.o $(LDLIBS) $(LDFLAGS) $(DWLCFLAGS) -o $@
dwl.o: dwl.c config.mk config.h client.h xdg-shell-protocol.h wlr-layer-shell-unstable-v1-protocol.h idle-protocol.h
util.o: util.c util.h
# wayland scanner rules to generate .h / .c files
xdg-shell-protocol.h: xdg-shell-protocol.h:
$(WAYLAND_SCANNER) server-header \ $(WAYLAND_SCANNER) server-header \
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@ $(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
xdg-shell-protocol.c:
$(WAYLAND_SCANNER) private-code \
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
xdg-shell-protocol.o: xdg-shell-protocol.h
wlr-layer-shell-unstable-v1-protocol.h: wlr-layer-shell-unstable-v1-protocol.h:
$(WAYLAND_SCANNER) server-header \ $(WAYLAND_SCANNER) server-header \
protocols/wlr-layer-shell-unstable-v1.xml $@ protocols/wlr-layer-shell-unstable-v1.xml $@
wlr-layer-shell-unstable-v1-protocol.c:
$(WAYLAND_SCANNER) private-code \
protocols/wlr-layer-shell-unstable-v1.xml $@
wlr-layer-shell-unstable-v1-protocol.o: wlr-layer-shell-unstable-v1-protocol.h
idle-protocol.h: idle-protocol.h:
$(WAYLAND_SCANNER) server-header \ $(WAYLAND_SCANNER) server-header \
protocols/idle.xml $@ protocols/idle.xml $@
idle-protocol.c: config.h:
$(WAYLAND_SCANNER) private-code \
protocols/idle.xml $@
idle-protocol.o: idle-protocol.h
config.h: | config.def.h
cp config.def.h $@ cp config.def.h $@
clean:
rm -f dwl *.o *-protocol.h
dwl.o: config.mk config.h client.h xdg-shell-protocol.h wlr-layer-shell-unstable-v1-protocol.h idle-protocol.h # distribution archive
dist: clean
mkdir -p dwl-$(VERSION)
cp -R LICENSE* Makefile README.md generate-version.sh client.h\
config.def.h config.mk protocols dwl.1 dwl.c util.c util.h\
dwl-$(VERSION)
echo "echo $(VERSION)" > dwl-$(VERSION)/generate-version.sh
tar -caf dwl-$(VERSION).tar.gz dwl-$(VERSION)
rm -rf dwl-$(VERSION)
dwl: xdg-shell-protocol.o wlr-layer-shell-unstable-v1-protocol.o idle-protocol.o # install rules
install: dwl
mkdir -p $(DESTDIR)$(PREFIX)/bin
cp -f dwl $(DESTDIR)$(PREFIX)/bin
chmod 755 $(DESTDIR)$(PREFIX)/bin/dwl
mkdir -p $(DESTDIR)$(MANDIR)/man1
cp -f dwl.1 $(DESTDIR)$(MANDIR)/man1
chmod 644 $(DESTDIR)$(MANDIR)/man1/dwl.1
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/dwl $(DESTDIR)$(MANDIR)/man1/dwl.1
.SUFFIXES: .c .o
.c.o:
$(CC) $(CPPFLAGS) $(DWLCFLAGS) -c $<
+14 -4
View File
@@ -14,8 +14,10 @@ dwl is not meant to provide every feature under the sun. Instead, like dwm, it s
- Any features provided by dwm/Xlib: simple window borders, tags, keybindings, client rules, mouse move/resize. Providing a built-in status bar is an exception to this goal, to avoid dependencies on font rendering and/or drawing libraries when an external bar could work well. - Any features provided by dwm/Xlib: simple window borders, tags, keybindings, client rules, mouse move/resize. Providing a built-in status bar is an exception to this goal, to avoid dependencies on font rendering and/or drawing libraries when an external bar could work well.
- Configurable multi-monitor layout support, including position and rotation - Configurable multi-monitor layout support, including position and rotation
- Configurable HiDPI/multi-DPI support - Configurable HiDPI/multi-DPI support
- Idle-inhibit protocol which lets applications such as mpv disable idle monitoring
- Provide information to external status bars via stdout/stdin - Provide information to external status bars via stdout/stdin
- Urgency hints via xdg-activate protocol - Urgency hints via xdg-activate protocol
- Support screen lockers via input-inhibitor protocol
- Various Wayland protocols - Various Wayland protocols
- XWayland support as provided by wlroots (can be enabled in `config.mk`) - XWayland support as provided by wlroots (can be enabled in `config.mk`)
- Zero flickering - Wayland users naturally expect that "every frame is perfect" - Zero flickering - Wayland users naturally expect that "every frame is perfect"
@@ -25,8 +27,6 @@ dwl is not meant to provide every feature under the sun. Instead, like dwm, it s
Features under consideration (possibly as patches) are: Features under consideration (possibly as patches) are:
- Protocols made trivial by wlroots - Protocols made trivial by wlroots
- Implement the input-inhibitor protocol to support screen lockers (see https://github.com/djpohly/dwl/pull/132)
- Implement the idle-inhibit protocol which lets applications such as mpv disable idle monitoring (see https://github.com/djpohly/dwl/pull/133)
- Implement the text-input and input-method protocols to support IME once ibus implements input-method v2 (see https://github.com/ibus/ibus/pull/2256 and https://github.com/djpohly/dwl/pull/12) - Implement the text-input and input-method protocols to support IME once ibus implements input-method v2 (see https://github.com/ibus/ibus/pull/2256 and https://github.com/djpohly/dwl/pull/12)
Feature *non-goals* for the main codebase include: Feature *non-goals* for the main codebase include:
@@ -37,7 +37,9 @@ Feature *non-goals* for the main codebase include:
## Building dwl ## Building dwl
dwl has only two dependencies: wlroots and wayland-protocols. Simply install these (and their `-devel` versions if your distro has separate development packages) and run `make`. If you wish to build against a Git version of wlroots, check out the [wlroots-next branch](https://github.com/djpohly/dwl/tree/wlroots-next). dwl has only two dependencies: `wlroots` and `wayland-protocols`.
Simply install these (and their `-devel` versions if your distro has separate development packages) and run `make`. If you wish to build against a Git version of wlroots, check out the [wlroots-next branch](https://github.com/djpohly/dwl/tree/wlroots-next).
To enable XWayland, you should also install xorg-xwayland and uncomment its flag in `config.mk`. To enable XWayland, you should also install xorg-xwayland and uncomment its flag in `config.mk`.
@@ -71,13 +73,21 @@ If your startup command is a shell script, you can achieve the same inside the s
exec <&- exec <&-
Existing dwl-specific status bars and dwl-specific scripts for other status bars include:
- [somebar](https://sr.ht/~raphi/somebar/) status bar designed for dwl
- [dtaobarv2.sh](https://cdn.discordapp.com/attachments/792078050024095745/862428883423723560/dtaobarv2.sh) for use with [dtao](https://github.com/djpohly/dtao) (See "Pinned Messages" on the "customizations" channel of the [dwl Discord server](https://discord.gg/jJxZnrGPWN) for details.)
- [dwlbar.sh](https://cdn.discordapp.com/attachments/792078050024095745/810926218529472592/dwlbar.sh) for use with [waybar](https://github.com/Alexays/Waybar) (See "Pinned Messages" on the "customizations" channel of the [dwl Discord server](https://discord.gg/jJxZnrGPWN) for details.)
- [waybar-dwl](https://codeberg.org/fauxmight/waybar-dwl.git) for use with [waybar](https://github.com/Alexays/Waybar)
- [dwl-tags.sh](https://codeberg.org/novakane/yambar/src/branch/master/examples/scripts/dwl-tags.sh) for use with [yambar](https://codeberg.org/dnkl/yambar)
- [waybar-dwl.sh](https://gitee.com/guyuming76/personal/tree/dwl/gentoo/waybar-dwl) for use with [waybar](https://github.com/Alexays/Waybar) (ACCESS TO THIS SCRIPT REQUIRES gitee.com LOGIN!)
## Replacements for X applications ## Replacements for X applications
You can find a [list of Wayland applications on the sway wiki](https://github.com/swaywm/sway/wiki/i3-Migration-Guide). You can find a [list of Wayland applications on the sway wiki](https://github.com/swaywm/sway/wiki/i3-Migration-Guide).
## IRC channel ## IRC channel
dwl's IRC channel is #dwl on irc.freenode.net. dwl's IRC channel is #dwl on irc.libera.chat.
## Acknowledgements ## Acknowledgements
+100 -30
View File
@@ -26,20 +26,42 @@ client_surface(Client *c)
return c->surface.xdg->surface; return c->surface.xdg->surface;
} }
static inline Client *
client_from_wlr_surface(struct wlr_surface *s)
{
struct wlr_xdg_surface *surface;
#ifdef XWAYLAND
struct wlr_xwayland_surface *xsurface;
if (s && wlr_surface_is_xwayland_surface(s)
&& (xsurface = wlr_xwayland_surface_from_wlr_surface(s)))
return xsurface->data;
#endif
if (s && wlr_surface_is_xdg_surface(s)
&& (surface = wlr_xdg_surface_from_wlr_surface(s))
&& surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL)
return surface->data;
return NULL;
}
/* The others */ /* The others */
static inline void static inline void
client_activate_surface(struct wlr_surface *s, int activated) client_activate_surface(struct wlr_surface *s, int activated)
{ {
struct wlr_xdg_surface *surface;
#ifdef XWAYLAND #ifdef XWAYLAND
if (wlr_surface_is_xwayland_surface(s)) { struct wlr_xwayland_surface *xsurface;
wlr_xwayland_surface_activate( if (wlr_surface_is_xwayland_surface(s)
wlr_xwayland_surface_from_wlr_surface(s), activated); && (xsurface = wlr_xwayland_surface_from_wlr_surface(s))) {
wlr_xwayland_surface_activate(xsurface, activated);
return; return;
} }
#endif #endif
if (wlr_surface_is_xdg_surface(s)) if (wlr_surface_is_xdg_surface(s)
wlr_xdg_toplevel_set_activated( && (surface = wlr_xdg_surface_from_wlr_surface(s))
wlr_xdg_surface_from_wlr_surface(s), activated); && surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL)
wlr_xdg_toplevel_set_activated(surface, activated);
} }
static inline void static inline void
@@ -78,6 +100,32 @@ client_get_geometry(Client *c, struct wlr_box *geom)
wlr_xdg_surface_get_geometry(c->surface.xdg, geom); wlr_xdg_surface_get_geometry(c->surface.xdg, geom);
} }
static inline void
client_get_size_hints(Client *c, struct wlr_box *max, struct wlr_box *min)
{
struct wlr_xdg_toplevel *toplevel;
struct wlr_xdg_toplevel_state *state;
#ifdef XWAYLAND
if (client_is_x11(c)) {
struct wlr_xwayland_surface_size_hints *size_hints;
size_hints = c->surface.xwayland->size_hints;
if (size_hints) {
max->width = size_hints->max_width;
max->height = size_hints->max_height;
min->width = size_hints->min_width;
min->height = size_hints->min_height;
}
return;
}
#endif
toplevel = c->surface.xdg->toplevel;
state = &toplevel->current;
max->width = state->max_width;
max->height = state->max_height;
min->width = state->min_width;
min->height = state->min_height;
}
static inline const char * static inline const char *
client_get_title(Client *c) client_get_title(Client *c)
{ {
@@ -88,19 +136,48 @@ client_get_title(Client *c)
return c->surface.xdg->toplevel->title; return c->surface.xdg->toplevel->title;
} }
static inline Client *
client_get_parent(Client *c)
{
Client *p;
#ifdef XWAYLAND
if (client_is_x11(c) && c->surface.xwayland->parent)
return client_from_wlr_surface(c->surface.xwayland->parent->surface);
#endif
if (c->surface.xdg->toplevel->parent)
return client_from_wlr_surface(c->surface.xdg->toplevel->parent->surface);
return NULL;
}
static inline int static inline int
client_is_float_type(Client *c) client_is_float_type(Client *c)
{ {
struct wlr_box min = {0}, max = {0};
client_get_size_hints(c, &max, &min);
#ifdef XWAYLAND #ifdef XWAYLAND
if (client_is_x11(c)) if (client_is_x11(c)) {
for (size_t i = 0; i < c->surface.xwayland->window_type_len; i++) struct wlr_xwayland_surface *surface = c->surface.xwayland;
if (c->surface.xwayland->window_type[i] == netatom[NetWMWindowTypeDialog] || if (surface->modal)
c->surface.xwayland->window_type[i] == netatom[NetWMWindowTypeSplash] ||
c->surface.xwayland->window_type[i] == netatom[NetWMWindowTypeToolbar] ||
c->surface.xwayland->window_type[i] == netatom[NetWMWindowTypeUtility])
return 1; return 1;
for (size_t i = 0; i < surface->window_type_len; i++)
if (surface->window_type[i] == netatom[NetWMWindowTypeDialog]
|| surface->window_type[i] == netatom[NetWMWindowTypeSplash]
|| surface->window_type[i] == netatom[NetWMWindowTypeToolbar]
|| surface->window_type[i] == netatom[NetWMWindowTypeUtility])
return 1;
return ((min.width > 0 || min.height > 0 || max.width > 0 || max.height > 0)
&& (min.width == max.width || min.height == max.height))
|| c->surface.xwayland->parent;
}
#endif #endif
return 0;
return ((min.width > 0 || min.height > 0 || max.width > 0 || max.height > 0)
&& (min.width == max.width || min.height == max.height))
|| c->surface.xdg->toplevel->parent;
} }
static inline int static inline int
@@ -181,34 +258,27 @@ client_surface_at(Client *c, double cx, double cy, double *sx, double *sy)
} }
static inline void static inline void
client_min_size(Client *c, int *width, int *height) client_restack_surface(Client *c)
{ {
struct wlr_xdg_toplevel *toplevel;
struct wlr_xdg_toplevel_state *state;
#ifdef XWAYLAND #ifdef XWAYLAND
if (client_is_x11(c)) { if (client_is_x11(c))
struct wlr_xwayland_surface_size_hints *size_hints; wlr_xwayland_surface_restack(c->surface.xwayland, NULL,
size_hints = c->surface.xwayland->size_hints; XCB_STACK_MODE_ABOVE);
*width = size_hints->min_width;
*height = size_hints->min_height;
return;
}
#endif #endif
toplevel = c->surface.xdg->toplevel; return;
state = &toplevel->current;
*width = state->min_width;
*height = state->min_height;
} }
static inline Client * static inline void *
client_from_popup(struct wlr_xdg_popup *popup) toplevel_from_popup(struct wlr_xdg_popup *popup)
{ {
struct wlr_xdg_surface *surface = popup->base; struct wlr_xdg_surface *surface = popup->base;
while (1) { while (1) {
switch (surface->role) { switch (surface->role) {
case WLR_XDG_SURFACE_ROLE_POPUP: case WLR_XDG_SURFACE_ROLE_POPUP:
if (!wlr_surface_is_xdg_surface(surface->popup->parent)) if (wlr_surface_is_layer_surface(surface->popup->parent))
return wlr_layer_surface_v1_from_wlr_surface(surface->popup->parent)->data;
else if (!wlr_surface_is_xdg_surface(surface->popup->parent))
return NULL; return NULL;
surface = wlr_xdg_surface_from_wlr_surface(surface->popup->parent); surface = wlr_xdg_surface_from_wlr_surface(surface->popup->parent);
+60 -24
View File
@@ -1,9 +1,12 @@
/* appearance */ /* appearance */
static const int sloppyfocus = 1; /* focus follows mouse */ static const int sloppyfocus = 1; /* focus follows mouse */
static const unsigned int borderpx = 1; /* border pixel of windows */ static const unsigned int borderpx = 1; /* border pixel of windows */
static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
static const float rootcolor[] = {0.3, 0.3, 0.3, 1.0}; static const float rootcolor[] = {0.3, 0.3, 0.3, 1.0};
static const float bordercolor[] = {0.5, 0.5, 0.5, 1.0}; static const float bordercolor[] = {0.5, 0.5, 0.5, 1.0};
static const float focuscolor[] = {1.0, 0.0, 0.0, 1.0}; static const float focuscolor[] = {1.0, 0.0, 0.0, 1.0};
/* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */
static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0};
/* tagging */ /* tagging */
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
@@ -12,8 +15,8 @@ static const Rule rules[] = {
/* app_id title tags mask isfloating monitor */ /* app_id title tags mask isfloating monitor */
/* examples: /* examples:
{ "Gimp", NULL, 0, 1, -1 }, { "Gimp", NULL, 0, 1, -1 },
{ "firefox", NULL, 1 << 8, 0, -1 },
*/ */
{ "firefox", NULL, 1 << 8, 0, -1 },
}; };
/* layout(s) */ /* layout(s) */
@@ -24,16 +27,14 @@ static const Layout layouts[] = {
{ "[M]", monocle }, { "[M]", monocle },
}; };
/* monitors /* monitors */
* The order in which monitors are defined determines their position.
* Non-configured monitors are always added to the left. */
static const MonitorRule monrules[] = { static const MonitorRule monrules[] = {
/* name mfact nmaster scale layout rotate/reflect x y */ /* name mfact nmaster scale layout rotate/reflect */
/* example of a HiDPI laptop monitor: /* example of a HiDPI laptop monitor:
{ "eDP-1", 0.5, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 0, 0 }, { "eDP-1", 0.5, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL },
*/ */
/* defaults */ /* defaults */
{ NULL, 0.55, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 0, 0 }, { NULL, 0.55, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL },
}; };
/* keyboard */ /* keyboard */
@@ -42,6 +43,7 @@ static const struct xkb_rule_names xkb_rules = {
/* example: /* example:
.options = "ctrl:nocaps", .options = "ctrl:nocaps",
*/ */
.options = NULL,
}; };
static const int repeat_rate = 25; static const int repeat_rate = 25;
@@ -49,14 +51,48 @@ static const int repeat_delay = 600;
/* Trackpad */ /* Trackpad */
static const int tap_to_click = 1; static const int tap_to_click = 1;
static const int tap_and_drag = 1;
static const int drag_lock = 1;
static const int natural_scrolling = 0; 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;
/* You can choose between:
LIBINPUT_CONFIG_SCROLL_NO_SCROLL
LIBINPUT_CONFIG_SCROLL_2FG
LIBINPUT_CONFIG_SCROLL_EDGE
LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN
*/
static const enum libinput_config_scroll_method scroll_method = LIBINPUT_CONFIG_SCROLL_2FG;
/* You can choose between:
LIBINPUT_CONFIG_CLICK_METHOD_NONE
LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS
LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER
*/
static const enum libinput_config_click_method click_method = LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS;
/* You can choose between:
LIBINPUT_CONFIG_SEND_EVENTS_ENABLED
LIBINPUT_CONFIG_SEND_EVENTS_DISABLED
LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE
*/
static const uint32_t send_events_mode = LIBINPUT_CONFIG_SEND_EVENTS_ENABLED;
/* You can choose between:
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;
/* If you want to use the windows key change this to WLR_MODIFIER_LOGO */
#define MODKEY WLR_MODIFIER_ALT #define MODKEY WLR_MODIFIER_ALT
#define TAGKEYS(KEY,SKEY,TAG) \ #define TAGKEYS(KEY,TAG) \
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \ { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
{ MODKEY|WLR_MODIFIER_CTRL, KEY, toggleview, {.ui = 1 << TAG} }, \ { MODKEY|WLR_MODIFIER_CTRL, KEY, toggleview, {.ui = 1 << TAG} }, \
{ MODKEY|WLR_MODIFIER_SHIFT, SKEY, tag, {.ui = 1 << TAG} }, \ { MODKEY|WLR_MODIFIER_SHIFT, KEY, tag, {.ui = 1 << TAG} }, \
{ MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT,SKEY,toggletag, {.ui = 1 << TAG} } { MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT,KEY,toggletag, {.ui = 1 << TAG} }
/* helper for spawning shell commands in the pre dwm-5.0 fashion */ /* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
@@ -78,7 +114,7 @@ static const Key keys[] = {
{ MODKEY, XKB_KEY_l, setmfact, {.f = +0.05} }, { MODKEY, XKB_KEY_l, setmfact, {.f = +0.05} },
{ 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|WLR_MODIFIER_SHIFT, XKB_KEY_C, killclient, {0} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_c, 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]} },
@@ -86,21 +122,21 @@ static const Key keys[] = {
{ 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} },
{ 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_0, tag, {.ui = ~0} },
{ MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} }, { MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} },
{ MODKEY, XKB_KEY_period, focusmon, {.i = WLR_DIRECTION_RIGHT} }, { MODKEY, XKB_KEY_period, focusmon, {.i = WLR_DIRECTION_RIGHT} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_less, tagmon, {.i = WLR_DIRECTION_LEFT} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_comma, tagmon, {.i = WLR_DIRECTION_LEFT} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_greater, tagmon, {.i = WLR_DIRECTION_RIGHT} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_period, tagmon, {.i = WLR_DIRECTION_RIGHT} },
TAGKEYS( XKB_KEY_1, XKB_KEY_exclam, 0), TAGKEYS( XKB_KEY_1, 0),
TAGKEYS( XKB_KEY_2, XKB_KEY_at, 1), TAGKEYS( XKB_KEY_2, 1),
TAGKEYS( XKB_KEY_3, XKB_KEY_numbersign, 2), TAGKEYS( XKB_KEY_3, 2),
TAGKEYS( XKB_KEY_4, XKB_KEY_dollar, 3), TAGKEYS( XKB_KEY_4, 3),
TAGKEYS( XKB_KEY_5, XKB_KEY_percent, 4), TAGKEYS( XKB_KEY_5, 4),
TAGKEYS( XKB_KEY_6, XKB_KEY_asciicircum, 5), TAGKEYS( XKB_KEY_6, 5),
TAGKEYS( XKB_KEY_7, XKB_KEY_ampersand, 6), TAGKEYS( XKB_KEY_7, 6),
TAGKEYS( XKB_KEY_8, XKB_KEY_asterisk, 7), TAGKEYS( XKB_KEY_8, 7),
TAGKEYS( XKB_KEY_9, XKB_KEY_parenleft, 8), TAGKEYS( XKB_KEY_9, 8),
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Q, quit, {0} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_q, quit, {0} },
/* Ctrl-Alt-Backspace and Ctrl-Alt-Fx used to be handled by X server */ /* 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} }, { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_Terminate_Server, quit, {0} },
+10 -3
View File
@@ -1,8 +1,15 @@
_VERSION = 0.3.1
VERSION = `./generate-version.sh $(_VERSION)`
# paths # paths
PREFIX = /usr/local PREFIX = /usr/local
MANDIR = $(PREFIX)/share/man
# Default compile flags (overridable by environment) # Compile flags that can be used
CFLAGS ?= -g -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wdeclaration-after-statement #CFLAGS = -pedantic -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wdeclaration-after-statement
XWAYLAND =
XLIBS =
# Uncomment to build XWayland support # Uncomment to build XWayland support
#CFLAGS += -DXWAYLAND #XWAYLAND = -DXWAYLAND
#XLIBS = xcb
+151
View File
@@ -0,0 +1,151 @@
.Dd January 8, 2021
.Dt DWL 1
.Os
.Sh NAME
.Nm dwl
.Nd dwm for Wayland
.Sh SYNOPSIS
.Nm
.Op Fl v
.Op Fl s Ar startup command
.Sh DESCRIPTION
.Nm
is a Wayland compositor based on wlroots.
It is intended to fill the same space in the Wayland world that
.Nm dwm
does for X11.
.Pp
When given the
.Fl v
option,
.Nm
writes its name and version to standard error and exits unsuccessfully.
.Pp
When given the
.Fl s
option,
.Nm
starts a shell process running
.Ar command
when starting.
When stopping, it sends
.Dv SIGTERM
to the child process and waits for it to exit.
.Pp
Users are encouraged to customize
.Nm
by editing the sources, in particular
.Pa config.h .
The default key bindings are as follows:
.Bl -tag -width 20n -offset indent -compact
.It Mod-[1-9]
Show only all windows with a tag.
.It Mod-Ctrl-[1-9]
Show all windows with a tag.
.It Mod-Shift-[1-9]
Move window to a single tag.
.It Mod-Ctrl-Shift-[1-9]
Toggle tag for window.
.It Mod-p
Spawn
.Nm bemenu-run .
.It Mod-Shift-Return
Spawn
.Nm alacritty .
.It Mod-[jk]
Move focus down/up the stack.
.It Mod-[id]
Increase/decrease number of windows in master area.
.It Mod-[hl]
Decrease/increase master area.
.It Mod-Return
Move window on top of stack or switch top of stack with second window.
.It Mod-Tab
Show only all windows with previous tag.
.It Mod-Shift-c
Close window.
.It Mod-t
Switch to tabbed layout.
.It Mod-f
Switch to floating layout.
.It Mod-m
Switch to monocle layout.
.It Mod-Space
Switch to previous layout.
.It Mod-Shift-Space
Toggle floating state of window.
.It Mod-e
Toggle fullscreen state of window.
.It Mod-0
Show all windows.
.It Mod-Shift-0
Set all tags for window.
.It Mod-,
Move focus to previous monitor.
.It Mod-.
Move focus to next monitor.
.It Mod-Shift-,
Move window to previous monitor.
.It Mod-Shift-.
Move window to next monitor.
.It Mod-Shift-q
Quit
.Nm .
.El
These might differ depending on your keyboard layout.
.Sh ENVIRONMENT
These environment variables are used by
.Nm :
.Bl -tag -width XDG_RUNTIME_DIR
.It Ev XDG_RUNTIME_DIR
A directory where temporary user files, such as the Wayland socket,
are stored.
.It Ev XDG_CONFIG_DIR
A directory containung configuration of various programs and
libraries, including libxkbcommon.
.It Ev DISPLAY , WAYLAND_DISPLAY , WAYLAND_SOCKET
Tell how to connect to an underlying X11 or Wayland server.
.It Ev WLR_*
Various variables specific to wlroots.
.It Ev XKB_* , XLOCALEDIR , XCOMPOSEFILE
Various variables specific to libxkbcommon.
.It Ev XCURSOR_PATH
List of directories to search for XCursor themes in.
.It Ev HOME
A directory where there are always dear files there for you.
Waiting for you to clean them up.
.El
.Pp
These are set by
.Nm :
.Bl -tag -width WAYLAND_DISPLAY
.It Ev WAYLAND_DISPLAY
Tell how to connect to
.Nm .
.It Ev DISPLAY
If using
.Nm Xwayland ,
tell how to connect to the
.Nm Xwayland
server.
.El
.Sh EXAMPLES
Start
.Nm
with s6 in the background:
.Dl dwl -s 's6-svscan <&-'
.Sh SEE ALSO
.Xr alacritty 1 ,
.Xr bemenu 1 ,
.Xr dwm 1 ,
.Xr xkeyboard-config 7
.Sh CAVEATS
The child process's standard input is connected with a pipe to
.Nm .
If the child process neither reads from the pipe nor closes its
standard input,
.Nm
will freeze after a while due to it blocking when writing to the full
pipe buffer.
.Sh BUGS
All of them.
+439 -254
View File
File diff suppressed because it is too large Load Diff
+13
View File
@@ -0,0 +1,13 @@
#!/bin/sh
if git tag --contains HEAD | grep -q $1; then
echo $1
else
branch="$(git rev-parse --abbrev-ref HEAD)"
commit="$(git rev-parse --short HEAD)"
if [ "${branch}" != "main" ]; then
echo $1-$branch-$commit
else
echo $1-$commit
fi
fi
+35
View File
@@ -0,0 +1,35 @@
/* See LICENSE.dwm file for copyright and license details. */
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "util.h"
void *
ecalloc(size_t nmemb, size_t size)
{
void *p;
if (!(p = calloc(nmemb, size)))
die("calloc:");
return p;
}
void
die(const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
if (fmt[0] && fmt[strlen(fmt)-1] == ':') {
fputc(' ', stderr);
perror(NULL);
} else {
fputc('\n', stderr);
}
exit(1);
}
+4
View File
@@ -0,0 +1,4 @@
/* See LICENSE.dwm file for copyright and license details. */
void die(const char *fmt, ...);
void *ecalloc(size_t nmemb, size_t size);