13 Commits

Author SHA1 Message Date
Silvan Jegen f9bedb7908 dwl: don't show input popup if client is not enabled
We link clients and their input popups which lets us disable the popups'
scene nodes in case the associated client's scene is not enabled on a tag.
2022-06-26 14:04:34 +02:00
Silvan Jegen a92504d8bf dwl: don't destroy popup scene on unmap
Instead we disable it and destroy it at destroy time.
2022-06-26 13:48:59 +02:00
Silvan Jegen 5493e0bbf2 dwl: use a dedicated layer for input popups
Otherwise we seem to have conflicts with other floating clients.
2022-06-12 14:50:47 +02:00
Silvan Jegen f342b7d412 Merge branch 'main' into input-protocols-v2-before-merge 2022-06-06 13:12:27 +02:00
Silvan Jegen cc9f4a3dc4 Remove now unused input_popup lists 2022-05-22 15:35:13 +02:00
Silvan Jegen 8841d17ec8 Use the LISTEN macro everywhere 2022-05-22 14:59:27 +02:00
Silvan Jegen 491fa291fa Free input_relay 2022-05-22 14:18:06 +02:00
Silvan Jegen 561acf650a Fix whitespace issue 2022-05-22 14:08:53 +02:00
Silvan Jegen fe8280bf39 Remove now unneeded render_data struct definition 2022-05-22 14:06:54 +02:00
Silvan Jegen fbd698479a Fix imports 2022-05-22 14:06:22 +02:00
Silvan Jegen ac1aef7ead implement input method keyboard grab 2022-05-15 16:06:46 +02:00
Silvan Jegen 27bf627a97 implement input popup rendering
Based on https://github.com/swaywm/sway/pull/5890
2022-05-15 16:06:46 +02:00
Silvan Jegen c86f2f73fd implement text-input and input-method protocol support
This is mostly copied from the sway implementation here:

