mirror of
https://codeberg.org/dwl/dwl.git
synced 2026-03-22 08:41:30 +00:00
Compare commits
158 Commits
f19301ef68
...
74fdafbaef
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74fdafbaef | ||
|
|
ca4123072d | ||
|
|
a8915224e8 | ||
|
|
9b11a49cb7 | ||
|
|
53e3e60d4d | ||
|
|
9837ea5729 | ||
|
|
9ba7461f4d | ||
|
|
aca61738a2 | ||
|
|
6cd26568d5 | ||
|
|
ed2e1efda8 | ||
|
|
ab4cb6e283 | ||
|
|
b28674e0ca | ||
|
|
15bfffd87a | ||
|
|
90b8371707 | ||
|
|
ea263a0ed5 | ||
|
|
67ff29eb95 | ||
|
|
661e1ee38c | ||
|
|
9dbce43a69 | ||
|
|
59c99308b0 | ||
|
|
02f8744a48 | ||
|
|
d1880b4422 | ||
|
|
78e75a83a4 | ||
|
|
7d2415bfe8 | ||
|
|
de57f6c315 | ||
|
|
faa56cc9b9 | ||
|
|
4456f4536a | ||
|
|
e0f531d508 | ||
|
|
aa69ed81b5 | ||
|
|
d1c2f43498 | ||
|
|
da13a95683 | ||
|
|
9a9f67db1c | ||
|
|
4e7e2999d4 | ||
|
|
0925fe956a | ||
|
|
26504f9a6f | ||
|
|
6f34a6d3a6 | ||
|
|
30f5063474 | ||
|
|
1d08ade132 | ||
|
|
84245764e2 | ||
|
|
6ca87210d4 | ||
|
|
002c7d2204 | ||
|
|
8206cc8889 | ||
|
|
54f207839f | ||
|
|
9c05b9622c | ||
|
|
d34be5d545 | ||
|
|
c49312f084 | ||
|
|
f899060965 | ||
|
|
cc72df11d6 | ||
|
|
0312720ae8 | ||
|
|
6de87121e2 | ||
|
|
bbc00d88a4 | ||
|
|
54b546121b | ||
|
|
43016bdad8 | ||
|
|
b616476c85 | ||
|
|
d4ad37354e | ||
|
|
5db05e82bd | ||
|
|
8ec5e52e06 | ||
|
|
c5275ca571 | ||
|
|
2c0b889f86 | ||
|
|
554754c9a2 | ||
|
|
0caa658276 | ||
|
|
07aeef1f7e | ||
|
|
e454f7ae81 | ||
|
|
334bbe6f0f | ||
|
|
1b805ddd38 | ||
|
|
94f4ead7da | ||
|
|
bb21ecda30 | ||
|
|
b25717c939 | ||
|
|
a4fa954616 | ||
|
|
35951a8d7e | ||
|
|
a634e3f527 | ||
|
|
d136dadf45 | ||
|
|
672b4c405d | ||
|
|
b5abbc37d8 | ||
|
|
986beef5be | ||
|
|
487abc28ba | ||
|
|
cd216908a7 | ||
|
|
f2c5023a3a | ||
|
|
4bbbb4907e | ||
|
|
ea6a450121 | ||
|
|
ad30ca910b | ||
|
|
452a314faa | ||
|
|
da6de7c4d7 | ||
|
|
2553111aa3 | ||
|
|
51881da27b | ||
|
|
7328e5691c | ||
|
|
bd59573f07 | ||
|
|
0060e1922d | ||
|
|
c709b09e10 | ||
|
|
efe10ea655 | ||
|
|
9a962ce136 | ||
|
|
0761fd0691 | ||
|
|
12b44421c8 | ||
|
|
5a4839b1c8 | ||
|
|
bd5001b780 | ||
|
|
043ab3ac13 | ||
|
|
aede3b294b | ||
|
|
7d8c3ea369 | ||
|
|
2db0a2e8ef | ||
|
|
ab5c554d09 | ||
|
|
b4638fef29 | ||
|
|
71f11e6cf6 | ||
|
|
2b4893a0ad | ||
|
|
1002ea04fa | ||
|
|
5d73134e33 | ||
|
|
46ae075430 | ||
|
|
13925eb1da | ||
|
|
4a7d1bebf5 | ||
|
|
baedf7f791 | ||
|
|
845d3c47bd | ||
|
|
9cdce1b8ff | ||
|
|
4cf1d604b8 | ||
|
|
650a918010 | ||
|
|
2902df94d6 | ||
|
|
9b1f35e42b | ||
|
|
92d1c286b8 | ||
|
|
784b047b38 | ||
|
|
11baacbec0 | ||
|
|
16076ec5a4 | ||
|
|
a8403d7b4d | ||
|
|
7a46fccdba | ||
|
|
c2e7350f2e | ||
|
|
7570dc0a41 | ||
|
|
e5a57fb155 | ||
|
|
57b5e41063 | ||
|
|
f4b6b429ec | ||
|
|
21205f2f40 | ||
|
|
8f6fca35d0 | ||
|
|
bca077b927 | ||
|
|
0047ff740a | ||
|
|
bf81a128ec | ||
|
|
9825c26cdd | ||
|
|
34b7a57211 | ||
|
|
5c19e23146 | ||
|
|
3b1f0a8a88 | ||
|
|
bb73481662 | ||
|
|
577d8da6d1 | ||
|
|
72e2ce8b00 | ||
|
|
a0117eea76 | ||
|
|
7b3eb70501 | ||
|
|
c215e8a3e1 | ||
|
|
8e0b5baf8e | ||
|
|
5fec98b17a | ||
|
|
4043fc3093 | ||
|
|
b3f33e9147 | ||
|
|
f136aa088a | ||
|
|
1c3aaa70ba | ||
|
|
facbe57fcb | ||
|
|
668022bc90 | ||
|
|
c222468887 | ||
|
|
05c263de45 | ||
|
|
bf35e77811 | ||
|
|
bf5a6be73c | ||
|
|
126a333354 | ||
|
|
0de7d1aa71 | ||
|
|
bab5c0185a | ||
|
|
70c5fcc23d | ||
|
|
3fe3581a59 | ||
|
|
057d50af8c |
3
.mailmap
Normal file
3
.mailmap
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
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>
|
||||||
107
CHANGELOG.md
107
CHANGELOG.md
@ -1,19 +1,126 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
* [Unreleased](#unreleased)
|
* [Unreleased](#unreleased)
|
||||||
|
* [0.7](#0.7)
|
||||||
|
* [0.6](#0.6)
|
||||||
* [0.5](#0.5)
|
* [0.5](#0.5)
|
||||||
|
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
### Added
|
### 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
|
### Changed
|
||||||
### Deprecated
|
### Deprecated
|
||||||
### Removed
|
### Removed
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
* Crash when a client is created while all outputs are disabled.
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
### Contributors
|
### Contributors
|
||||||
|
|
||||||
|
|
||||||
|
## 0.7
|
||||||
|
|
||||||
|
This version is just 0.6 with wlroots 0.18 compatibility.
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
* Add support for the alpha-modifier-v1 protocol ([wlroots!4616][wlroots!4616]).
|
||||||
|
* dwl now will survive GPU resets ([#601][601]).
|
||||||
|
|
||||||
|
[wlroots!4616]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4616
|
||||||
|
[601]: https://codeberg.org/dwl/dwl/issues/601
|
||||||
|
|
||||||
|
|
||||||
|
### Contributors
|
||||||
|
|
||||||
|
Guido Cella
|
||||||
|
|
||||||
|
|
||||||
|
## 0.6
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
* Add `rootcolor` to change the default background color ([#544][544]).
|
||||||
|
* Implement the wlr-virtual-pointer-unstable-v1 protocol ([#574][574]).
|
||||||
|
* Implement the pointer-constraints and relative-pointer protocols ([#317][317])
|
||||||
|
* Implement the wlr-output-power-management protocol ([#599][599])
|
||||||
|
|
||||||
|
[544]: https://codeberg.org/dwl/dwl/pulls/544
|
||||||
|
[574]: https://codeberg.org/dwl/dwl/pulls/574
|
||||||
|
[317]: https://codeberg.org/dwl/dwl/issues/317
|
||||||
|
[599]: https://codeberg.org/dwl/dwl/issues/559
|
||||||
|
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
* Keyboards are now managed through keyboard groups ([#549][549]).
|
||||||
|
* Only the first matched keybinding is executed.
|
||||||
|
* Allow toggling the layout before selecting a different one ([#570][570]).
|
||||||
|
* Fullscreen clients are now rendered above wlr_layer_surfaces in the top layer
|
||||||
|
([#609][609]).
|
||||||
|
* The default menu was changed from `bemenu-run` to `wmenu-run` ([#553][553]).
|
||||||
|
* The option `sloppyfocus` now replicates the dwm behavior ([#599][599]).
|
||||||
|
* Allow configure position of monitors with negative values. (-1, -1) is
|
||||||
|
used to auto-configure them ([#635][635]).
|
||||||
|
* dwl now kills the entire process group of `startup_cmd`
|
||||||
|
* The O_NONBLOCK flag is set for stdout.
|
||||||
|
|
||||||
|
[549]: https://codeberg.org/dwl/dwl/pulls/549
|
||||||
|
[570]: https://codeberg.org/dwl/dwl/pulls/570
|
||||||
|
[609]: https://codeberg.org/dwl/dwl/pulls/609
|
||||||
|
[553]: https://codeberg.org/dwl/dwl/issues/553
|
||||||
|
[599]: https://codeberg.org/dwl/dwl/pulls/599
|
||||||
|
[635]: https://codeberg.org/dwl/dwl/pulls/635
|
||||||
|
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
|
||||||
|
* The SLOC limit is now removed ([#497][497]).
|
||||||
|
|
||||||
|
[497]: https://codeberg.org/dwl/dwl/pulls/497
|
||||||
|
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
* Clients not having the correct border color when mapping.
|
||||||
|
* Compliance with the xdg-decoration-unstable-v1 ([#546][546]).
|
||||||
|
* dwl no longer sends negative values in xdg_toplevel.configure events.
|
||||||
|
* Crashes with disabled monitors ([#472][472]).
|
||||||
|
|
||||||
|
[546]: https://codeberg.org/dwl/dwl/pulls/546
|
||||||
|
[472]: https://codeberg.org/dwl/dwl/issues/472
|
||||||
|
|
||||||
|
|
||||||
|
### Contributors
|
||||||
|
|
||||||
|
Ben Jargowsky
|
||||||
|
Benjamin Chausse
|
||||||
|
David Donahue
|
||||||
|
Devin J. Pohly
|
||||||
|
Dima Krasner
|
||||||
|
Emil Miler
|
||||||
|
Forrest Bushstone
|
||||||
|
Guido Cella
|
||||||
|
Peter Hofmann
|
||||||
|
Rutherther
|
||||||
|
Squibid
|
||||||
|
choc
|
||||||
|
fictitiousexistence
|
||||||
|
korei999
|
||||||
|
sewn
|
||||||
|
thanatos
|
||||||
|
|
||||||
|
|
||||||
## 0.5
|
## 0.5
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
40
Makefile
40
Makefile
@ -4,19 +4,24 @@
|
|||||||
include config.mk
|
include config.mk
|
||||||
|
|
||||||
# flags for compiling
|
# flags for compiling
|
||||||
DWLCPPFLAGS = -I. -DWLR_USE_UNSTABLE -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\" $(XWAYLAND)
|
DWLCPPFLAGS = -I. -DWLR_USE_UNSTABLE -D_POSIX_C_SOURCE=200809L \
|
||||||
DWLDEVCFLAGS = -g -pedantic -Wall -Wextra -Wdeclaration-after-statement -Wno-unused-parameter -Wshadow -Wunused-macros\
|
-DVERSION=\"$(VERSION)\" $(XWAYLAND)
|
||||||
-Werror=strict-prototypes -Werror=implicit -Werror=return-type -Werror=incompatible-pointer-types -Wfloat-conversion
|
DWLDEVCFLAGS = -g -Wpedantic -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
|
# CFLAGS / LDFLAGS
|
||||||
PKGS = wlroots wayland-server xkbcommon libinput $(XLIBS)
|
PKGS = wayland-server xkbcommon libinput $(XLIBS)
|
||||||
DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(DWLCPPFLAGS) $(DWLDEVCFLAGS) $(CFLAGS)
|
DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(WLR_INCS) $(DWLCPPFLAGS) $(DWLDEVCFLAGS) $(CFLAGS)
|
||||||
LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` $(LIBS)
|
LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` $(WLR_LIBS) -lm $(LIBS)
|
||||||
|
|
||||||
all: dwl
|
all: dwl
|
||||||
dwl: dwl.o util.o
|
dwl: dwl.o util.o
|
||||||
$(CC) dwl.o util.o $(LDLIBS) $(LDFLAGS) $(DWLCFLAGS) -o $@
|
$(CC) dwl.o util.o $(DWLCFLAGS) $(LDFLAGS) $(LDLIBS) -o $@
|
||||||
dwl.o: dwl.c config.mk config.h client.h cursor-shape-v1-protocol.h pointer-constraints-unstable-v1-protocol.h wlr-layer-shell-unstable-v1-protocol.h xdg-shell-protocol.h
|
dwl.o: dwl.c client.h config.h config.mk cursor-shape-v1-protocol.h \
|
||||||
|
pointer-constraints-unstable-v1-protocol.h wlr-layer-shell-unstable-v1-protocol.h \
|
||||||
|
wlr-output-power-management-unstable-v1-protocol.h xdg-shell-protocol.h
|
||||||
util.o: util.c util.h
|
util.o: util.c util.h
|
||||||
|
|
||||||
# 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
|
||||||
@ -26,14 +31,17 @@ WAYLAND_SCANNER = `$(PKG_CONFIG) --variable=wayland_scanner wayland-scanner`
|
|||||||
WAYLAND_PROTOCOLS = `$(PKG_CONFIG) --variable=pkgdatadir wayland-protocols`
|
WAYLAND_PROTOCOLS = `$(PKG_CONFIG) --variable=pkgdatadir wayland-protocols`
|
||||||
|
|
||||||
cursor-shape-v1-protocol.h:
|
cursor-shape-v1-protocol.h:
|
||||||
$(WAYLAND_SCANNER) server-header \
|
$(WAYLAND_SCANNER) enum-header \
|
||||||
$(WAYLAND_PROTOCOLS)/staging/cursor-shape/cursor-shape-v1.xml $@
|
$(WAYLAND_PROTOCOLS)/staging/cursor-shape/cursor-shape-v1.xml $@
|
||||||
pointer-constraints-unstable-v1-protocol.h:
|
pointer-constraints-unstable-v1-protocol.h:
|
||||||
$(WAYLAND_SCANNER) server-header \
|
$(WAYLAND_SCANNER) enum-header \
|
||||||
$(WAYLAND_PROTOCOLS)/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml $@
|
$(WAYLAND_PROTOCOLS)/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml $@
|
||||||
wlr-layer-shell-unstable-v1-protocol.h:
|
wlr-layer-shell-unstable-v1-protocol.h:
|
||||||
$(WAYLAND_SCANNER) server-header \
|
$(WAYLAND_SCANNER) enum-header \
|
||||||
protocols/wlr-layer-shell-unstable-v1.xml $@
|
protocols/wlr-layer-shell-unstable-v1.xml $@
|
||||||
|
wlr-output-power-management-unstable-v1-protocol.h:
|
||||||
|
$(WAYLAND_SCANNER) server-header \
|
||||||
|
protocols/wlr-output-power-management-unstable-v1.xml $@
|
||||||
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 $@
|
||||||
@ -45,14 +53,15 @@ clean:
|
|||||||
|
|
||||||
dist: clean
|
dist: clean
|
||||||
mkdir -p dwl-$(VERSION)
|
mkdir -p dwl-$(VERSION)
|
||||||
cp -R LICENSE* Makefile CHANGELOG.md README.md client.h config.def.h\
|
cp -R LICENSE* Makefile CHANGELOG.md README.md client.h config.def.h \
|
||||||
config.mk protocols dwl.1 dwl.c util.c util.h dwl.desktop\
|
config.mk protocols dwl.1 dwl.c util.c util.h dwl.desktop \
|
||||||
dwl-$(VERSION)
|
dwl-$(VERSION)
|
||||||
tar -caf dwl-$(VERSION).tar.gz dwl-$(VERSION)
|
tar -caf dwl-$(VERSION).tar.gz dwl-$(VERSION)
|
||||||
rm -rf dwl-$(VERSION)
|
rm -rf dwl-$(VERSION)
|
||||||
|
|
||||||
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
|
||||||
@ -62,8 +71,9 @@ install: dwl
|
|||||||
cp -f dwl.desktop $(DESTDIR)$(DATADIR)/wayland-sessions/dwl.desktop
|
cp -f dwl.desktop $(DESTDIR)$(DATADIR)/wayland-sessions/dwl.desktop
|
||||||
chmod 644 $(DESTDIR)$(DATADIR)/wayland-sessions/dwl.desktop
|
chmod 644 $(DESTDIR)$(DATADIR)/wayland-sessions/dwl.desktop
|
||||||
uninstall:
|
uninstall:
|
||||||
rm -f $(DESTDIR)$(PREFIX)/bin/dwl $(DESTDIR)$(MANDIR)/man1/dwl.1 $(DESTDIR)$(DATADIR)/wayland-sessions/dwl.desktop
|
rm -f $(DESTDIR)$(PREFIX)/bin/dwl $(DESTDIR)$(MANDIR)/man1/dwl.1 \
|
||||||
|
$(DESTDIR)$(DATADIR)/wayland-sessions/dwl.desktop
|
||||||
|
|
||||||
.SUFFIXES: .c .o
|
.SUFFIXES: .c .o
|
||||||
.c.o:
|
.c.o:
|
||||||
$(CC) $(CPPFLAGS) $(DWLCFLAGS) -c $<
|
$(CC) $(CPPFLAGS) $(DWLCFLAGS) -o $@ -c $<
|
||||||
|
|||||||
218
README.md
218
README.md
@ -1,108 +1,82 @@
|
|||||||
# dwl - dwm for Wayland
|
# dwl - dwm for Wayland
|
||||||
|
|
||||||
Join us on our IRC channel: [#dwl on Libera Chat]
|
Join us on our IRC channel: [#dwl on Libera Chat]
|
||||||
Or on our [Discord server].
|
Or on the community-maintained [Discord server].
|
||||||
|
|
||||||
dwl is a compact, hackable compositor for [Wayland] based on [wlroots]. It is
|
dwl is a compact, hackable compositor for [Wayland] based on [wlroots]. It is
|
||||||
intended to fill the same space in the Wayland world that dwm does in X11,
|
intended to fill the same space in the Wayland world that [dwm] does in X11,
|
||||||
primarily in terms of functionality, and secondarily in terms of philosophy.
|
primarily in terms of functionality, and secondarily in terms of
|
||||||
Like dwm, dwl is:
|
philosophy. Like [dwm], dwl is:
|
||||||
|
|
||||||
- Easy to understand, hack on, and extend with patches
|
- Easy to understand, hack on, and extend with patches
|
||||||
- One C source file (or a very small number) configurable via `config.h`
|
- One C source file (or a very small number) configurable via `config.h`
|
||||||
- Tied to as few external dependencies as possible
|
- Tied to as few external dependencies as possible
|
||||||
|
|
||||||
dwl is not meant to provide every feature under the sun. Instead, like dwm, it
|
## Getting Started:
|
||||||
sticks to features which are necessary, simple, and straightforward to implement
|
|
||||||
given the base on which it is built. Implemented default features are:
|
|
||||||
|
|
||||||
- Any features provided by dwm/Xlib: simple window borders, tags, keybindings,
|
### Latest semi-stable [release]
|
||||||
client rules, mouse move/resize. Providing a built-in status bar is an
|
This is probably where you want to start. This builds against the [wlroots]
|
||||||
exception to this goal, to avoid dependencies on font rendering and/or
|
versions currently shipping in major distributions. If your
|
||||||
drawing libraries when an external bar could work well.
|
distribution's `wlroots` version is older, use an earlier dwl [release].
|
||||||
- Configurable multi-monitor layout support, including position and rotation
|
The `wlroots` version against which a given `dwl` release builds is specified
|
||||||
- Configurable HiDPI/multi-DPI support
|
with each release on the [release] page
|
||||||
- Idle-inhibit protocol which lets applications such as mpv disable idle
|
|
||||||
monitoring
|
|
||||||
- Provide information to external status bars via stdout/stdin
|
|
||||||
- Urgency hints via xdg-activate protocol
|
|
||||||
- Support screen lockers via ext-session-lock-v1 protocol
|
|
||||||
- Various Wayland protocols
|
|
||||||
- XWayland support as provided by wlroots (can be enabled in `config.mk`)
|
|
||||||
- Zero flickering - Wayland users naturally expect that "every frame is perfect"
|
|
||||||
- Layer shell popups (used by Waybar)
|
|
||||||
- Damage tracking provided by scenegraph API
|
|
||||||
|
|
||||||
Given the Wayland architecture, dwl has to implement features from dwm **and**
|
### Development branch [main]
|
||||||
the xorg-server. Because of this, it is impossible to maintain the original
|
Active development progresses on the `main` branch. The `main` branch is built
|
||||||
project goal of 2000 SLOC and have a reasonably complete compositor with
|
against a late (and often changing) git commit of wlroots. While the adventurous
|
||||||
features comparable to dwm. However, this does not mean that the code will grow
|
are welcome to use `main`, it is a rocky road. Using `main` requires that the
|
||||||
indiscriminately. We will try to keep the code as small as possible.
|
user be willing to chase git commits of wlroots. Testing development pull
|
||||||
|
requests may involve merging unmerged pull requests in [wlroots]' git repository
|
||||||
Features under consideration (possibly as patches) are:
|
and/or git commits of wayland.
|
||||||
|
|
||||||
- Protocols made trivial by wlroots
|
|
||||||
- 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://codeberg.org/dwl/dwl/pulls/235)
|
|
||||||
|
|
||||||
Feature *non-goals* for the main codebase include:
|
|
||||||
|
|
||||||
- Client-side decoration (any more than is necessary to tell the clients not to)
|
|
||||||
- Client-initiated window management, such as move, resize, and close, which can
|
|
||||||
be done through the compositor
|
|
||||||
- Animations and visual effects
|
|
||||||
|
|
||||||
## Building dwl
|
|
||||||
|
|
||||||
|
### Building dwl
|
||||||
dwl has the following dependencies:
|
dwl has the following dependencies:
|
||||||
```
|
- libinput
|
||||||
libinput
|
- wayland
|
||||||
wayland
|
- wlroots (compiled with the libinput backend)
|
||||||
wlroots (compiled with the libinput backend)
|
- xkbcommon
|
||||||
xkbcommon
|
- wayland-protocols (compile-time only)
|
||||||
wayland-protocols (compile-time only)
|
- pkg-config (compile-time only)
|
||||||
pkg-config (compile-time only)
|
|
||||||
```
|
|
||||||
If you enable X11 support:
|
|
||||||
```
|
|
||||||
libxcb
|
|
||||||
libxcb-wm
|
|
||||||
wlroots (compiled with X11 support)
|
|
||||||
Xwayland (runtime only)
|
|
||||||
```
|
|
||||||
|
|
||||||
Simply install these (and their `-devel` versions if your distro has separate
|
dwl has the following additional dependencies if XWayland support is enabled:
|
||||||
development packages) and run `make`. If you wish to build against a Git
|
- libxcb
|
||||||
version of wlroots, check out the [wlroots-next branch].
|
- libxcb-wm
|
||||||
|
- wlroots (compiled with X11 support)
|
||||||
|
- Xwayland (runtime only)
|
||||||
|
|
||||||
|
Install these (and their `-devel` versions if your distro has separate
|
||||||
|
development packages) and run `make`. If you wish to build against a released
|
||||||
|
version of wlroots (*you probably do*), use a [release] or a [0.x branch]. If
|
||||||
|
you want to use the unstable development `main` branch, you need to use the git
|
||||||
|
version of [wlroots].
|
||||||
|
|
||||||
To enable XWayland, you should uncomment its flags in `config.mk`.
|
To enable XWayland, you should uncomment its flags in `config.mk`.
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
All configuration is done by editing `config.h` and recompiling, in the same
|
All configuration is done by editing `config.h` and recompiling, in the same
|
||||||
manner as dwm. There is no way to separately restart the window manager in
|
manner as [dwm]. There is no way to separately restart the window manager in
|
||||||
Wayland without restarting the entire display server, so any changes will take
|
Wayland without restarting the entire display server, so any changes will take
|
||||||
effect the next time dwl is executed.
|
effect the next time dwl is executed.
|
||||||
|
|
||||||
As in the dwm community, we encourage users to share patches they have created.
|
As in the [dwm] community, we encourage users to share patches they have
|
||||||
Check out the dwl [patches repository] and [patches wiki]!
|
created. Check out the [dwl-patches] repository!
|
||||||
|
|
||||||
## Running dwl
|
## Running dwl
|
||||||
|
|
||||||
dwl can be run on any of the backends supported by wlroots. This means you can
|
dwl can be run on any of the backends supported by wlroots. This means you can
|
||||||
run it as a separate window inside either an X11 or Wayland session, as well
|
run it as a separate window inside either an X11 or Wayland session, as well as
|
||||||
as directly from a VT console. Depending on your distro's setup, you may need
|
directly from a VT console. Depending on your distro's setup, you may need to
|
||||||
to add your user to the `video` and `input` groups before you can run dwl on
|
add your user to the `video` and `input` groups before you can run dwl on a
|
||||||
a VT. If you are using `elogind` or `systemd-logind` you need to install
|
VT. If you are using `elogind` or `systemd-logind` you need to install polkit;
|
||||||
polkit; otherwise you need to add yourself in the `seat` group and
|
otherwise you need to add yourself in the `seat` group and enable/start the
|
||||||
enable/start the seatd daemon.
|
seatd daemon.
|
||||||
|
|
||||||
When dwl is run with no arguments, it will launch the server and begin handling
|
When dwl is run with no arguments, it will launch the server and begin handling
|
||||||
any shortcuts configured in `config.h`. There is no status bar or other
|
any shortcuts configured in `config.h`. There is no status bar or other
|
||||||
decoration initially; these are instead clients that can be run within
|
decoration initially; these are instead clients that can be run within the
|
||||||
the Wayland session.
|
Wayland session. Do note that the default background color is grey. This can be
|
||||||
Do note that the background color is black.
|
modified in `config.h`.
|
||||||
|
|
||||||
If you would like to run a script or command automatically at startup, you can
|
If you would like to run a script or command automatically at startup, you can
|
||||||
specify the command using the `-s` option. This command will be executed as a
|
specify the command using the `-s` option. This command will be executed as a
|
||||||
@ -110,7 +84,8 @@ shell command using `/bin/sh -c`. It serves a similar function to `.xinitrc`,
|
|||||||
but differs in that the display server will not shut down when this process
|
but differs in that the display server will not shut down when this process
|
||||||
terminates. Instead, dwl will send this process a SIGTERM at shutdown and wait
|
terminates. Instead, dwl will send this process a SIGTERM at shutdown and wait
|
||||||
for it to terminate (if it hasn't already). This makes it ideal for execing into
|
for it to terminate (if it hasn't already). This makes it ideal for execing into
|
||||||
a user service manager like [s6], [anopa], [runit], [dinit], or [`systemd --user`].
|
a user service manager like [s6], [anopa], [runit], [dinit], or [`systemd
|
||||||
|
--user`].
|
||||||
|
|
||||||
Note: The `-s` command is run as a *child process* of dwl, which means that it
|
Note: The `-s` command is run as a *child process* of dwl, which means that it
|
||||||
does not have the ability to affect the environment of dwl or of any processes
|
does not have the ability to affect the environment of dwl or of any processes
|
||||||
@ -128,11 +103,11 @@ automatically, you will need to configure it prior to launching `dwl`, e.g.:
|
|||||||
|
|
||||||
Information about selected layouts, current window title, app-id, and
|
Information about selected layouts, current window title, app-id, and
|
||||||
selected/occupied/urgent tags is written to the stdin of the `-s` command (see
|
selected/occupied/urgent tags is written to the stdin of the `-s` command (see
|
||||||
the `printstatus()` function for details). This information can be used to
|
the `STATUS INFORMATION` section in `_dwl_(1)`). This information can be used to
|
||||||
populate an external status bar with a script that parses the information.
|
populate an external status bar with a script that parses the
|
||||||
Failing to read this information will cause dwl to block, so if you do want to
|
information. Failing to read this information will cause dwl to block, so if you
|
||||||
run a startup command that does not consume the status information, you can
|
do want to run a startup command that does not consume the status information,
|
||||||
close standard input with the `<&-` shell redirection, for example:
|
you can close standard input with the `<&-` shell redirection, for example:
|
||||||
|
|
||||||
dwl -s 'foot --server <&-'
|
dwl -s 'foot --server <&-'
|
||||||
|
|
||||||
@ -143,10 +118,62 @@ script with the line
|
|||||||
|
|
||||||
To get a list of status bars that work with dwl consult our [wiki].
|
To get a list of status bars that work with dwl consult our [wiki].
|
||||||
|
|
||||||
|
### (Known) Java nonreparenting WM issue
|
||||||
|
Certain IDEs don't display correctly unless an environmental variable for Java AWT
|
||||||
|
indicates that the WM is nonreparenting.
|
||||||
|
|
||||||
|
For some Java AWT-based IDEs, such as Xilinx Vivado and Microchip MPLAB X, the
|
||||||
|
following environment variable needs to be set before running the IDE or dwl:
|
||||||
|
|
||||||
|
export _JAVA_AWT_WM_NONREPARENTING=1
|
||||||
|
|
||||||
## Replacements for X applications
|
## Replacements for X applications
|
||||||
|
|
||||||
You can find a [list of useful resources on our wiki].
|
You can find a [list of useful resources on our wiki].
|
||||||
|
|
||||||
|
## Background
|
||||||
|
|
||||||
|
dwl is not meant to provide every feature under the sun. Instead, like [dwm], it
|
||||||
|
sticks to features which are necessary, simple, and straightforward to implement
|
||||||
|
given the base on which it is built. Implemented default features are:
|
||||||
|
|
||||||
|
- 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 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
|
||||||
|
- Urgency hints via xdg-activate protocol
|
||||||
|
- Support screen lockers via ext-session-lock-v1 protocol
|
||||||
|
- Various Wayland protocols
|
||||||
|
- XWayland support as provided by wlroots (can be enabled in `config.mk`)
|
||||||
|
- Zero flickering - Wayland users naturally expect that "every frame is perfect"
|
||||||
|
- Layer shell popups (used by Waybar)
|
||||||
|
- Damage tracking provided by scenegraph API
|
||||||
|
|
||||||
|
Given the Wayland architecture, dwl has to implement features from [dwm] **and**
|
||||||
|
the xorg-server. Because of this, it is impossible to maintain the original
|
||||||
|
project goal of 2000 SLOC and have a reasonably complete compositor with
|
||||||
|
features comparable to [dwm]. However, this does not mean that the code will grow
|
||||||
|
indiscriminately. We will try to keep the code as small as possible.
|
||||||
|
|
||||||
|
Features under consideration (possibly as patches) are:
|
||||||
|
|
||||||
|
- Protocols made trivial by wlroots
|
||||||
|
- 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://codeberg.org/dwl/dwl/pulls/235)
|
||||||
|
|
||||||
|
Feature *non-goals* for the main codebase include:
|
||||||
|
|
||||||
|
- Client-side decoration (any more than is necessary to tell the clients not to)
|
||||||
|
- Client-initiated window management, such as move, resize, and close, which can
|
||||||
|
be done through the compositor
|
||||||
|
- Animations and visual effects
|
||||||
|
|
||||||
## Acknowledgements
|
## Acknowledgements
|
||||||
|
|
||||||
dwl began by extending the TinyWL example provided (CC0) by the sway/wlroots
|
dwl began by extending the TinyWL example provided (CC0) by the sway/wlroots
|
||||||
@ -154,7 +181,7 @@ developers. This was made possible in many cases by looking at how sway
|
|||||||
accomplished something, then trying to do the same in as suckless a way as
|
accomplished something, then trying to do the same in as suckless a way as
|
||||||
possible.
|
possible.
|
||||||
|
|
||||||
Many thanks to suckless.org and the dwm developers and community for the
|
Many thanks to suckless.org and the [dwm] developers and community for the
|
||||||
inspiration, and to the various contributors to the project, including:
|
inspiration, and to the various contributors to the project, including:
|
||||||
|
|
||||||
- **Devin J. Pohly for creating and nurturing the fledgling project**
|
- **Devin J. Pohly for creating and nurturing the fledgling project**
|
||||||
@ -164,18 +191,21 @@ inspiration, and to the various contributors to the project, including:
|
|||||||
- Stivvo for output management and fullscreen support, and patch maintenance
|
- Stivvo for output management and fullscreen support, and patch maintenance
|
||||||
|
|
||||||
|
|
||||||
[Discord server]: https://discord.gg/jJxZnrGPWN
|
[wlroots]: https://gitlab.freedesktop.org/wlroots
|
||||||
[#dwl on Libera Chat]: https://web.libera.chat/?channels=#dwl
|
[dwm]: https://dwm.suckless.org/
|
||||||
[Wayland]: https://wayland.freedesktop.org/
|
|
||||||
[wlroots]: https://gitlab.freedesktop.org/wlroots/wlroots/
|
|
||||||
[wlroots-next branch]: https://codeberg.org/dwl/dwl/src/branch/wlroots-next
|
|
||||||
[patches repository]: https://codeberg.org/dwl/dwl-patches
|
|
||||||
[patches wiki]: https://codeberg.org/dwl/dwl-patches/wiki
|
|
||||||
[s6]: https://skarnet.org/software/s6/
|
|
||||||
[anopa]: https://jjacky.com/anopa/
|
|
||||||
[runit]: http://smarden.org/runit/faq.html#userservices
|
|
||||||
[dinit]: https://davmac.org/projects/dinit/
|
|
||||||
[`systemd --user`]: https://wiki.archlinux.org/title/Systemd/User
|
[`systemd --user`]: https://wiki.archlinux.org/title/Systemd/User
|
||||||
|
[#dwl on Libera Chat]: https://web.libera.chat/?channels=#dwl
|
||||||
|
[0.7-rc1]: https://codeberg.org/dwl/dwl/releases/tag/v0.7-rc1
|
||||||
|
[0.x branch]: https://codeberg.org/dwl/dwl/branches
|
||||||
|
[anopa]: https://jjacky.com/anopa/
|
||||||
|
[dinit]: https://davmac.org/projects/dinit/
|
||||||
|
[dwl-patches]: https://codeberg.org/dwl/dwl-patches
|
||||||
|
[list of useful resources on our wiki]: https://codeberg.org/dwl/dwl/wiki/Home#migrating-from-x
|
||||||
|
[main]: https://codeberg.org/dwl/dwl/src/branch/main
|
||||||
|
[release]: https://codeberg.org/dwl/dwl/releases
|
||||||
|
[runit]: http://smarden.org/runit/faq.html#userservices
|
||||||
|
[s6]: https://skarnet.org/software/s6/
|
||||||
|
[wlroots]: https://gitlab.freedesktop.org/wlroots/wlroots/
|
||||||
[wiki]: https://codeberg.org/dwl/dwl/wiki/Home#compatible-status-bars
|
[wiki]: https://codeberg.org/dwl/dwl/wiki/Home#compatible-status-bars
|
||||||
[list of useful resources on our wiki]:
|
[Discord server]: https://discord.gg/jJxZnrGPWN
|
||||||
https://codeberg.org/dwl/dwl/wiki/Home#migrating-from-x
|
[Wayland]: https://wayland.freedesktop.org/
|
||||||
|
|||||||
82
client.h
82
client.h
@ -126,15 +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 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,
|
||||||
@ -147,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
|
||||||
@ -164,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 *
|
||||||
@ -172,11 +170,11 @@ client_get_parent(Client *c)
|
|||||||
{
|
{
|
||||||
Client *p = NULL;
|
Client *p = NULL;
|
||||||
#ifdef XWAYLAND
|
#ifdef XWAYLAND
|
||||||
if (client_is_x11(c)) {
|
if (client_is_x11(c)) {
|
||||||
if (c->surface.xwayland->parent)
|
if (c->surface.xwayland->parent)
|
||||||
toplevel_from_wlr_surface(c->surface.xwayland->parent->surface, &p, NULL);
|
toplevel_from_wlr_surface(c->surface.xwayland->parent->surface, &p, NULL);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (c->surface.xdg->toplevel->parent)
|
if (c->surface.xdg->toplevel->parent)
|
||||||
toplevel_from_wlr_surface(c->surface.xdg->toplevel->parent->base->surface, &p, NULL);
|
toplevel_from_wlr_surface(c->surface.xdg->toplevel->parent->base->surface, &p, NULL);
|
||||||
@ -187,12 +185,12 @@ static inline int
|
|||||||
client_has_children(Client *c)
|
client_has_children(Client *c)
|
||||||
{
|
{
|
||||||
#ifdef XWAYLAND
|
#ifdef XWAYLAND
|
||||||
if (client_is_x11(c))
|
if (client_is_x11(c))
|
||||||
return !wl_list_empty(&c->surface.xwayland->children);
|
return !wl_list_empty(&c->surface.xwayland->children);
|
||||||
#endif
|
#endif
|
||||||
/* surface.xdg->link is never empty because it always contains at least the
|
/* surface.xdg->link is never empty because it always contains at least the
|
||||||
* surface itself. */
|
* surface itself. */
|
||||||
return wl_list_length(&c->surface.xdg->link) > 1;
|
return wl_list_length(&c->surface.xdg->link) > 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline const char *
|
static inline const char *
|
||||||
@ -200,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
|
||||||
@ -215,16 +213,15 @@ client_is_float_type(Client *c)
|
|||||||
if (client_is_x11(c)) {
|
if (client_is_x11(c)) {
|
||||||
struct wlr_xwayland_surface *surface = c->surface.xwayland;
|
struct wlr_xwayland_surface *surface = c->surface.xwayland;
|
||||||
xcb_size_hints_t *size_hints = surface->size_hints;
|
xcb_size_hints_t *size_hints = surface->size_hints;
|
||||||
size_t i;
|
|
||||||
if (surface->modal)
|
if (surface->modal)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
for (i = 0; i < surface->window_type_len; i++)
|
if (wlr_xwayland_surface_has_window_type(surface, WLR_XWAYLAND_NET_WM_WINDOW_TYPE_DIALOG)
|
||||||
if (surface->window_type[i] == netatom[NetWMWindowTypeDialog]
|
|| wlr_xwayland_surface_has_window_type(surface, WLR_XWAYLAND_NET_WM_WINDOW_TYPE_SPLASH)
|
||||||
|| surface->window_type[i] == netatom[NetWMWindowTypeSplash]
|
|| wlr_xwayland_surface_has_window_type(surface, WLR_XWAYLAND_NET_WM_WINDOW_TYPE_TOOLBAR)
|
||||||
|| surface->window_type[i] == netatom[NetWMWindowTypeToolbar]
|
|| wlr_xwayland_surface_has_window_type(surface, WLR_XWAYLAND_NET_WM_WINDOW_TYPE_UTILITY)) {
|
||||||
|| surface->window_type[i] == netatom[NetWMWindowTypeUtility])
|
return 1;
|
||||||
return 1;
|
}
|
||||||
|
|
||||||
return size_hints && size_hints->min_width > 0 && size_hints->min_height > 0
|
return size_hints && size_hints->min_width > 0 && size_hints->min_height > 0
|
||||||
&& (size_hints->max_width == size_hints->min_width
|
&& (size_hints->max_width == size_hints->min_width
|
||||||
@ -267,8 +264,8 @@ client_is_stopped(Client *c)
|
|||||||
|
|
||||||
wl_client_get_credentials(c->surface.xdg->client->client, &pid, NULL, NULL);
|
wl_client_get_credentials(c->surface.xdg->client->client, &pid, NULL, NULL);
|
||||||
if (waitid(P_PID, pid, &in, WNOHANG|WCONTINUED|WSTOPPED|WNOWAIT) < 0) {
|
if (waitid(P_PID, pid, &in, WNOHANG|WCONTINUED|WSTOPPED|WNOWAIT) < 0) {
|
||||||
/* This process is not our child process, while is very unluckely that
|
/* This process is not our child process, while is very unlikely that
|
||||||
* it is stopped, in order to do not skip frames assume that it is. */
|
* it is stopped, in order to do not skip frames, assume that it is. */
|
||||||
if (errno == ECHILD)
|
if (errno == ECHILD)
|
||||||
return 1;
|
return 1;
|
||||||
} else if (in.si_pid) {
|
} else if (in.si_pid) {
|
||||||
@ -301,17 +298,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)
|
||||||
{
|
{
|
||||||
@ -344,13 +330,20 @@ 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)
|
||||||
{
|
{
|
||||||
#ifdef XWAYLAND
|
#ifdef XWAYLAND
|
||||||
if (client_is_x11(c)) {
|
if (client_is_x11(c)) {
|
||||||
wlr_xwayland_surface_configure(c->surface.xwayland,
|
wlr_xwayland_surface_configure(c->surface.xwayland,
|
||||||
c->geom.x, c->geom.y, width, height);
|
c->geom.x + c->bw, c->geom.y + c->bw, width, height);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -364,8 +357,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) {
|
||||||
@ -391,8 +387,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;
|
||||||
}
|
}
|
||||||
|
|||||||
90
config.def.h
90
config.def.h
@ -7,12 +7,13 @@
|
|||||||
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 unsigned int snap = 32; /* snap pixel */
|
||||||
static const float rootcolor[] = COLOR(0x222222ff);
|
static const float rootcolor[] = COLOR(0x222222ff);
|
||||||
static const float bordercolor[] = COLOR(0x444444ff);
|
static const float bordercolor[] = COLOR(0x444444ff);
|
||||||
static const float focuscolor[] = COLOR(0x005577ff);
|
static const float focuscolor[] = COLOR(0x005577ff);
|
||||||
static const float urgentcolor[] = COLOR(0xff0000ff);
|
static const float urgentcolor[] = COLOR(0xff0000ff);
|
||||||
/* 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.0f, 0.0f, 0.0f, 1.0f}; /* You can also use glsl colors */
|
||||||
|
|
||||||
/* tagging - TAGCOUNT must be no greater than 31 */
|
/* tagging - TAGCOUNT must be no greater than 31 */
|
||||||
#define TAGCOUNT (9)
|
#define TAGCOUNT (9)
|
||||||
@ -22,9 +23,9 @@ static int log_level = WLR_ERROR;
|
|||||||
|
|
||||||
static const Rule rules[] = {
|
static const Rule rules[] = {
|
||||||
/* app_id title tags mask isfloating monitor */
|
/* app_id title tags mask isfloating monitor */
|
||||||
/* examples: */
|
|
||||||
{ "Gimp_EXAMPLE", NULL, 0, 1, -1 }, /* Start on currently visible tags floating, not tiled */
|
{ "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" */
|
{ "firefox_EXAMPLE", NULL, 1 << 8, 0, -1 }, /* Start on ONLY tag "9" */
|
||||||
|
/* default/example rule: can be changed but cannot be eliminated; at least one rule must exist */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* layout(s) */
|
/* layout(s) */
|
||||||
@ -36,14 +37,15 @@ static const Layout layouts[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* monitors */
|
/* monitors */
|
||||||
/* NOTE: ALWAYS add a fallback rule, even if you are completely sure it won't be used */
|
/* (x=-1, y=-1) is reserved as an "autoconfigure" monitor position indicator
|
||||||
|
* WARNING: negative values other than (-1, -1) cause problems with Xwayland clients due to
|
||||||
|
* https://gitlab.freedesktop.org/xorg/xserver/-/issues/899 */
|
||||||
static const MonitorRule monrules[] = {
|
static const MonitorRule monrules[] = {
|
||||||
/* name mfact nmaster scale layout rotate/reflect x y */
|
/* name mfact nmaster scale layout rotate/reflect x y
|
||||||
/* example of a HiDPI laptop monitor:
|
* example of a HiDPI laptop monitor:
|
||||||
{ "eDP-1", 0.5f, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
|
{ "eDP-1", 0.5f, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 }, */
|
||||||
*/
|
|
||||||
/* defaults */
|
|
||||||
{ NULL, 0.55f, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
|
{ NULL, 0.55f, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
|
||||||
|
/* default monitor rule: can be changed but cannot be eliminated; at least one monitor rule must exist */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* keyboard */
|
/* keyboard */
|
||||||
@ -115,44 +117,44 @@ static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TA
|
|||||||
|
|
||||||
/* commands */
|
/* commands */
|
||||||
static const char *termcmd[] = { "foot", NULL };
|
static const char *termcmd[] = { "foot", NULL };
|
||||||
static const char *menucmd[] = { "bemenu-run", NULL };
|
static const char *menucmd[] = { "wmenu-run", NULL };
|
||||||
|
|
||||||
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: 2 -> at, etc. */
|
||||||
/* modifier key function argument */
|
/* modifier key function argument */
|
||||||
{ MODKEY, XKB_KEY_p, spawn, {.v = menucmd} },
|
{ MODKEY, XKB_KEY_p, spawn, {.v = menucmd} },
|
||||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} },
|
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} },
|
||||||
{ 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, XKB_KEY_i, incnmaster, {.i = +1} },
|
{ MODKEY, XKB_KEY_i, incnmaster, {.i = +1} },
|
||||||
{ MODKEY, XKB_KEY_d, incnmaster, {.i = -1} },
|
{ MODKEY, XKB_KEY_d, incnmaster, {.i = -1} },
|
||||||
{ MODKEY, XKB_KEY_h, setmfact, {.f = -0.05f} },
|
{ MODKEY, XKB_KEY_h, setmfact, {.f = -0.05f} },
|
||||||
{ MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} },
|
{ MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} },
|
||||||
{ 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]} },
|
||||||
{ 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, 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_parenright, 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_less, tagmon, {.i = WLR_DIRECTION_LEFT} },
|
||||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_greater, tagmon, {.i = WLR_DIRECTION_RIGHT} },
|
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_greater, tagmon, {.i = WLR_DIRECTION_RIGHT} },
|
||||||
TAGKEYS( XKB_KEY_1, XKB_KEY_exclam, 0),
|
TAGKEYS( XKB_KEY_1, XKB_KEY_exclam, 0),
|
||||||
TAGKEYS( XKB_KEY_2, XKB_KEY_at, 1),
|
TAGKEYS( XKB_KEY_2, XKB_KEY_at, 1),
|
||||||
TAGKEYS( XKB_KEY_3, XKB_KEY_numbersign, 2),
|
TAGKEYS( XKB_KEY_3, XKB_KEY_numbersign, 2),
|
||||||
TAGKEYS( XKB_KEY_4, XKB_KEY_dollar, 3),
|
TAGKEYS( XKB_KEY_4, XKB_KEY_dollar, 3),
|
||||||
TAGKEYS( XKB_KEY_5, XKB_KEY_percent, 4),
|
TAGKEYS( XKB_KEY_5, XKB_KEY_percent, 4),
|
||||||
TAGKEYS( XKB_KEY_6, XKB_KEY_asciicircum, 5),
|
TAGKEYS( XKB_KEY_6, XKB_KEY_asciicircum, 5),
|
||||||
TAGKEYS( XKB_KEY_7, XKB_KEY_ampersand, 6),
|
TAGKEYS( XKB_KEY_7, XKB_KEY_ampersand, 6),
|
||||||
TAGKEYS( XKB_KEY_8, XKB_KEY_asterisk, 7),
|
TAGKEYS( XKB_KEY_8, XKB_KEY_asterisk, 7),
|
||||||
TAGKEYS( XKB_KEY_9, XKB_KEY_parenleft, 8),
|
TAGKEYS( XKB_KEY_9, XKB_KEY_parenleft, 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} },
|
||||||
|
|||||||
23
config.mk
23
config.mk
@ -1,4 +1,4 @@
|
|||||||
_VERSION = 0.5
|
_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,8 +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 installation
|
||||||
|
# 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
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|||||||
128
dwl.1
128
dwl.1
@ -37,7 +37,7 @@ starts a shell process running
|
|||||||
when starting.
|
when starting.
|
||||||
When stopping, it sends
|
When stopping, it sends
|
||||||
.Dv SIGTERM
|
.Dv SIGTERM
|
||||||
to the child process and waits for it to exit.
|
to the child process group and waits for it to exit.
|
||||||
.Pp
|
.Pp
|
||||||
Users are encouraged to customize
|
Users are encouraged to customize
|
||||||
.Nm
|
.Nm
|
||||||
@ -55,10 +55,10 @@ Move window to a single tag.
|
|||||||
Toggle tag for window.
|
Toggle tag for window.
|
||||||
.It Mod-p
|
.It Mod-p
|
||||||
Spawn
|
Spawn
|
||||||
.Nm bemenu-run .
|
.Xr wmenu-run 1 .
|
||||||
.It Mod-Shift-Return
|
.It Mod-Shift-Return
|
||||||
Spawn
|
Spawn
|
||||||
.Nm foot .
|
.Xr foot 1 .
|
||||||
.It Mod-[jk]
|
.It Mod-[jk]
|
||||||
Move focus down/up the stack.
|
Move focus down/up the stack.
|
||||||
.It Mod-[id]
|
.It Mod-[id]
|
||||||
@ -100,6 +100,114 @@ Quit
|
|||||||
.Nm .
|
.Nm .
|
||||||
.El
|
.El
|
||||||
These might differ depending on your keyboard layout.
|
These might differ depending on your keyboard layout.
|
||||||
|
.Ss Mouse commands
|
||||||
|
.Bl -tag -width 20n -offset indent -compact
|
||||||
|
.It Mod-Button1
|
||||||
|
Move focused window while dragging.
|
||||||
|
Tiled windows will be toggled to the floating state.
|
||||||
|
.It Mod-Button2
|
||||||
|
Toggle focused window between floating and tiled state.
|
||||||
|
.It Mod-Button3
|
||||||
|
Resize focused window while dragging.
|
||||||
|
Tiled windows will be toggled to the floating state.
|
||||||
|
.El
|
||||||
|
.Sh STATUS INFORMATION
|
||||||
|
.Nm
|
||||||
|
writes its status information to standard output.
|
||||||
|
If the
|
||||||
|
.Fl s
|
||||||
|
option is given, the status information is written to the standard input of the
|
||||||
|
child process instead.
|
||||||
|
.Pp
|
||||||
|
Said information has the following format:
|
||||||
|
.Bd -ragged -offset indent
|
||||||
|
.Ar <monitor>
|
||||||
|
.Ar <component>
|
||||||
|
.Ar <data>
|
||||||
|
.Ed
|
||||||
|
.Pp
|
||||||
|
.Bl -tag -width 11n -offset 0 -compact
|
||||||
|
.It Ar <monitor>
|
||||||
|
is the name given to the output.
|
||||||
|
.It Ar <component>
|
||||||
|
is one of (in order)
|
||||||
|
.Em title ,
|
||||||
|
.Em appid ,
|
||||||
|
.Em fullscreen ,
|
||||||
|
.Em floating ,
|
||||||
|
.Em selmon ,
|
||||||
|
.Em tags ,
|
||||||
|
.Em layout .
|
||||||
|
.It Ar <data>
|
||||||
|
changes depending on
|
||||||
|
.Ar <component> .
|
||||||
|
.Bl -tag -width 10n -compact
|
||||||
|
.It Em title
|
||||||
|
The title of the focused window on
|
||||||
|
.Ar <monitor>
|
||||||
|
or nothing if there is no focused window.
|
||||||
|
.It Em appid
|
||||||
|
The app_id of the focused window on
|
||||||
|
.Ar <monitor>
|
||||||
|
or nothing if there is no focused window.
|
||||||
|
.It Em fullscreen
|
||||||
|
Prints 1 if the focused window on
|
||||||
|
.Ar <monitor>
|
||||||
|
is in fullscreen state, otherwise prints 0. If there is no focused
|
||||||
|
window it prints nothing.
|
||||||
|
.It Em floating
|
||||||
|
Prints 1 if the focused window on
|
||||||
|
.Ar <monitor>
|
||||||
|
is in floating state, otherwise prints 0. If there is no focused
|
||||||
|
window it prints nothing.
|
||||||
|
.It Em selmon
|
||||||
|
Prints 1 if
|
||||||
|
.Ar <monitor>
|
||||||
|
is the selected monitor, otherwise prints 0.
|
||||||
|
.It Em tags
|
||||||
|
Prints four bitmasks in the following order:
|
||||||
|
.Bl -bullet -width 2n -compact
|
||||||
|
.It
|
||||||
|
Occupied tags of
|
||||||
|
.Ar <monitor> .
|
||||||
|
.It
|
||||||
|
Selected tags of
|
||||||
|
.Ar <monitor> .
|
||||||
|
.It
|
||||||
|
Tags of the focused window on
|
||||||
|
.Ar <monitor> .
|
||||||
|
.It
|
||||||
|
Tags where a window on
|
||||||
|
.Ar <monitor>
|
||||||
|
requested activation or has urgency hints.
|
||||||
|
.El
|
||||||
|
The bitmasks are 32-bit unsigned decimal integers.
|
||||||
|
.It Em layout
|
||||||
|
Prints the symbol of the current layout.
|
||||||
|
.El
|
||||||
|
.El
|
||||||
|
.Ss Examples
|
||||||
|
When there is a selected window:
|
||||||
|
.Bd -literal -offset indent
|
||||||
|
HDMI\-A\-1 title \(ti/source/repos/dwl > man \-l dwl.1
|
||||||
|
HDMI\-A\-1 appid footclient
|
||||||
|
HDMI\-A\-1 fullscreen 0
|
||||||
|
HDMI\-A\-1 floating 0
|
||||||
|
HDMI\-A\-1 selmon 1
|
||||||
|
HDMI\-A\-1 tags 271 4 4 0
|
||||||
|
HDMI\-A\-1 layout [T]
|
||||||
|
.Ed
|
||||||
|
.Pp
|
||||||
|
When there is no selected window:
|
||||||
|
.Bd -literal -offset indent
|
||||||
|
HDMI\-A\-1 title
|
||||||
|
HDMI\-A\-1 appid
|
||||||
|
HDMI\-A\-1 fullscreen
|
||||||
|
HDMI\-A\-1 floating
|
||||||
|
HDMI\-A\-1 selmon 1
|
||||||
|
HDMI\-A\-1 tags 271 512 0 0
|
||||||
|
HDMI\-A\-1 layout [T]
|
||||||
|
.Ed
|
||||||
.Sh ENVIRONMENT
|
.Sh ENVIRONMENT
|
||||||
These environment variables are used by
|
These environment variables are used by
|
||||||
.Nm :
|
.Nm :
|
||||||
@ -140,19 +248,11 @@ server.
|
|||||||
Start
|
Start
|
||||||
.Nm
|
.Nm
|
||||||
with s6 in the background:
|
with s6 in the background:
|
||||||
.Dl dwl -s 's6-svscan <&-'
|
.Dl dwl \-s \(aqs6\-svscan <&\-\(aq
|
||||||
.Sh SEE ALSO
|
.Sh SEE ALSO
|
||||||
.Xr foot 1 ,
|
|
||||||
.Xr bemenu 1 ,
|
|
||||||
.Xr dwm 1 ,
|
.Xr dwm 1 ,
|
||||||
|
.Xr foot 1 ,
|
||||||
|
.Xr wmenu 1 ,
|
||||||
.Xr xkeyboard-config 7
|
.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
|
.Sh BUGS
|
||||||
All of them.
|
All of them.
|
||||||
|
|||||||
128
protocols/wlr-output-power-management-unstable-v1.xml
Normal file
128
protocols/wlr-output-power-management-unstable-v1.xml
Normal file
@ -0,0 +1,128 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<protocol name="wlr_output_power_management_unstable_v1">
|
||||||
|
<copyright>
|
||||||
|
Copyright © 2019 Purism SPC
|
||||||
|
|
||||||
|
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 (including the next
|
||||||
|
paragraph) 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.
|
||||||
|
</copyright>
|
||||||
|
|
||||||
|
<description summary="Control power management modes of outputs">
|
||||||
|
This protocol allows clients to control power management modes
|
||||||
|
of outputs that are currently part of the compositor space. The
|
||||||
|
intent is to allow special clients like desktop shells to power
|
||||||
|
down outputs when the system is idle.
|
||||||
|
|
||||||
|
To modify outputs not currently part of the compositor space see
|
||||||
|
wlr-output-management.
|
||||||
|
|
||||||
|
Warning! The protocol described in this file is experimental and
|
||||||
|
backward incompatible changes may be made. Backward compatible changes
|
||||||
|
may be added together with the corresponding interface version bump.
|
||||||
|
Backward incompatible changes are done by bumping the version number in
|
||||||
|
the protocol and interface names and resetting the interface version.
|
||||||
|
Once the protocol is to be declared stable, the 'z' prefix and the
|
||||||
|
version number in the protocol and interface names are removed and the
|
||||||
|
interface version number is reset.
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<interface name="zwlr_output_power_manager_v1" version="1">
|
||||||
|
<description summary="manager to create per-output power management">
|
||||||
|
This interface is a manager that allows creating per-output power
|
||||||
|
management mode controls.
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<request name="get_output_power">
|
||||||
|
<description summary="get a power management for an output">
|
||||||
|
Create a output power management mode control that can be used to
|
||||||
|
adjust the power management mode for a given output.
|
||||||
|
</description>
|
||||||
|
<arg name="id" type="new_id" interface="zwlr_output_power_v1"/>
|
||||||
|
<arg name="output" type="object" interface="wl_output"/>
|
||||||
|
</request>
|
||||||
|
|
||||||
|
<request name="destroy" type="destructor">
|
||||||
|
<description summary="destroy the manager">
|
||||||
|
All objects created by the manager will still remain valid, until their
|
||||||
|
appropriate destroy request has been called.
|
||||||
|
</description>
|
||||||
|
</request>
|
||||||
|
</interface>
|
||||||
|
|
||||||
|
<interface name="zwlr_output_power_v1" version="1">
|
||||||
|
<description summary="adjust power management mode for an output">
|
||||||
|
This object offers requests to set the power management mode of
|
||||||
|
an output.
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<enum name="mode">
|
||||||
|
<entry name="off" value="0"
|
||||||
|
summary="Output is turned off."/>
|
||||||
|
<entry name="on" value="1"
|
||||||
|
summary="Output is turned on, no power saving"/>
|
||||||
|
</enum>
|
||||||
|
|
||||||
|
<enum name="error">
|
||||||
|
<entry name="invalid_mode" value="1" summary="inexistent power save mode"/>
|
||||||
|
</enum>
|
||||||
|
|
||||||
|
<request name="set_mode">
|
||||||
|
<description summary="Set an outputs power save mode">
|
||||||
|
Set an output's power save mode to the given mode. The mode change
|
||||||
|
is effective immediately. If the output does not support the given
|
||||||
|
mode a failed event is sent.
|
||||||
|
</description>
|
||||||
|
<arg name="mode" type="uint" enum="mode" summary="the power save mode to set"/>
|
||||||
|
</request>
|
||||||
|
|
||||||
|
<event name="mode">
|
||||||
|
<description summary="Report a power management mode change">
|
||||||
|
Report the power management mode change of an output.
|
||||||
|
|
||||||
|
The mode event is sent after an output changed its power
|
||||||
|
management mode. The reason can be a client using set_mode or the
|
||||||
|
compositor deciding to change an output's mode.
|
||||||
|
This event is also sent immediately when the object is created
|
||||||
|
so the client is informed about the current power management mode.
|
||||||
|
</description>
|
||||||
|
<arg name="mode" type="uint" enum="mode"
|
||||||
|
summary="the output's new power management mode"/>
|
||||||
|
</event>
|
||||||
|
|
||||||
|
<event name="failed">
|
||||||
|
<description summary="object no longer valid">
|
||||||
|
This event indicates that the output power management mode control
|
||||||
|
is no longer valid. This can happen for a number of reasons,
|
||||||
|
including:
|
||||||
|
- The output doesn't support power management
|
||||||
|
- Another client already has exclusive power management mode control
|
||||||
|
for this output
|
||||||
|
- The output disappeared
|
||||||
|
|
||||||
|
Upon receiving this event, the client should destroy this object.
|
||||||
|
</description>
|
||||||
|
</event>
|
||||||
|
|
||||||
|
<request name="destroy" type="destructor">
|
||||||
|
<description summary="destroy this power management">
|
||||||
|
Destroys the output power management mode control object.
|
||||||
|
</description>
|
||||||
|
</request>
|
||||||
|
</interface>
|
||||||
|
</protocol>
|
||||||
16
util.c
16
util.c
@ -3,6 +3,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
@ -33,3 +34,18 @@ ecalloc(size_t nmemb, size_t size)
|
|||||||
die("calloc:");
|
die("calloc:");
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
fd_set_nonblock(int fd) {
|
||||||
|
int flags = fcntl(fd, F_GETFL);
|
||||||
|
if (flags < 0) {
|
||||||
|
perror("fcntl(F_GETFL):");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) < 0) {
|
||||||
|
perror("fcntl(F_SETFL):");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user