summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile5
-rw-r--r--README.md6
-rw-r--r--config.def.h5
-rw-r--r--config.mk3
-rw-r--r--dwl.c13
5 files changed, 24 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 3dc2336..41d2def 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ CFLAGS += -I. -DWLR_USE_UNSTABLE -std=c99 -Werror=declaration-after-statement
WAYLAND_PROTOCOLS=$(shell pkg-config --variable=pkgdatadir wayland-protocols)
WAYLAND_SCANNER=$(shell pkg-config --variable=wayland_scanner wayland-scanner)
-PKGS = wlroots wayland-server xcb xkbcommon
+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)))
@@ -43,5 +43,8 @@ dwl: xdg-shell-protocol.o wlr-layer-shell-unstable-v1-protocol.o
clean:
rm -f dwl *.o *-protocol.h *-protocol.c
+install: dwl
+ install -D dwl $(PREFIX)/bin/dwl
+
.DEFAULT_GOAL=dwl
.PHONY: clean
diff --git a/README.md b/README.md
index fd83f92..c60b4b3 100644
--- a/README.md
+++ b/README.md
@@ -49,12 +49,6 @@ dwl can be run as-is, with no arguments. In an existing Wayland or X11 session,
You can also specify a startup program using the `-s` option. The argument to this option will be run at startup as a shell command (using `sh -c`) and can serve a similar function to `.xinitrc`: starting a service manager or other startup applications. Unlike `.xinitrc`, the display server will not shut down when this process terminates. Instead, as dwl is shutting down, it will send this process a SIGTERM and wait for it to terminate (if it hasn't already). This makes it ideal not only for initialization but also for execing into a user-level service manager like s6 or `systemd --user`.
-More/less verbose output can be requested with flags as well:
-
-* `-q`: quiet (log level WLR_SILENT)
-* `-v`: verbose (log level WLR_INFO)
-* `-d`: debug (log level WLR_DEBUG)
-
Note: 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)
diff --git a/config.def.h b/config.def.h
index 53021cf..2c11fd3 100644
--- a/config.def.h
+++ b/config.def.h
@@ -41,6 +41,11 @@ static const struct xkb_rule_names xkb_rules = {
.options = "ctrl:nocaps",
*/
};
+
+/* Trackpad */
+int tap_to_click = 1;
+int natural_scrolling = 1;
+
static const int repeat_rate = 25;
static const int repeat_delay = 600;
diff --git a/config.mk b/config.mk
index a101f23..3958049 100644
--- a/config.mk
+++ b/config.mk
@@ -1,3 +1,6 @@
+# paths
+PREFIX = /usr/local
+
# Default compile flags (overridable by environment)
CFLAGS ?= -g -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-error=unused-function
diff --git a/dwl.c b/dwl.c
index 414aa59..d25b5df 100644
--- a/dwl.c
+++ b/dwl.c
@@ -10,6 +10,7 @@
#include <sys/wait.h>
#include <time.h>
#include <unistd.h>
+#include <libinput.h>
#include <wayland-server-core.h>
#include <wlr/backend.h>
#include <wlr/render/wlr_renderer.h>
@@ -34,6 +35,7 @@
#include <wlr/types/wlr_xdg_decoration_v1.h>
#include <wlr/types/wlr_xdg_output_v1.h>
#include <wlr/types/wlr_xdg_shell.h>
+#include <wlr/backend/libinput.h>
#include <wlr/util/log.h>
#include <xkbcommon/xkbcommon.h>
#ifdef XWAYLAND
@@ -897,6 +899,15 @@ createlayersurface(struct wl_listener *listener, void *data)
void
createpointer(struct wlr_input_device *device)
{
+ struct libinput_device *libinput_device = (struct libinput_device*)
+ wlr_libinput_get_device_handle(device);
+
+ if (tap_to_click && libinput_device_config_tap_get_finger_count(libinput_device))
+ libinput_device_config_tap_set_enabled(libinput_device, LIBINPUT_CONFIG_TAP_ENABLED);
+
+ if (libinput_device_config_scroll_has_natural_scroll(libinput_device))
+ libinput_device_config_scroll_set_natural_scroll_enabled(libinput_device, natural_scrolling);
+
/* We don't do anything special with pointers. All of our pointer handling
* is proxied through wlr_cursor. On another compositor, you might take this
* opportunity to do libinput configuration on the device to set
@@ -1173,7 +1184,7 @@ keypress(struct wl_listener *listener, void *data)
int handled = 0;
uint32_t mods = wlr_keyboard_get_modifiers(kb->device->keyboard);
/* On _press_, attempt to process a compositor keybinding. */
- if (event->state == WLR_KEY_PRESSED)
+ if (event->state == WL_KEYBOARD_KEY_STATE_PRESSED)
for (i = 0; i < nsyms; i++)
handled = keybinding(mods, syms[i]) || handled;