https://github.com/swaywm/sway/pull/4740/files
2022-05-15 15:54:02 +02:00
16 changed files with 1897 additions and 2088 deletions
-62
View File
@@ -1,62 +0,0 @@
name: Bug Report
about: Something in dwl isn't working correctly
title:
labels:
- 'Kind/Bug'
body:
- type: markdown
attributes:
value: |
- Only report bugs that can be reproduced on the main (or wlroots-next) branch without patches.
- Proprietary graphics drivers, including nvidia, are not supported. Please use the open source equivalents, such as nouveau, if you would like to use dwl.
- Report patch issues to their respective authors.
- type: input
id: dwl_version
attributes:
label: 'dwl version:'
placeholder: '`dwl -v`'
validations:
required: true
- type: input
id: wlroots_version
attributes:
label: 'wlroots version:'
validations:
required: true
- type: input
id: distro
attributes:
label: What distro (and version) are you using?
validations:
required: false
- type: textarea
attributes:
label: Description
value: |
The steps you took to reproduce the problem.
validations:
required: false
- type: textarea
id: debug_log
attributes:
label: Debug Log
value: |
Run `dwl -d 2> ~/dwl.log` from a TTY and attach the **full** (do not truncate it) file here, or upload it to a pastebin.
Please try to keep the reproduction as brief as possible and exit dwl.
validations:
required: false
- type: textarea
id: backtrace
attributes:
label: Stack Trace
value: |
- Only required if dwl crashes.
- If the lines mentioning dwl or wlroots have `??`. Please compile both dwl and wlroots from source (enabling debug symbols) and try to reproduce.
validations:
required: false
@@ -1,9 +0,0 @@
name: Enhancement idea
about: Suggest a feature or improvement
title:
labels:
- 'Kind/Feature'
body:
- type: textarea
attributes:
label: Description
+22
View File
@@ -0,0 +1,22 @@
---
name: Bug report
about: Something in dwl isn't working correctly
title: ''
labels: 'A: bug'
assignees: ''
---
## Info
dwl's commit:
wlroots version:
## Description
<!--
Only report bugs that can be reproduced on the main line
Report patch issues to their respective authors
If the patch author doesn't respond within a reasonable time, email me:
Leonardo Hernández Hernández <leohdz172@protonmail.com>
but note that I'm NOT making any promises
-->
@@ -0,0 +1,10 @@
---
name: Enhancement idea
about: Suggest a feature or improvement
title: ''
labels: 'A: enhancement'
assignees: ''
---
-110
View File
@@ -1,110 +0,0 @@
# Changelog
* [Unreleased](#unreleased)
* [0.5](#0.5)
## Unreleased
### Added
### Changed
### Deprecated
### Removed
### Fixed
### Security
### Contributors
## 0.5
### Added
* Allow configure x and y position of outputs ([#301][301])
* Implement repeatable keybindings ([#368][368])
* Print app id in printstatus() output ([#381][381])
* Display client count in monocle symbol ([#387][387])
* Export XCURSOR_SIZE to fix apps using an older version of Qt ([#425][425])
* Support for wp-fractional-scale-v1 (through wlr_scene: [wlroots!3511][wlroots!3511])
* dwl now sends `wl_surface.preferred_buffer_scale` (through wlr_scene: [wlroots!4269][wlroots!4269])
* Add support for xdg-shell v6 ([#465][465])
* Add support for wp-cursor-shape-v1 ([#444][444])
* Add desktop file ([#484][484])
* Add macro to easily configure colors ([#466][466])
* Color of urgent clients are now red ([#494][494])
* New flag `-d` and option `log_level` to change the wlroots debug level
* Add CHANGELOG.md ([#501][501])
[301]: https://github.com/djpohly/dwl/pull/301
[368]: https://github.com/djpohly/dwl/pull/368
[381]: https://github.com/djpohly/dwl/pull/381
[387]: https://github.com/djpohly/dwl/issues/387
[425]: https://github.com/djpohly/dwl/pull/425
[wlroots!4269]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4269
[wlroots!3511]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3511
[465]: https://github.com/djpohly/dwl/pull/465
[444]: https://github.com/djpohly/dwl/pull/444
[484]: https://github.com/djpohly/dwl/pull/484
[466]: https://github.com/djpohly/dwl/issues/466
[494]: https://github.com/djpohly/dwl/pull/494
[501]: https://github.com/djpohly/dwl/pull/501
### Changed
* Replace `tags` with `TAGCOUNT` in config.def.h ([#403][403])
* Pop ups are now destroyed when focusing another client ([#408][408])
* dwl does not longer respect size hints, instead clip windows if they are
larger than they should be ([#455][455])
* The version of wlr-layer-shell-unstable-v1 was lowered to 3 (from 4)
* Use the same border color as dwm ([#494][494])
[403]: https://github.com/djpohly/dwl/pull/403
[408]: https://github.com/djpohly/dwl/pull/409
[455]: https://github.com/djpohly/dwl/pull/455
[494]: https://github.com/djpohly/dwl/pull/494
### Removed
* Remove unused `rootcolor` option ([#401][401])
* Remove support for wlr-input-inhibitor-unstable-v1 ([#430][430])
* Remove support for KDE idle protocol ([#431][431])
[401]: https://github.com/djpohly/dwl/pull/401
[430]: https://github.com/djpohly/dwl/pull/430
[431]: https://github.com/djpohly/dwl/pull/431
### Fixed
* Fix crash when creating a layer surface with all outputs disabled
([#421][421])
* Fix other clients being shown as focused if the focused client have pop ups
open ([#408][408])
* Resize fullscreen clients when updating monitor mode
* dwl no longer crash at exit like sometimes did
* Fullscreen background appearing above clients ([#487][487])
* Fix a segfault when user provides invalid xkb_rules ([#518][518])
[421]: https://github.com/djpohly/dwl/pull/421
[408]: https://github.com/djpohly/dwl/issues/408
[487]: https://github.com/djpohly/dwl/issues/487
[518]: https://github.com/djpohly/dwl/pull/518
### Contributors
* A Frederick Christensen
* Angelo Antony
* Ben Collerson
* Devin J. Pohly
* Forrest Bushstone
* gan-of-culture
* godalming123
* Job79
* link2xt
* Micah Gorrell
* Nikita Ivanov
* Palanix
* pino-desktop
* Weiseguy
* Yves Zoundi
+57 -53
View File
@@ -1,69 +1,73 @@
.POSIX:
.SUFFIXES:
include config.mk include config.mk
# flags for compiling CFLAGS += -I. -DWLR_USE_UNSTABLE -std=c99 -pedantic -DVERSION=\"$(VERSION)\"
DWLCPPFLAGS = -I. -DWLR_USE_UNSTABLE -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\" $(XWAYLAND)
DWLDEVCFLAGS = -g -pedantic -Wall -Wextra -Wdeclaration-after-statement -Wno-unused-parameter -Wshadow -Wunused-macros\
-Werror=strict-prototypes -Werror=implicit -Werror=return-type -Werror=incompatible-pointer-types -Wfloat-conversion
# CFLAGS / LDFLAGS WAYLAND_PROTOCOLS=$(shell pkg-config --variable=pkgdatadir wayland-protocols)
PKGS = wlroots wayland-server xkbcommon libinput $(XLIBS) WAYLAND_SCANNER=$(shell pkg-config --variable=wayland_scanner wayland-scanner)
DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(DWLCPPFLAGS) $(DWLDEVCFLAGS) $(CFLAGS)
LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` $(LIBS) PKGS = wlroots wayland-server xcb xkbcommon libinput
CFLAGS += $(foreach p,$(PKGS),$(shell pkg-config --cflags $(p)))
LDLIBS += $(foreach p,$(PKGS),$(shell pkg-config --libs $(p)))
all: dwl all: dwl
dwl: dwl.o util.o
$(CC) dwl.o util.o $(LDLIBS) $(LDFLAGS) $(DWLCFLAGS) -o $@
dwl.o: dwl.c config.mk config.h client.h cursor-shape-v1-protocol.h pointer-constraints-unstable-v1-protocol.h wlr-layer-shell-unstable-v1-protocol.h xdg-shell-protocol.h
util.o: util.c util.h
# wayland-scanner is a tool which generates C headers and rigging for Wayland
# protocols, which are specified in XML. wlroots requires you to rig these up
# to your build system yourself and provide them in the include path.
WAYLAND_SCANNER = `$(PKG_CONFIG) --variable=wayland_scanner wayland-scanner`
WAYLAND_PROTOCOLS = `$(PKG_CONFIG) --variable=pkgdatadir wayland-protocols`
cursor-shape-v1-protocol.h:
$(WAYLAND_SCANNER) server-header \
$(WAYLAND_PROTOCOLS)/staging/cursor-shape/cursor-shape-v1.xml $@
pointer-constraints-unstable-v1-protocol.h:
$(WAYLAND_SCANNER) server-header \
$(WAYLAND_PROTOCOLS)/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml $@
wlr-layer-shell-unstable-v1-protocol.h:
$(WAYLAND_SCANNER) server-header \
protocols/wlr-layer-shell-unstable-v1.xml $@
xdg-shell-protocol.h:
$(WAYLAND_SCANNER) server-header \
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
config.h:
cp config.def.h $@
clean: clean:
rm -f dwl *.o *-protocol.h rm -f dwl *.o *-protocol.h *-protocol.c
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 README.md generate-version.sh client.h\
config.mk protocols dwl.1 dwl.c util.c util.h dwl.desktop\ config.def.h config.mk protocols dwl.1 dwl.c util.c util.h\
dwl-$(VERSION) dwl-$(VERSION)
echo "echo $(VERSION)" > dwl-$(VERSION)/generate-version.sh
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 install -Dm755 dwl $(DESTDIR)$(PREFIX)/bin/dwl
cp -f dwl $(DESTDIR)$(PREFIX)/bin install -Dm644 dwl.1 $(DESTDIR)$(MANDIR)/man1/dwl.1
chmod 755 $(DESTDIR)$(PREFIX)/bin/dwl
mkdir -p $(DESTDIR)$(MANDIR)/man1
cp -f dwl.1 $(DESTDIR)$(MANDIR)/man1
chmod 644 $(DESTDIR)$(MANDIR)/man1/dwl.1
mkdir -p $(DESTDIR)$(DATADIR)/wayland-sessions
cp -f dwl.desktop $(DESTDIR)$(DATADIR)/wayland-sessions/dwl.desktop
chmod 644 $(DESTDIR)$(DATADIR)/wayland-sessions/dwl.desktop
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/dwl $(DESTDIR)$(MANDIR)/man1/dwl.1 $(DESTDIR)$(DATADIR)/wayland-sessions/dwl.desktop
.SUFFIXES: .c .o uninstall:
.c.o: rm -f $(DESTDIR)$(PREFIX)/bin/dwl $(DESTDIR)$(MANDIR)/man1/dwl.1
$(CC) $(CPPFLAGS) $(DWLCFLAGS) -c $<
.PHONY: all clean dist install uninstall
# wayland-scanner is a tool which generates C headers and rigging for Wayland
# protocols, which are specified in XML. wlroots requires you to rig these up
# to your build system yourself and provide them in the include path.
xdg-shell-protocol.h:
$(WAYLAND_SCANNER) server-header \
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
xdg-shell-protocol.c:
$(WAYLAND_SCANNER) private-code \
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
xdg-shell-protocol.o: xdg-shell-protocol.h
wlr-layer-shell-unstable-v1-protocol.h:
$(WAYLAND_SCANNER) server-header \
protocols/wlr-layer-shell-unstable-v1.xml $@
wlr-layer-shell-unstable-v1-protocol.c:
$(WAYLAND_SCANNER) private-code \
protocols/wlr-layer-shell-unstable-v1.xml $@
wlr-layer-shell-unstable-v1-protocol.o: wlr-layer-shell-unstable-v1-protocol.h
idle-protocol.h:
$(WAYLAND_SCANNER) server-header \
protocols/idle.xml $@
idle-protocol.c:
$(WAYLAND_SCANNER) private-code \
protocols/idle.xml $@
idle-protocol.o: idle-protocol.h
config.h: | config.def.h
cp config.def.h $@
dwl.o: config.mk config.h client.h xdg-shell-protocol.h wlr-layer-shell-unstable-v1-protocol.h idle-protocol.h util.h
dwl: xdg-shell-protocol.o wlr-layer-shell-unstable-v1-protocol.o idle-protocol.o util.o
+27 -118
View File
@@ -1,124 +1,61 @@
# dwl - dwm for Wayland # dwl - dwm for Wayland
Join us on our IRC channel: [#dwl on Libera Chat] Join us on our [Discord server](https://discord.gg/jJxZnrGPWN)!
Or on our [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](https://gitlab.freedesktop.org/wlroots/wlroots/). It is intended to fill the same space in the Wayland world that dwm does in X11, primarily in terms of philosophy, and secondarily in terms of functionality. Like dwm, dwl is:
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.
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`
- Limited to 2000 SLOC to promote hackability
- 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 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:
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, - 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.
client rules, mouse move/resize. Providing a built-in status bar is an
exception to this goal, to avoid dependencies on font rendering and/or
drawing libraries when an external bar could work well.
- Configurable multi-monitor layout support, including position and rotation - Configurable multi-monitor layout support, including position and rotation
- Configurable HiDPI/multi-DPI support - Configurable HiDPI/multi-DPI support
- Idle-inhibit protocol which lets applications such as mpv disable idle - Idle-inhibit protocol which lets applications such as mpv disable idle monitoring
monitoring
- Provide information to external status bars via stdout/stdin - Provide information to external status bars via stdout/stdin
- Urgency hints via xdg-activate protocol - Urgency hints via xdg-activate protocol
- Support screen lockers via ext-session-lock-v1 protocol - Support screen lockers via input-inhibitor protocol
- Various Wayland protocols - Various Wayland protocols
- XWayland support as provided by wlroots (can be enabled in `config.mk`) - XWayland support as provided by wlroots (can be enabled in `config.mk`)
- Zero flickering - Wayland users naturally expect that "every frame is perfect" - Zero flickering - Wayland users naturally expect that "every frame is perfect"
- Layer shell popups (used by Waybar) - Layer shell popups (used by Waybar)
- Damage tracking provided by scenegraph API - 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: Features under consideration (possibly as patches) are:
- Protocols made trivial by wlroots - Protocols made trivial by wlroots
- Implement the text-input and input-method protocols to support IME once ibus - Implement the text-input and input-method protocols to support IME once ibus implements input-method v2 (see https://github.com/ibus/ibus/pull/2256 and https://github.com/djpohly/dwl/pull/12)
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: Feature *non-goals* for the main codebase include:
- Client-side decoration (any more than is necessary to tell the clients not to) - 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 - Client-initiated window management, such as move, resize, and close, which can be done through the compositor
be done through the compositor
- Animations and visual effects - Animations and visual effects
## Building dwl ## Building dwl
dwl has the following dependencies: dwl has only two dependencies: wlroots and wayland-protocols. Simply install these (and their `-devel` versions if your distro has separate development packages) and run `make`. If you wish to build against a Git version of wlroots, check out the [wlroots-next branch](https://github.com/djpohly/dwl/tree/wlroots-next).
```
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 To enable XWayland, you should also install xorg-xwayland and uncomment its flag in `config.mk`.
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 ## 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 Wayland without restarting the entire display server, so any changes will take effect the next time dwl is executed.
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. As in the dwm community, we encourage users to share patches they have created. Check out the [patches page on our wiki](https://github.com/djpohly/dwl/wiki/Patches)!
Check out the dwl [patches repository] and [patches wiki]!
## 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 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.
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 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.
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 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](https://skarnet.org/software/s6/), [anopa](https://jjacky.com/anopa/), [runit](http://smarden.org/runit/faq.html#userservices), or [`systemd --user`](https://wiki.archlinux.org/title/Systemd/User).
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 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.:
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) export XDG_RUNTIME_DIR=/tmp/xdg-runtime-$(id -u)
mkdir -p $XDG_RUNTIME_DIR mkdir -p $XDG_RUNTIME_DIR
@@ -126,56 +63,28 @@ automatically, you will need to configure it prior to launching `dwl`, e.g.:
### Status information ### Status information
Information about selected layouts, current window title, app-id, and Information about selected layouts, current window title, 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:
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 <&-' dwl -s 'foot --server <&-'
If your startup command is a shell script, you can achieve the same inside the If your startup command is a shell script, you can achieve the same inside the script with the line
script with the line
exec <&- exec <&-
To get a list of status bars that work with dwl consult our [wiki].
## 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 Wayland applications on the sway wiki](https://github.com/swaywm/sway/wiki/i3-Migration-Guide).
## IRC channel
dwl's IRC channel is #dwl on irc.libera.chat.
## 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 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 possible.
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
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**
- Alexander Courtis for the XWayland implementation - Alexander Courtis for the XWayland implementation
- Guido Cella for the layer-shell protocol implementation, patch maintenance, - Guido Cella for the layer-shell protocol implementation, patch maintenance, and for helping to keep the project running
and for helping to keep the project running
- 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
[#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
[wiki]: https://codeberg.org/dwl/dwl/wiki/Home#compatible-status-bars
[list of useful resources on our wiki]:
https://codeberg.org/dwl/dwl/wiki/Home#migrating-from-x
+90 -238
View File
@@ -10,9 +10,10 @@ static inline int
client_is_x11(Client *c) client_is_x11(Client *c)
{ {
#ifdef XWAYLAND #ifdef XWAYLAND
return c->type == X11; return c->type == X11Managed || c->type == X11Unmanaged;
#endif #else
return 0; return 0;
#endif
} }
static inline struct wlr_surface * static inline struct wlr_surface *
@@ -25,100 +26,34 @@ client_surface(Client *c)
return c->surface.xdg->surface; return c->surface.xdg->surface;
} }
static inline int
toplevel_from_wlr_surface(struct wlr_surface *s, Client **pc, LayerSurface **pl)
{
struct wlr_xdg_surface *xdg_surface, *tmp_xdg_surface;
struct wlr_surface *root_surface;
struct wlr_layer_surface_v1 *layer_surface;
Client *c = NULL;
LayerSurface *l = NULL;
int type = -1;
#ifdef XWAYLAND
struct wlr_xwayland_surface *xsurface;
#endif
if (!s)
return -1;
root_surface = wlr_surface_get_root_surface(s);
#ifdef XWAYLAND
if ((xsurface = wlr_xwayland_surface_try_from_wlr_surface(root_surface))) {
c = xsurface->data;
type = c->type;
goto end;
}
#endif
if ((layer_surface = wlr_layer_surface_v1_try_from_wlr_surface(root_surface))) {
l = layer_surface->data;
type = LayerShell;
goto end;
}
xdg_surface = wlr_xdg_surface_try_from_wlr_surface(root_surface);
while (xdg_surface) {
tmp_xdg_surface = NULL;
switch (xdg_surface->role) {
case WLR_XDG_SURFACE_ROLE_POPUP:
if (!xdg_surface->popup || !xdg_surface->popup->parent)
return -1;
tmp_xdg_surface = wlr_xdg_surface_try_from_wlr_surface(xdg_surface->popup->parent);
if (!tmp_xdg_surface)
return toplevel_from_wlr_surface(xdg_surface->popup->parent, pc, pl);
xdg_surface = tmp_xdg_surface;
break;
case WLR_XDG_SURFACE_ROLE_TOPLEVEL:
c = xdg_surface->data;
type = c->type;
goto end;
case WLR_XDG_SURFACE_ROLE_NONE:
return -1;
}
}
end:
if (pl)
*pl = l;
if (pc)
*pc = c;
return type;
}
/* The others */ /* The others */
static inline void static inline void
client_activate_surface(struct wlr_surface *s, int activated) client_activate_surface(struct wlr_surface *s, int activated)
{ {
struct wlr_xdg_toplevel *toplevel; struct wlr_xdg_surface *surface;
#ifdef XWAYLAND #ifdef XWAYLAND
struct wlr_xwayland_surface *xsurface; struct wlr_xwayland_surface *xsurface;
if ((xsurface = wlr_xwayland_surface_try_from_wlr_surface(s))) { if (wlr_surface_is_xwayland_surface(s)
&& (xsurface = wlr_xwayland_surface_from_wlr_surface(s))) {
wlr_xwayland_surface_activate(xsurface, activated); wlr_xwayland_surface_activate(xsurface, activated);
return; return;
} }
#endif #endif
if ((toplevel = wlr_xdg_toplevel_try_from_wlr_surface(s))) if (wlr_surface_is_xdg_surface(s)
wlr_xdg_toplevel_set_activated(toplevel, activated); && (surface = wlr_xdg_surface_from_wlr_surface(s))
&& surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL)
wlr_xdg_toplevel_set_activated(surface, activated);
} }
static inline uint32_t static inline void
client_set_bounds(Client *c, int32_t width, int32_t height) client_for_each_surface(Client *c, wlr_surface_iterator_func_t fn, void *data)
{ {
wlr_surface_for_each_surface(client_surface(c), fn, data);
#ifdef XWAYLAND #ifdef XWAYLAND
if (client_is_x11(c)) if (client_is_x11(c))
return 0; return;
#endif #endif
if (wl_resource_get_version(c->surface.xdg->toplevel->resource) >= wlr_xdg_surface_for_each_popup_surface(c->surface.xdg, fn, data);
XDG_TOPLEVEL_CONFIGURE_BOUNDS_SINCE_VERSION && width >= 0 && height >= 0
&& (c->bounds.width != width || c->bounds.height != height)) {
c->bounds.width = width;
c->bounds.height = height;
return wlr_xdg_toplevel_set_bounds(c->surface.xdg->toplevel, width, height);
}
return 0;
} }
static inline const char * static inline const char *
@@ -131,27 +66,6 @@ client_get_appid(Client *c)
return c->surface.xdg->toplevel->app_id; return c->surface.xdg->toplevel->app_id;
} }
static inline void
client_get_clip(Client *c, struct wlr_box *clip)
{
struct wlr_box xdg_geom = {0};
*clip = (struct wlr_box){
.x = 0,
.y = 0,
.width = c->geom.width - c->bw,
.height = c->geom.height - c->bw,
};
#ifdef XWAYLAND
if (client_is_x11(c))
return;
#endif
wlr_xdg_surface_get_geometry(c->surface.xdg, &xdg_geom);
clip->x = xdg_geom.x;
clip->y = xdg_geom.y;
}
static inline void static inline void
client_get_geometry(Client *c, struct wlr_box *geom) client_get_geometry(Client *c, struct wlr_box *geom)
{ {
@@ -167,34 +81,6 @@ client_get_geometry(Client *c, struct wlr_box *geom)
wlr_xdg_surface_get_geometry(c->surface.xdg, geom); wlr_xdg_surface_get_geometry(c->surface.xdg, geom);
} }
static inline Client *
client_get_parent(Client *c)
{
Client *p = NULL;
#ifdef XWAYLAND
if (client_is_x11(c)) {
if (c->surface.xwayland->parent)
toplevel_from_wlr_surface(c->surface.xwayland->parent->surface, &p, NULL);
return p;
}
#endif
if (c->surface.xdg->toplevel->parent)
toplevel_from_wlr_surface(c->surface.xdg->toplevel->parent->base->surface, &p, NULL);
return p;
}
static inline int
client_has_children(Client *c)
{
#ifdef XWAYLAND
if (client_is_x11(c))
return !wl_list_empty(&c->surface.xwayland->children);
#endif
/* surface.xdg->link is never empty because it always contains at least the
* surface itself. */
return wl_list_length(&c->surface.xdg->link) > 1;
}
static inline const char * static inline const char *
client_get_title(Client *c) client_get_title(Client *c)
{ {
@@ -214,104 +100,54 @@ client_is_float_type(Client *c)
#ifdef XWAYLAND #ifdef XWAYLAND
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; struct wlr_xwayland_surface_size_hints *size_hints;
size_t i;
if (surface->modal) if (surface->modal)
return 1; return 1;
for (i = 0; i < surface->window_type_len; i++) for (size_t i = 0; i < surface->window_type_len; i++)
if (surface->window_type[i] == netatom[NetWMWindowTypeDialog] if (surface->window_type[i] == netatom[NetWMWindowTypeDialog] ||
|| surface->window_type[i] == netatom[NetWMWindowTypeSplash] surface->window_type[i] == netatom[NetWMWindowTypeSplash] ||
|| surface->window_type[i] == netatom[NetWMWindowTypeToolbar] surface->window_type[i] == netatom[NetWMWindowTypeToolbar] ||
|| surface->window_type[i] == netatom[NetWMWindowTypeUtility]) surface->window_type[i] == netatom[NetWMWindowTypeUtility])
return 1; return 1;
return size_hints && size_hints->min_width > 0 && size_hints->min_height > 0 size_hints = surface->size_hints;
&& (size_hints->max_width == size_hints->min_width if (size_hints && size_hints->min_width > 0 && size_hints->min_height > 0
|| size_hints->max_height == size_hints->min_height); && (size_hints->max_width == size_hints->min_width ||
size_hints->max_height == size_hints->min_height))
return 1;
return 0;
} }
#endif #endif
toplevel = c->surface.xdg->toplevel; toplevel = c->surface.xdg->toplevel;
state = toplevel->current; state = toplevel->current;
return toplevel->parent || (state.min_width != 0 && state.min_height != 0 return (state.min_width != 0 && state.min_height != 0
&& (state.min_width == state.max_width && (state.min_width == state.max_width
|| state.min_height == state.max_height)); || state.min_height == state.max_height))
|| toplevel->parent;
} }
static inline int static inline int
client_is_rendered_on_mon(Client *c, Monitor *m) client_wants_fullscreen(Client *c)
{ {
/* This is needed for when you don't want to check formal assignment,
* but rather actual displaying of the pixels.
* Usually VISIBLEON suffices and is also faster. */
struct wlr_surface_output *s;
int unused_lx, unused_ly;
if (!wlr_scene_node_coords(&c->scene->node, &unused_lx, &unused_ly))
return 0;
wl_list_for_each(s, &client_surface(c)->current_outputs, link)
if (s->output == m->wlr_output)
return 1;
return 0;
}
static inline int
client_is_stopped(Client *c)
{
int pid;
siginfo_t in = {0};
#ifdef XWAYLAND #ifdef XWAYLAND
if (client_is_x11(c)) if (client_is_x11(c))
return 0; return c->surface.xwayland->fullscreen;
#endif #endif
return c->surface.xdg->toplevel->requested.fullscreen;
wl_client_get_credentials(c->surface.xdg->client->client, &pid, NULL, NULL);
if (waitid(P_PID, pid, &in, WNOHANG|WCONTINUED|WSTOPPED|WNOWAIT) < 0) {
/* This process is not our child process, while is very unluckely that
* it is stopped, in order to do not skip frames assume that it is. */
if (errno == ECHILD)
return 1;
} else if (in.si_pid) {
if (in.si_code == CLD_STOPPED || in.si_code == CLD_TRAPPED)
return 1;
if (in.si_code == CLD_CONTINUED)
return 0;
}
return 0;
} }
static inline int static inline int
client_is_unmanaged(Client *c) client_is_unmanaged(Client *c)
{ {
#ifdef XWAYLAND #ifdef XWAYLAND
if (client_is_x11(c)) return c->type == X11Unmanaged;
return c->surface.xwayland->override_redirect;
#endif #endif
return 0; return 0;
} }
static inline void
client_notify_enter(struct wlr_surface *s, struct wlr_keyboard *kb)
{
if (kb)
wlr_seat_keyboard_notify_enter(seat, s, kb->keycodes,
kb->num_keycodes, &kb->modifiers);
else
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)
{ {
@@ -321,15 +157,7 @@ client_send_close(Client *c)
return; return;
} }
#endif #endif
wlr_xdg_toplevel_send_close(c->surface.xdg->toplevel); wlr_xdg_toplevel_send_close(c->surface.xdg);
}
static inline void
client_set_border_color(Client *c, const float color[static 4])
{
int i;
for (i = 0; i < 4; i++)
wlr_scene_rect_set_color(c->border[i], color);
} }
static inline void static inline void
@@ -341,7 +169,7 @@ client_set_fullscreen(Client *c, int fullscreen)
return; return;
} }
#endif #endif
wlr_xdg_toplevel_set_fullscreen(c->surface.xdg->toplevel, fullscreen); wlr_xdg_toplevel_set_fullscreen(c->surface.xdg, fullscreen);
} }
static inline uint32_t static inline uint32_t
@@ -354,10 +182,7 @@ client_set_size(Client *c, uint32_t width, uint32_t height)
return 0; return 0;
} }
#endif #endif
if ((int32_t)width == c->surface.xdg->toplevel->current.width return wlr_xdg_toplevel_set_size(c->surface.xdg, width, height);
&& (int32_t)height == c->surface.xdg->toplevel->current.height)
return 0;
return wlr_xdg_toplevel_set_size(c->surface.xdg->toplevel, (int32_t)width, (int32_t)height);
} }
static inline void static inline void
@@ -367,42 +192,69 @@ client_set_tiled(Client *c, uint32_t edges)
if (client_is_x11(c)) if (client_is_x11(c))
return; return;
#endif #endif
if (wl_resource_get_version(c->surface.xdg->toplevel->resource) wlr_xdg_toplevel_set_tiled(c->surface.xdg, edges);
>= XDG_TOPLEVEL_STATE_TILED_RIGHT_SINCE_VERSION) { }
wlr_xdg_toplevel_set_tiled(c->surface.xdg->toplevel, edges);
} else { static inline struct wlr_surface *
wlr_xdg_toplevel_set_maximized(c->surface.xdg->toplevel, edges != WLR_EDGE_NONE); client_surface_at(Client *c, double cx, double cy, double *sx, double *sy)
} {
#ifdef XWAYLAND
if (client_is_x11(c))
return wlr_surface_surface_at(c->surface.xwayland->surface,
cx, cy, sx, sy);
#endif
return wlr_xdg_surface_surface_at(c->surface.xdg, cx, cy, sx, sy);
} }
static inline void static inline void
client_set_suspended(Client *c, int suspended) client_min_size(Client *c, int *width, int *height)
{ {
struct wlr_xdg_toplevel *toplevel;
struct wlr_xdg_toplevel_state *state;
#ifdef XWAYLAND #ifdef XWAYLAND
if (client_is_x11(c)) if (client_is_x11(c)) {
struct wlr_xwayland_surface_size_hints *size_hints;
size_hints = c->surface.xwayland->size_hints;
if (size_hints) {
*width = size_hints->min_width;
*height = size_hints->min_height;
} else {
*width = 0;
*height = 0;
}
return; return;
}
#endif #endif
toplevel = c->surface.xdg->toplevel;
wlr_xdg_toplevel_set_suspended(c->surface.xdg->toplevel, suspended); state = &toplevel->current;
*width = state->min_width;
*height = state->min_height;
} }
static inline int static inline Client *
client_wants_focus(Client *c) client_from_wlr_surface(struct wlr_surface *surface)
{ {
#ifdef XWAYLAND struct wlr_scene_node *n = surface->data;
return client_is_unmanaged(c) return n ? n->data : NULL;
&& wlr_xwayland_or_surface_wants_focus(c->surface.xwayland)
&& wlr_xwayland_icccm_input_model(c->surface.xwayland) != WLR_ICCCM_INPUT_MODEL_NONE;
#endif
return 0;
} }
static inline int static inline Client *
client_wants_fullscreen(Client *c) client_from_popup(struct wlr_xdg_popup *popup)
{ {
#ifdef XWAYLAND struct wlr_xdg_surface *surface = popup->base;
if (client_is_x11(c))
return c->surface.xwayland->fullscreen; while (1) {
#endif switch (surface->role) {
return c->surface.xdg->toplevel->requested.fullscreen; case WLR_XDG_SURFACE_ROLE_POPUP:
if (!wlr_surface_is_xdg_surface(surface->popup->parent))
return NULL;
surface = wlr_xdg_surface_from_wlr_surface(surface->popup->parent);
break;
case WLR_XDG_SURFACE_ROLE_TOPLEVEL:
return surface->data;
case WLR_XDG_SURFACE_ROLE_NONE:
return NULL;
}
}
} }
+21 -52
View File
@@ -1,31 +1,20 @@
/* Taken from https://github.com/djpohly/dwl/issues/466 */
#define COLOR(hex) { ((hex >> 24) & 0xFF) / 255.0f, \
((hex >> 16) & 0xFF) / 255.0f, \
((hex >> 8) & 0xFF) / 255.0f, \
(hex & 0xFF) / 255.0f }
/* appearance */ /* appearance */
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 unsigned int borderpx = 1; /* border pixel of windows */
static const unsigned int borderpx = 1; /* border pixel of windows */ static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
static const unsigned int snap = 32; /* snap pixel */ static const float rootcolor[] = {0.3, 0.3, 0.3, 1.0};
static const float rootcolor[] = COLOR(0x222222ff); static const float bordercolor[] = {0.5, 0.5, 0.5, 1.0};
static const float bordercolor[] = COLOR(0x444444ff); static const float focuscolor[] = {1.0, 0.0, 0.0, 1.0};
static const float focuscolor[] = COLOR(0x005577ff);
static const float urgentcolor[] = COLOR(0xff0000ff);
/* 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 */
/* tagging - TAGCOUNT must be no greater than 31 */ /* tagging */
#define TAGCOUNT (9) static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
/* logging */
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: */ /* examples:
{ "Gimp_EXAMPLE", NULL, 0, 1, -1 }, /* Start on currently visible tags floating, not tiled */ { "Gimp", NULL, 0, 1, -1 },
{ "firefox_EXAMPLE", NULL, 1 << 8, 0, -1 }, /* Start on ONLY tag "9" */ */
{ "firefox", NULL, 1 << 8, 0, -1 },
}; };
/* layout(s) */ /* layout(s) */
@@ -37,14 +26,13 @@ static const Layout layouts[] = {
}; };
/* monitors */ /* monitors */
/* 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 */
/* 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.5, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL },
*/ */
/* defaults */ /* defaults */
{ NULL, 0.55f, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 }, { NULL, 0.55, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL },
}; };
/* keyboard */ /* keyboard */
@@ -53,7 +41,7 @@ static const struct xkb_rule_names xkb_rules = {
/* example: /* example:
.options = "ctrl:nocaps", .options = "ctrl:nocaps",
*/ */
.options = NULL, .options = "",
}; };
static const int repeat_rate = 25; static const int repeat_rate = 25;
@@ -74,21 +62,12 @@ LIBINPUT_CONFIG_SCROLL_EDGE
LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN
*/ */
static const enum libinput_config_scroll_method scroll_method = LIBINPUT_CONFIG_SCROLL_2FG; static const enum libinput_config_scroll_method scroll_method = LIBINPUT_CONFIG_SCROLL_2FG;
/* You can choose between:
LIBINPUT_CONFIG_CLICK_METHOD_NONE
LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS
LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER
*/
static const enum libinput_config_click_method click_method = LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS;
/* You can choose between: /* You can choose between:
LIBINPUT_CONFIG_SEND_EVENTS_ENABLED LIBINPUT_CONFIG_SEND_EVENTS_ENABLED
LIBINPUT_CONFIG_SEND_EVENTS_DISABLED LIBINPUT_CONFIG_SEND_EVENTS_DISABLED
LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE
*/ */
static const uint32_t send_events_mode = LIBINPUT_CONFIG_SEND_EVENTS_ENABLED; static const uint32_t send_events_mode = LIBINPUT_CONFIG_SEND_EVENTS_ENABLED;
/* You can choose between: /* You can choose between:
LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT
LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE
@@ -96,15 +75,8 @@ 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: /* If you want to use the windows key change this to WLR_MODIFIER_LOGO */
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
*/
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 */
#define MODKEY WLR_MODIFIER_ALT #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} }, \
@@ -115,7 +87,7 @@ static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TA
#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 *termcmd[] = { "foot", NULL }; static const char *termcmd[] = { "alacritty", NULL };
static const char *menucmd[] = { "bemenu-run", NULL }; static const char *menucmd[] = { "bemenu-run", NULL };
static const Key keys[] = { static const Key keys[] = {
@@ -127,8 +99,8 @@ static const Key keys[] = {
{ 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.05} },
{ MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} }, { MODKEY, XKB_KEY_l, setmfact, {.f = +0.05} },
{ MODKEY, XKB_KEY_Return, zoom, {0} }, { MODKEY, XKB_KEY_Return, zoom, {0} },
{ MODKEY, XKB_KEY_Tab, view, {0} }, { MODKEY, XKB_KEY_Tab, view, {0} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, killclient, {0} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, killclient, {0} },
@@ -157,9 +129,6 @@ static const Key keys[] = {
/* 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} },
/* Ctrl-Alt-Fx is used to switch to another VT, if you don't know what a VT is
* do not remove them.
*/
#define CHVT(n) { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_XF86Switch_VT_##n, chvt, {.ui = (n)} } #define CHVT(n) { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_XF86Switch_VT_##n, chvt, {.ui = (n)} }
CHVT(1), CHVT(2), CHVT(3), CHVT(4), CHVT(5), CHVT(6), CHVT(1), CHVT(2), CHVT(3), CHVT(4), CHVT(5), CHVT(6),
CHVT(7), CHVT(8), CHVT(9), CHVT(10), CHVT(11), CHVT(12), CHVT(7), CHVT(8), CHVT(9), CHVT(10), CHVT(11), CHVT(12),
+6 -9
View File
@@ -1,15 +1,12 @@
_VERSION = 0.5 _VERSION = 0.3.1
VERSION = `git describe --tags --dirty 2>/dev/null || echo $(_VERSION)` VERSION = $(shell ./generate-version.sh $(_VERSION))
PKG_CONFIG = pkg-config
# paths # paths
PREFIX = /usr/local PREFIX = /usr/local
MANDIR = $(PREFIX)/share/man MANDIR = $(PREFIX)/share/man
DATADIR = $(PREFIX)/share
XWAYLAND = # Default compile flags (overridable by environment)
XLIBS = CFLAGS ?= -g -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wdeclaration-after-statement
# Uncomment to build XWayland support # Uncomment to build XWayland support
#XWAYLAND = -DXWAYLAND #CFLAGS += -DXWAYLAND
#XLIBS = xcb xcb-icccm
+3 -10
View File
@@ -7,7 +7,6 @@
.Sh SYNOPSIS .Sh SYNOPSIS
.Nm .Nm
.Op Fl v .Op Fl v
.Op Fl d
.Op Fl s Ar startup command .Op Fl s Ar startup command
.Sh DESCRIPTION .Sh DESCRIPTION
.Nm .Nm
@@ -23,12 +22,6 @@ option,
writes its name and version to standard error and exits unsuccessfully. writes its name and version to standard error and exits unsuccessfully.
.Pp .Pp
When given the When given the
.Fl d
option,
.Nm
enables full wlroots logging, including debug information.
.Pp
When given the
.Fl s .Fl s
option, option,
.Nm .Nm
@@ -58,7 +51,7 @@ Spawn
.Nm bemenu-run . .Nm bemenu-run .
.It Mod-Shift-Return .It Mod-Shift-Return
Spawn Spawn
.Nm foot . .Nm alacritty .
.It Mod-[jk] .It Mod-[jk]
Move focus down/up the stack. Move focus down/up the stack.
.It Mod-[id] .It Mod-[id]
@@ -108,7 +101,7 @@ These environment variables are used by
A directory where temporary user files, such as the Wayland socket, A directory where temporary user files, such as the Wayland socket,
are stored. are stored.
.It Ev XDG_CONFIG_DIR .It Ev XDG_CONFIG_DIR
A directory containing configuration of various programs and A directory containung configuration of various programs and
libraries, including libxkbcommon. libraries, including libxkbcommon.
.It Ev DISPLAY , WAYLAND_DISPLAY , WAYLAND_SOCKET .It Ev DISPLAY , WAYLAND_DISPLAY , WAYLAND_SOCKET
Tell how to connect to an underlying X11 or Wayland server. Tell how to connect to an underlying X11 or Wayland server.
@@ -142,7 +135,7 @@ Start
with s6 in the background: with s6 in the background:
.Dl dwl -s 's6-svscan <&-' .Dl dwl -s 's6-svscan <&-'
.Sh SEE ALSO .Sh SEE ALSO
.Xr foot 1 , .Xr alacritty 1 ,
.Xr bemenu 1 , .Xr bemenu 1 ,
.Xr dwm 1 , .Xr dwm 1 ,
.Xr xkeyboard-config 7 .Xr xkeyboard-config 7
+1589 -1412
View File
File diff suppressed because it is too large Load Diff
-5
View File
@@ -1,5 +0,0 @@
[Desktop Entry]
Name=dwl
Comment=dwm for Wayland
Exec=dwl
Type=Application
+13
View File
@@ -0,0 +1,13 @@
#!/bin/sh
if git tag --contains HEAD | grep -q $1; then
echo $1
else
branch="$(git rev-parse --abbrev-ref HEAD)"
commit="$(git rev-parse --short HEAD)"
if [ "${branch}" != "main" ]; then
echo $1-$branch-$commit
else
echo $1-$commit
fi
fi
+49
View File
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<protocol name="idle">
<copyright><![CDATA[
Copyright (C) 2015 Martin Gräßlin
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 2.1 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
]]></copyright>
<interface name="org_kde_kwin_idle" version="1">
<description summary="User idle time manager">
This interface allows to monitor user idle time on a given seat. The interface
allows to register timers which trigger after no user activity was registered
on the seat for a given interval. It notifies when user activity resumes.
This is useful for applications wanting to perform actions when the user is not
interacting with the system, e.g. chat applications setting the user as away, power
management features to dim screen, etc..
</description>
<request name="get_idle_timeout">
<arg name="id" type="new_id" interface="org_kde_kwin_idle_timeout"/>
<arg name="seat" type="object" interface="wl_seat"/>
<arg name="timeout" type="uint" summary="The idle timeout in msec"/>
</request>
</interface>
<interface name="org_kde_kwin_idle_timeout" version="1">
<request name="release" type="destructor">
<description summary="release the timeout object"/>
</request>
<request name="simulate_user_activity">
<description summary="Simulates user activity for this timeout, behaves just like real user activity on the seat"/>
</request>
<event name="idle">
<description summary="Triggered when there has not been any user activity in the requested idle time interval"/>
</event>
<event name="resumed">
<description summary="Triggered on the first user activity after an idle event"/>
</event>
</interface>
</protocol>
+10 -10
View File
@@ -6,6 +6,16 @@
#include "util.h" #include "util.h"
void *
ecalloc(size_t nmemb, size_t size)
{
void *p;
if (!(p = calloc(nmemb, size)))
die("calloc:");
return p;
}
void void
die(const char *fmt, ...) { die(const char *fmt, ...) {
va_list ap; va_list ap;
@@ -23,13 +33,3 @@ die(const char *fmt, ...) {
exit(1); exit(1);
} }
void *
ecalloc(size_t nmemb, size_t size)
{
void *p;
if (!(p = calloc(nmemb, size)))
die("calloc:");
return p;
}