Compare commits
167 Commits
9bae793c9f
...
main
Author | SHA1 | Date | |
---|---|---|---|
59c087842b
|
|||
|
de57f6c315 | ||
735fa630db
|
|||
|
faa56cc9b9 | ||
ce98fe3b1f
|
|||
fb29a380e6
|
|||
|
4456f4536a | ||
|
e0f531d508 | ||
84282e5d68 | |||
|
aa69ed81b5 | ||
|
d1c2f43498 | ||
|
da13a95683 | ||
|
9a9f67db1c | ||
|
4e7e2999d4 | ||
|
0925fe956a | ||
|
26504f9a6f | ||
|
6f34a6d3a6 | ||
a65384b2a1 | |||
b751362b16 | |||
ea953a7269 | |||
c400f16ee0 | |||
|
30f5063474 | ||
|
1d08ade132 | ||
|
84245764e2 | ||
|
6ca87210d4 | ||
3ea25b64d6 | |||
|
002c7d2204 | ||
|
8206cc8889 | ||
|
54f207839f | ||
|
9c05b9622c | ||
2860b6f48b | |||
|
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 | ||
f9aafbd339 | |||
|
487abc28ba | ||
|
cd216908a7 | ||
e2177689c2 | |||
|
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 | ||
630efefd3a | |||
8c9a29b87e | |||
|
c2e7350f2e | ||
|
7570dc0a41 | ||
|
e5a57fb155 | ||
613ee6a3a6 | |||
9512cb560e | |||
|
57b5e41063 | ||
|
f4b6b429ec | ||
|
21205f2f40 | ||
|
8f6fca35d0 | ||
|
bca077b927 | ||
|
0047ff740a | ||
|
bf81a128ec | ||
854ab23102 | |||
6fa809d2f1 | |||
|
9825c26cdd | ||
|
34b7a57211 | ||
|
5c19e23146 | ||
|
3b1f0a8a88 | ||
|
bb73481662 | ||
cc8f7fb99c | |||
51b2f68ba5 | |||
460a6b8905 | |||
3db4baf24c | |||
cb828032c7 | |||
|
577d8da6d1 | ||
|
72e2ce8b00 | ||
|
dd00d994ce | ||
|
f7154d539d | ||
937623515a | |||
|
3a95d4ed03 | ||
2923b2be91 | |||
992411fa75 | |||
|
2b171fd501 | ||
|
ea33ce9ae6 | ||
|
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
|
||||||
|
51
Makefile
51
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-ipc-unstable-v2-protocol.o
|
dwl: dwl.o util.o dwl-ipc-unstable-v2-protocol.o
|
||||||
$(CC) dwl.o util.o dwl-ipc-unstable-v2-protocol.o $(LDLIBS) $(LDFLAGS) $(DWLCFLAGS) -o $@
|
$(CC) dwl.o util.o $(DWLCFLAGS) $(LDFLAGS) $(LDLIBS) dwl-ipc-unstable-v2-protocol.o -o $@
|
||||||
dwl.o: dwl.c config.mk config.h client.h cursor-shape-v1-protocol.h xdg-shell-protocol.h wlr-layer-shell-unstable-v1-protocol.h dwl-ipc-unstable-v2-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 dwl-ipc-unstable-v2-protocol.h
|
||||||
util.o: util.c util.h
|
util.o: util.c util.h
|
||||||
dwl-ipc-unstable-v2-protocol.o: dwl-ipc-unstable-v2-protocol.h
|
dwl-ipc-unstable-v2-protocol.o: dwl-ipc-unstable-v2-protocol.h
|
||||||
|
|
||||||
@@ -26,14 +31,8 @@ dwl-ipc-unstable-v2-protocol.o: dwl-ipc-unstable-v2-protocol.h
|
|||||||
WAYLAND_SCANNER = `$(PKG_CONFIG) --variable=wayland_scanner wayland-scanner`
|
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`
|
||||||
|
|
||||||
xdg-shell-protocol.h:
|
|
||||||
$(WAYLAND_SCANNER) server-header \
|
|
||||||
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
|
|
||||||
wlr-layer-shell-unstable-v1-protocol.h:
|
|
||||||
$(WAYLAND_SCANNER) server-header \
|
|
||||||
protocols/wlr-layer-shell-unstable-v1.xml $@
|
|
||||||
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 $@
|
||||||
dwl-ipc-unstable-v2-protocol.h:
|
dwl-ipc-unstable-v2-protocol.h:
|
||||||
$(WAYLAND_SCANNER) server-header \
|
$(WAYLAND_SCANNER) server-header \
|
||||||
@@ -41,6 +40,18 @@ dwl-ipc-unstable-v2-protocol.h:
|
|||||||
dwl-ipc-unstable-v2-protocol.c:
|
dwl-ipc-unstable-v2-protocol.c:
|
||||||
$(WAYLAND_SCANNER) private-code \
|
$(WAYLAND_SCANNER) private-code \
|
||||||
protocols/dwl-ipc-unstable-v2.xml $@
|
protocols/dwl-ipc-unstable-v2.xml $@
|
||||||
|
pointer-constraints-unstable-v1-protocol.h:
|
||||||
|
$(WAYLAND_SCANNER) enum-header \
|
||||||
|
$(WAYLAND_PROTOCOLS)/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml $@
|
||||||
|
wlr-layer-shell-unstable-v1-protocol.h:
|
||||||
|
$(WAYLAND_SCANNER) enum-header \
|
||||||
|
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:
|
||||||
|
$(WAYLAND_SCANNER) server-header \
|
||||||
|
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
|
||||||
|
|
||||||
config.h:
|
config.h:
|
||||||
cp config.def.h $@
|
cp config.def.h $@
|
||||||
@@ -49,14 +60,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
|
||||||
@@ -66,8 +78,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 $<
|
||||||
|
244
README.md
244
README.md
@@ -1,25 +1,137 @@
|
|||||||
# 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
|
||||||
|
|
||||||
|
## Getting Started:
|
||||||
|
|
||||||
|
### Latest semi-stable [release]
|
||||||
|
This is probably where you want to start. This builds against the [wlroots]
|
||||||
|
versions currently shipping in major distributions. If your
|
||||||
|
distribution's `wlroots` version is older, use an earlier dwl [release].
|
||||||
|
The `wlroots` version against which a given `dwl` release builds is specified
|
||||||
|
with each release on the [release] page
|
||||||
|
|
||||||
|
### Development branch [main]
|
||||||
|
Active development progresses on the `main` branch. The `main` branch is built
|
||||||
|
against a late (and often changing) git commit of wlroots. While the adventurous
|
||||||
|
are welcome to use `main`, it is a rocky road. Using `main` requires that the
|
||||||
|
user be willing to chase git commits of wlroots. Testing development pull
|
||||||
|
requests may involve merging unmerged pull requests in [wlroots]' git repository
|
||||||
|
and/or git commits of wayland.
|
||||||
|
|
||||||
|
### Building dwl
|
||||||
|
dwl has the following dependencies:
|
||||||
|
- libinput
|
||||||
|
- wayland
|
||||||
|
- wlroots (compiled with the libinput backend)
|
||||||
|
- xkbcommon
|
||||||
|
- wayland-protocols (compile-time only)
|
||||||
|
- pkg-config (compile-time only)
|
||||||
|
|
||||||
|
dwl has the following additional dependencies if XWayland support is enabled:
|
||||||
|
- libxcb
|
||||||
|
- 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`.
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
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
|
||||||
|
Wayland without restarting the entire display server, so any changes will take
|
||||||
|
effect the next time dwl is executed.
|
||||||
|
|
||||||
|
As in the dwm community, we encourage users to share patches they have
|
||||||
|
created. Check out the [dwl-patches] repository!
|
||||||
|
|
||||||
|
## Running dwl
|
||||||
|
|
||||||
|
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 as
|
||||||
|
directly from a VT console. Depending on your distro's setup, you may need to
|
||||||
|
add your user to the `video` and `input` groups before you can run dwl on a
|
||||||
|
VT. If you are using `elogind` or `systemd-logind` you need to install polkit;
|
||||||
|
otherwise you need to add yourself in the `seat` group and enable/start the
|
||||||
|
seatd daemon.
|
||||||
|
|
||||||
|
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
|
||||||
|
decoration initially; these are instead clients that can be run within the
|
||||||
|
Wayland session. Do note that the default background color is black. This can be
|
||||||
|
modified in `config.h`.
|
||||||
|
|
||||||
|
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
|
||||||
|
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
|
||||||
|
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
|
||||||
|
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
|
||||||
|
does not have the ability to affect the environment of dwl or of any processes
|
||||||
|
that it spawns. If you need to set environment variables that affect the entire
|
||||||
|
dwl session, these must be set prior to running dwl. For example, Wayland
|
||||||
|
requires a valid `XDG_RUNTIME_DIR`, which is usually set up by a session manager
|
||||||
|
such as `elogind` or `systemd-logind`. If your system doesn't do this
|
||||||
|
automatically, you will need to configure it prior to launching `dwl`, e.g.:
|
||||||
|
|
||||||
|
export XDG_RUNTIME_DIR=/tmp/xdg-runtime-$(id -u)
|
||||||
|
mkdir -p $XDG_RUNTIME_DIR
|
||||||
|
dwl
|
||||||
|
|
||||||
|
### Status information
|
||||||
|
|
||||||
|
Information about selected layouts, current window title, app-id, and
|
||||||
|
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
|
||||||
|
populate an external status bar with a script that parses the
|
||||||
|
information. Failing to read this information will cause dwl to block, so if you
|
||||||
|
do want to run a startup command that does not consume the status information,
|
||||||
|
you can close standard input with the `<&-` shell redirection, for example:
|
||||||
|
|
||||||
|
dwl -s 'foot --server <&-'
|
||||||
|
|
||||||
|
If your startup command is a shell script, you can achieve the same inside the
|
||||||
|
script with the line
|
||||||
|
|
||||||
|
exec <&-
|
||||||
|
|
||||||
|
To get a list of status bars that work with dwl consult our [wiki].
|
||||||
|
|
||||||
|
## Replacements for X applications
|
||||||
|
|
||||||
|
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
|
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
|
sticks to features which are necessary, simple, and straightforward to implement
|
||||||
given the base on which it is built. Implemented default features are:
|
given the base on which it is built. Implemented default features are:
|
||||||
|
|
||||||
- Any features provided by dwm/Xlib: simple window borders, tags, keybindings,
|
- Any features provided by dwm/Xlib: simple window borders, tags, keybindings,
|
||||||
client rules, mouse move/resize. Providing a built-in status bar is an
|
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
|
exception to this goal, to avoid dependencies on font rendering and/or drawing
|
||||||
drawing libraries when an external bar could work well.
|
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
|
- Idle-inhibit protocol which lets applications such as mpv disable idle
|
||||||
@@ -53,100 +165,6 @@ Feature *non-goals* for the main codebase include:
|
|||||||
be done through the compositor
|
be done through the compositor
|
||||||
- Animations and visual effects
|
- Animations and visual effects
|
||||||
|
|
||||||
## Building dwl
|
|
||||||
|
|
||||||
dwl has the following dependencies:
|
|
||||||
```
|
|
||||||
libinput
|
|
||||||
wayland
|
|
||||||
wlroots (compiled with the libinput backend)
|
|
||||||
xkbcommon
|
|
||||||
wayland-protocols (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
|
|
||||||
development packages) and run `make`. If you wish to build against a Git
|
|
||||||
version of wlroots, check out the [wlroots-next branch].
|
|
||||||
|
|
||||||
To enable XWayland, you should uncomment its flags in `config.mk`.
|
|
||||||
|
|
||||||
## Configuration
|
|
||||||
|
|
||||||
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
|
|
||||||
Wayland without restarting the entire display server, so any changes will take
|
|
||||||
effect the next time dwl is executed.
|
|
||||||
|
|
||||||
As in the dwm community, we encourage users to share patches they have created.
|
|
||||||
Check out the dwl [patches repository] and [patches wiki]!
|
|
||||||
|
|
||||||
## Running dwl
|
|
||||||
|
|
||||||
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
|
|
||||||
as directly from a VT console. Depending on your distro's setup, you may need
|
|
||||||
to add your user to the `video` and `input` groups before you can run dwl on
|
|
||||||
a VT. If you are using `elogind` or `systemd-logind` you need to install
|
|
||||||
polkit; otherwise you need to add yourself in the `seat` group and
|
|
||||||
enable/start the seatd daemon.
|
|
||||||
|
|
||||||
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
|
|
||||||
decoration initially; these are instead clients that can be run within
|
|
||||||
the Wayland session.
|
|
||||||
Do note that the background color is black.
|
|
||||||
|
|
||||||
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
|
|
||||||
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
|
|
||||||
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
|
|
||||||
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
|
|
||||||
does not have the ability to affect the environment of dwl or of any processes
|
|
||||||
that it spawns. If you need to set environment variables that affect the entire
|
|
||||||
dwl session, these must be set prior to running dwl. For example, Wayland
|
|
||||||
requires a valid `XDG_RUNTIME_DIR`, which is usually set up by a session manager
|
|
||||||
such as `elogind` or `systemd-logind`. If your system doesn't do this
|
|
||||||
automatically, you will need to configure it prior to launching `dwl`, e.g.:
|
|
||||||
|
|
||||||
export XDG_RUNTIME_DIR=/tmp/xdg-runtime-$(id -u)
|
|
||||||
mkdir -p $XDG_RUNTIME_DIR
|
|
||||||
dwl
|
|
||||||
|
|
||||||
### Status information
|
|
||||||
|
|
||||||
Information about selected layouts, current window title, app-id, and
|
|
||||||
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
|
|
||||||
populate an external status bar with a script that parses the information.
|
|
||||||
Failing to read this information will cause dwl to block, so if you do want to
|
|
||||||
run a startup command that does not consume the status information, you can
|
|
||||||
close standard input with the `<&-` shell redirection, for example:
|
|
||||||
|
|
||||||
dwl -s 'foot --server <&-'
|
|
||||||
|
|
||||||
If your startup command is a shell script, you can achieve the same inside the
|
|
||||||
script with the line
|
|
||||||
|
|
||||||
exec <&-
|
|
||||||
|
|
||||||
To get a list of status bars that work with dwl consult our [wiki].
|
|
||||||
|
|
||||||
## Replacements for X applications
|
|
||||||
|
|
||||||
You can find a [list of useful resources on our wiki].
|
|
||||||
|
|
||||||
## 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
|
||||||
@@ -164,18 +182,20 @@ 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
|
|
||||||
[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/
|
||||||
|
86
client.h
86
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) {
|
||||||
@@ -379,10 +375,8 @@ static inline void
|
|||||||
client_set_suspended(Client *c, int suspended)
|
client_set_suspended(Client *c, int suspended)
|
||||||
{
|
{
|
||||||
#ifdef XWAYLAND
|
#ifdef XWAYLAND
|
||||||
if (client_is_x11(c)) {
|
if (client_is_x11(c))
|
||||||
wlr_xwayland_surface_set_withdrawn(c->surface.xwayland, suspended);
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wlr_xdg_toplevel_set_suspended(c->surface.xdg->toplevel, suspended);
|
wlr_xdg_toplevel_set_suspended(c->surface.xdg->toplevel, suspended);
|
||||||
@@ -393,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;
|
||||||
}
|
}
|
||||||
|
19
config.def.h
19
config.def.h
@@ -11,7 +11,7 @@ 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);
|
||||||
/* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */
|
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
|
||||||
static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
|
static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
|
||||||
|
|
||||||
/* tagging - TAGCOUNT must be no greater than 31 */
|
/* tagging - TAGCOUNT must be no greater than 31 */
|
||||||
@@ -20,12 +20,12 @@ static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You ca
|
|||||||
/* logging */
|
/* logging */
|
||||||
static int log_level = WLR_ERROR;
|
static int log_level = WLR_ERROR;
|
||||||
|
|
||||||
|
/* NOTE: ALWAYS keep a rule declared even if you don't use rules (e.g leave at least one example) */
|
||||||
static const Rule rules[] = {
|
static const Rule rules[] = {
|
||||||
/* app_id title tags mask isfloating monitor */
|
/* app_id title tags mask isfloating monitor */
|
||||||
/* examples:
|
/* examples: */
|
||||||
{ "Gimp", NULL, 0, 1, -1 },
|
{ "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", NULL, 1 << 8, 0, -1 },
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* layout(s) */
|
/* layout(s) */
|
||||||
@@ -37,6 +37,10 @@ static const Layout layouts[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* monitors */
|
/* monitors */
|
||||||
|
/* (x=-1, y=-1) is reserved as an "autoconfigure" monitor position indicator
|
||||||
|
* WARNING: negative values other than (-1, -1) cause problems with Xwayland clients
|
||||||
|
* https://gitlab.freedesktop.org/xorg/xserver/-/issues/899
|
||||||
|
*/
|
||||||
/* NOTE: ALWAYS add a fallback rule, even if you are completely sure it won't be used */
|
/* NOTE: ALWAYS add a fallback rule, even if you are completely sure it won't be used */
|
||||||
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 */
|
||||||
@@ -95,6 +99,7 @@ LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE
|
|||||||
*/
|
*/
|
||||||
static const enum libinput_config_accel_profile accel_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE;
|
static const enum libinput_config_accel_profile accel_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE;
|
||||||
static const double accel_speed = 0.0;
|
static const double accel_speed = 0.0;
|
||||||
|
|
||||||
/* You can choose between:
|
/* You can choose between:
|
||||||
LIBINPUT_CONFIG_TAP_MAP_LRM -- 1/2/3 finger tap maps to left/right/middle
|
LIBINPUT_CONFIG_TAP_MAP_LRM -- 1/2/3 finger tap maps to left/right/middle
|
||||||
LIBINPUT_CONFIG_TAP_MAP_LMR -- 1/2/3 finger tap maps to left/middle/right
|
LIBINPUT_CONFIG_TAP_MAP_LMR -- 1/2/3 finger tap maps to left/middle/right
|
||||||
@@ -115,7 +120,7 @@ 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: c -> C, 2 -> at, etc. */
|
||||||
|
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
|
||||||
|
220
config.mma.def.h
220
config.mma.def.h
@@ -4,20 +4,24 @@
|
|||||||
((hex >> 8) & 0xFF) / 255.0f, \
|
((hex >> 8) & 0xFF) / 255.0f, \
|
||||||
(hex & 0xFF) / 255.0f }
|
(hex & 0xFF) / 255.0f }
|
||||||
/* appearance */
|
/* appearance */
|
||||||
static const int sloppyfocus = 0; /* focus follows mouse */
|
static const int sloppyfocus = 0; /* 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 = 10; /* border pixel of windows */
|
static const unsigned int borderpx = 10; /* border pixel of windows */
|
||||||
static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
|
static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
|
||||||
static const float rootcolor[] = COLOR(0x4d4d4d66);
|
static const float rootcolor[] = COLOR(0x4d4d4d66);
|
||||||
static const float bordercolor[] = COLOR(0x00000000);
|
static const float bordercolor[] = COLOR(0x00000000);
|
||||||
static const float focuscolor[] = COLOR(0x12121212);
|
static const float focuscolor[] = COLOR(0x12121212);
|
||||||
static const float urgentcolor[] = COLOR(0xff0000ff);
|
static const float urgentcolor[] = COLOR(0xff0000ff);
|
||||||
/* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */
|
/* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */
|
||||||
static const float fullscreen_bg[] = COLOR(0x121212ff);
|
static const float fullscreen_bg[] = COLOR(0x121212ff);
|
||||||
|
|
||||||
/* tagging - TAGCOUNT must be no greater than 31 */
|
/* tagging - TAGCOUNT must be no greater than 31 */
|
||||||
#define TAGCOUNT (9)
|
#define TAGCOUNT (9)
|
||||||
|
|
||||||
|
/* control variables */
|
||||||
|
static int cfg_disable_touchpad = 1;
|
||||||
|
static const char *cfg_touchpad_device_str = "Synaptic";
|
||||||
|
|
||||||
/* logging */
|
/* logging */
|
||||||
static int log_level = WLR_ERROR;
|
static int log_level = WLR_ERROR;
|
||||||
|
|
||||||
@@ -50,11 +54,12 @@ static const MonitorRule monrules[] = {
|
|||||||
|
|
||||||
/* keyboard */
|
/* keyboard */
|
||||||
static const struct xkb_rule_names xkb_rules = {
|
static const struct xkb_rule_names xkb_rules = {
|
||||||
/* can specify fields: rules, model, layout, variant, options */
|
/* can specify fields: rules, model, layout, variant, options
|
||||||
|
* Base rules in /usr/share/X11/xkb/rules/base.lst */
|
||||||
/* example:
|
/* example:
|
||||||
.options = "ctrl:nocaps",
|
.options = "ctrl:nocaps",
|
||||||
*/
|
*/
|
||||||
.options = NULL,
|
.options = "caps:escape,compose:rctrl",
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int repeat_rate = 25;
|
static const int repeat_rate = 25;
|
||||||
@@ -103,94 +108,141 @@ LIBINPUT_CONFIG_TAP_MAP_LMR -- 1/2/3 finger tap maps to left/middle/right
|
|||||||
static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TAP_MAP_LRM;
|
static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TAP_MAP_LRM;
|
||||||
|
|
||||||
/* If you want to use the windows key for MODKEY, use WLR_MODIFIER_LOGO */
|
/* If you want to use the windows key for MODKEY, use WLR_MODIFIER_LOGO */
|
||||||
#define MODKEY WLR_MODIFIER_LOGO
|
/* #define MODKEY WLR_MODIFIER_LOGO */
|
||||||
|
#define MODKEY WLR_MODIFIER_ALT
|
||||||
#define TAGKEYS(KEY,SKEY,TAG) \
|
#define TAGKEYS(KEY,SKEY,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, SKEY, tag, {.ui = 1 << TAG} }, \
|
||||||
{ MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT,SKEY,toggletag, {.ui = 1 << TAG} }
|
{ MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT,SKEY,toggletag, {.ui = 1 << TAG} }
|
||||||
|
|
||||||
|
#define AD_STR(a) #a
|
||||||
|
#define AD_CONCAT(a, b) AD_STR(a ## b)
|
||||||
|
#define ACTKEYS_DECL(FUNCP) \
|
||||||
|
static const char *key_cmd_ ## FUNCP[] = { "dwl_act", #FUNCP, NULL }; \
|
||||||
|
static const char *key_cmd_S_ ## FUNCP[] = { "dwl_act", AD_CONCAT(S_,FUNCP), NULL }; \
|
||||||
|
static const char *key_cmd_C_ ## FUNCP[] = { "dwl_act", AD_CONCAT(C_,FUNCP), NULL }; \
|
||||||
|
static const char *key_cmd_SC_ ## FUNCP[] = { "dwl_act", AD_CONCAT(SC_,FUNCP), NULL }
|
||||||
|
|
||||||
|
#define ACTKEYS_MAP(KEY,FUNCP) \
|
||||||
|
{ 0, KEY, spawn, {.v = key_cmd_ ## FUNCP} }, \
|
||||||
|
{ WLR_MODIFIER_CTRL, KEY, spawn, {.v = key_cmd_C_ ## FUNCP} }, \
|
||||||
|
{ WLR_MODIFIER_SHIFT, KEY, spawn, {.v = key_cmd_S_ ## FUNCP} }, \
|
||||||
|
{ WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT, KEY, spawn, {.v = key_cmd_SC_ ## FUNCP} }
|
||||||
|
|
||||||
/* 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 } }
|
||||||
|
|
||||||
/* commands */
|
/* commands */
|
||||||
static const char *webcmd[] = { "dwl_web", NULL };
|
static const char *webcmd[] = { "dwl_web", NULL };
|
||||||
static const char *mailcmd[] = { "dwl_email", NULL };
|
static const char *mailcmd[] = { "dwl_email", NULL };
|
||||||
static const char *termcmd[] = { "dwl_term", NULL };
|
static const char *termcmd[] = { "dwl_term", NULL };
|
||||||
static const char *alttermcmd[] = { "dwl_alt_term", NULL };
|
static const char *alttermcmd[] = { "dwl_alt_term", NULL };
|
||||||
static const char *launchcmd[] = { "dwl_dmenu", NULL };
|
static const char *launchcmd[] = { "dwl_dmenu", NULL };
|
||||||
static const char *dispcmd[] = { "wdisplays", NULL };
|
static const char *dispcmd[] = { "wdisplays", NULL };
|
||||||
static const char *lockcmd[] = { "swaylock", NULL };
|
static const char *lockcmd[] = { "swaylock", NULL };
|
||||||
|
|
||||||
/* Function key commands */
|
/* Function key commands */
|
||||||
static const char *key_cmd_vol_mute[] = { "dwl_act", "vol_mute", NULL };
|
ACTKEYS_DECL(vol_mute);
|
||||||
static const char *key_cmd_vol_lower[] = { "dwl_act", "vol_lower", NULL };
|
ACTKEYS_DECL(vol_lower);
|
||||||
static const char *key_cmd_vol_raise[] = { "dwl_act", "vol_raise", NULL };
|
ACTKEYS_DECL(vol_raise);
|
||||||
static const char *key_cmd_mic_mute[] = { "dwl_act", "mic_mute", NULL };
|
ACTKEYS_DECL(mic_mute);
|
||||||
static const char *key_cmd_bright_low[] = { "dwl_act", "bright_low", NULL };
|
ACTKEYS_DECL(bright_low);
|
||||||
static const char *key_cmd_bright_high[] = { "dwl_act", "bright_high", NULL };
|
ACTKEYS_DECL(bright_high);
|
||||||
static const char *key_cmd_disp[] = { "dwl_act", "disp", NULL };
|
ACTKEYS_DECL(disp);
|
||||||
static const char *key_cmd_wlan[] = { "dwl_act", "wlan", NULL };
|
ACTKEYS_DECL(wlan);
|
||||||
static const char *key_cmd_tools[] = { "dwl_act", "tools", NULL };
|
ACTKEYS_DECL(webcam);
|
||||||
static const char *key_cmd_search[] = { "dwl_act", "search", NULL };
|
ACTKEYS_DECL(tools);
|
||||||
static const char *key_cmd_launch[] = { "dwl_act", "launch", NULL };
|
ACTKEYS_DECL(search);
|
||||||
static const char *key_cmd_explore[] = { "dwl_act", "explore", NULL };
|
ACTKEYS_DECL(launch);
|
||||||
|
ACTKEYS_DECL(explore);
|
||||||
|
ACTKEYS_DECL(print);
|
||||||
|
ACTKEYS_DECL(media_toggle);
|
||||||
|
ACTKEYS_DECL(media_stop);
|
||||||
|
ACTKEYS_DECL(media_prev);
|
||||||
|
ACTKEYS_DECL(media_next);
|
||||||
|
|
||||||
static const Key keys[] = {
|
static const Key keys[] = {
|
||||||
/* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */
|
/* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */
|
||||||
/* modifier key function argument */
|
/* modifier key function argument */
|
||||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} },
|
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} },
|
||||||
{ MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = alttermcmd} },
|
{ MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT,
|
||||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_P, spawn, {.v = launchcmd} },
|
XKB_KEY_Return, spawn, {.v = alttermcmd} },
|
||||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_N, spawn, {.v = dispcmd} },
|
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_P, spawn, {.v = launchcmd} },
|
||||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_W, spawn, {.v = webcmd} },
|
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_N, spawn, {.v = dispcmd} },
|
||||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_E, spawn, {.v = mailcmd} },
|
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_W, spawn, {.v = webcmd} },
|
||||||
{ MODKEY, XKB_KEY_b, togglebar, {0}},
|
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_E, spawn, {.v = mailcmd} },
|
||||||
{ MODKEY, XKB_KEY_j, focusstack, {.i = +1} },
|
{ MODKEY, XKB_KEY_b, togglebar, {0}},
|
||||||
{ MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
|
{ MODKEY, XKB_KEY_j, focusstack, {.i = +1} },
|
||||||
{ MODKEY, XKB_KEY_i, incnmaster, {.i = +1} },
|
{ MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
|
||||||
{ MODKEY, XKB_KEY_d, incnmaster, {.i = -1} },
|
{ MODKEY, XKB_KEY_i, incnmaster, {.i = +1} },
|
||||||
{ MODKEY, XKB_KEY_h, setmfact, {.f = -0.05f} },
|
{ MODKEY, XKB_KEY_d, incnmaster, {.i = -1} },
|
||||||
{ MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} },
|
{ MODKEY, XKB_KEY_h, setmfact, {.f = -0.05f} },
|
||||||
{ MODKEY, XKB_KEY_Return, zoom, {0} },
|
{ MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} },
|
||||||
{ MODKEY, XKB_KEY_Tab, view, {0} },
|
{ MODKEY, XKB_KEY_Return, zoom, {0} },
|
||||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, killclient, {0} },
|
{ MODKEY, XKB_KEY_Tab, view, {0} },
|
||||||
{ MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
|
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, killclient, {0} },
|
||||||
{ MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
|
{ MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
|
||||||
{ MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
|
{ MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
|
||||||
{ MODKEY, XKB_KEY_space, setlayout, {0} },
|
{ MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
|
||||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
|
{ MODKEY, XKB_KEY_space, setlayout, {0} },
|
||||||
{ MODKEY, XKB_KEY_e, togglefullscreen, {0} },
|
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
|
||||||
{ MODKEY, XKB_KEY_0, view, {.ui = ~0} },
|
{ MODKEY, XKB_KEY_e, togglefullscreen,
|
||||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} },
|
{0} },
|
||||||
{ MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} },
|
{ MODKEY, XKB_KEY_0, view, {.ui = ~0} },
|
||||||
{ MODKEY, XKB_KEY_period, focusmon, {.i = WLR_DIRECTION_RIGHT} },
|
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} },
|
||||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_less, tagmon, {.i = WLR_DIRECTION_LEFT} },
|
{ MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} },
|
||||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_greater, tagmon, {.i = WLR_DIRECTION_RIGHT} },
|
{ MODKEY, XKB_KEY_period, focusmon, {.i = WLR_DIRECTION_RIGHT} },
|
||||||
TAGKEYS( XKB_KEY_1, XKB_KEY_exclam, 0),
|
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_less, tagmon, {.i = WLR_DIRECTION_LEFT} },
|
||||||
TAGKEYS( XKB_KEY_2, XKB_KEY_at, 1),
|
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_greater, tagmon, {.i = WLR_DIRECTION_RIGHT} },
|
||||||
TAGKEYS( XKB_KEY_3, XKB_KEY_numbersign, 2),
|
{ MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT, XKB_KEY_Q, quit, {0} },
|
||||||
TAGKEYS( XKB_KEY_4, XKB_KEY_dollar, 3),
|
{ MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT, XKB_KEY_L, spawn, {.v = lockcmd} },
|
||||||
TAGKEYS( XKB_KEY_5, XKB_KEY_percent, 4),
|
{ WLR_MODIFIER_LOGO, XKB_KEY_l, spawn, {.v = lockcmd } },
|
||||||
TAGKEYS( XKB_KEY_6, XKB_KEY_asciicircum, 5),
|
{ WLR_MODIFIER_LOGO, XKB_KEY_p, spawn, {.v = key_cmd_disp } },
|
||||||
TAGKEYS( XKB_KEY_7, XKB_KEY_ampersand, 6),
|
|
||||||
TAGKEYS( XKB_KEY_8, XKB_KEY_asterisk, 7),
|
|
||||||
TAGKEYS( XKB_KEY_9, XKB_KEY_parenleft, 8),
|
|
||||||
{ MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT, XKB_KEY_Q, quit, {0} },
|
|
||||||
{ MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT, XKB_KEY_L, spawn, {.v = lockcmd} },
|
|
||||||
{ 0 , XKB_KEY_XF86AudioMute, spawn, {.v = key_cmd_vol_mute }},
|
|
||||||
{ 0 , XKB_KEY_XF86AudioLowerVolume, spawn, {.v = key_cmd_vol_lower }},
|
|
||||||
{ 0 , XKB_KEY_XF86AudioRaiseVolume, spawn, {.v = key_cmd_vol_raise }},
|
|
||||||
{ 0 , XKB_KEY_XF86AudioMicMute, spawn, {.v = key_cmd_mic_mute }},
|
|
||||||
{ 0 , XKB_KEY_XF86MonBrightnessDown, spawn, {.v = key_cmd_bright_low }},
|
|
||||||
{ 0 , XKB_KEY_XF86MonBrightnessUp, spawn, {.v = key_cmd_bright_high }},
|
|
||||||
{ 0 , XKB_KEY_XF86Display, spawn, {.v = key_cmd_disp }},
|
|
||||||
{ 0 , XKB_KEY_XF86WLAN, spawn, {.v = key_cmd_wlan }},
|
|
||||||
{ 0 , XKB_KEY_XF86Tools, spawn, {.v = key_cmd_tools }},
|
|
||||||
{ 0 , XKB_KEY_XF86Search, spawn, {.v = key_cmd_search }},
|
|
||||||
{ 0 , XKB_KEY_XF86LaunchA, spawn, {.v = key_cmd_launch }},
|
|
||||||
{ 0 , XKB_KEY_XF86Explorer, spawn, {.v = key_cmd_explore }},
|
|
||||||
/* 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} },
|
||||||
|
|
||||||
|
/* Media control keys without device specific action buttons */
|
||||||
|
{ WLR_MODIFIER_LOGO, XKB_KEY_space, spawn, {.v = key_cmd_media_toggle } },
|
||||||
|
{ WLR_MODIFIER_LOGO, XKB_KEY_s, spawn, {.v = key_cmd_media_stop } },
|
||||||
|
{ WLR_MODIFIER_LOGO, XKB_KEY_period, spawn, {.v = key_cmd_media_next } },
|
||||||
|
{ WLR_MODIFIER_LOGO, XKB_KEY_comma, spawn, {.v = key_cmd_media_prev } },
|
||||||
|
{ WLR_MODIFIER_LOGO, XKB_KEY_a, spawn, {.v = key_cmd_vol_mute } },
|
||||||
|
{ WLR_MODIFIER_LOGO, XKB_KEY_z, spawn, {.v = key_cmd_vol_lower } },
|
||||||
|
{ WLR_MODIFIER_LOGO, XKB_KEY_q, spawn, {.v = key_cmd_vol_raise } },
|
||||||
|
|
||||||
|
/* Action buttons */
|
||||||
|
ACTKEYS_MAP(XKB_KEY_XF86AudioMute, vol_mute),
|
||||||
|
ACTKEYS_MAP(XKB_KEY_XF86AudioLowerVolume, vol_lower),
|
||||||
|
ACTKEYS_MAP(XKB_KEY_XF86AudioRaiseVolume, vol_raise),
|
||||||
|
ACTKEYS_MAP(XKB_KEY_XF86AudioMicMute, mic_mute),
|
||||||
|
ACTKEYS_MAP(XKB_KEY_XF86MonBrightnessDown, bright_low),
|
||||||
|
ACTKEYS_MAP(XKB_KEY_XF86MonBrightnessUp, bright_high),
|
||||||
|
ACTKEYS_MAP(XKB_KEY_XF86Display, disp),
|
||||||
|
ACTKEYS_MAP(XKB_KEY_XF86WLAN, wlan),
|
||||||
|
ACTKEYS_MAP(XKB_KEY_XF86WebCam, webcam),
|
||||||
|
ACTKEYS_MAP(XKB_KEY_XF86Tools, tools),
|
||||||
|
ACTKEYS_MAP(XKB_KEY_XF86Search, search),
|
||||||
|
ACTKEYS_MAP(XKB_KEY_XF86LaunchA, launch),
|
||||||
|
ACTKEYS_MAP(XKB_KEY_XF86Explorer, explore),
|
||||||
|
ACTKEYS_MAP(XKB_KEY_Print, print),
|
||||||
|
ACTKEYS_MAP(XKB_KEY_XF86AudioPlay, media_toggle),
|
||||||
|
ACTKEYS_MAP(XKB_KEY_XF86AudioStop, media_stop),
|
||||||
|
ACTKEYS_MAP(XKB_KEY_XF86AudioPrev, media_prev),
|
||||||
|
ACTKEYS_MAP(XKB_KEY_XF86AudioNext, media_next),
|
||||||
|
/* { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, toggle_touch_input_device,
|
||||||
|
{0} },*/
|
||||||
|
TAGKEYS( XKB_KEY_1, XKB_KEY_exclam, 0),
|
||||||
|
TAGKEYS( XKB_KEY_2, XKB_KEY_at, 1),
|
||||||
|
TAGKEYS( XKB_KEY_3, XKB_KEY_numbersign, 2),
|
||||||
|
TAGKEYS( XKB_KEY_4, XKB_KEY_dollar, 3),
|
||||||
|
TAGKEYS( XKB_KEY_5, XKB_KEY_percent, 4),
|
||||||
|
TAGKEYS( XKB_KEY_6, XKB_KEY_asciicircum, 5),
|
||||||
|
TAGKEYS( XKB_KEY_7, XKB_KEY_ampersand, 6),
|
||||||
|
TAGKEYS( XKB_KEY_8, XKB_KEY_asterisk, 7),
|
||||||
|
TAGKEYS( XKB_KEY_9, XKB_KEY_parenleft, 8),
|
||||||
|
|
||||||
/* Ctrl-Alt-Fx is used to switch to another VT, if you don't know what a VT is
|
/* Ctrl-Alt-Fx is used to switch to another VT, if you don't know what a VT is
|
||||||
* do not remove them.
|
* do not remove them.
|
||||||
*/
|
*/
|
||||||
|
6
dwl.1
6
dwl.1
@@ -55,7 +55,7 @@ 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 .
|
.Nm wmenu-run .
|
||||||
.It Mod-Shift-Return
|
.It Mod-Shift-Return
|
||||||
Spawn
|
Spawn
|
||||||
.Nm foot .
|
.Nm foot .
|
||||||
@@ -140,10 +140,10 @@ 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 foot 1 ,
|
||||||
.Xr bemenu 1 ,
|
.Xr wmenu 1 ,
|
||||||
.Xr dwm 1 ,
|
.Xr dwm 1 ,
|
||||||
.Xr xkeyboard-config 7
|
.Xr xkeyboard-config 7
|
||||||
.Sh CAVEATS
|
.Sh CAVEATS
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user