From 2cb526bbd923383ae903130478033f3403bc5351 Mon Sep 17 00:00:00 2001 From: "Devin J. Pohly" Date: Thu, 23 Apr 2020 23:14:15 -0500 Subject: add chvt function It truly isn't just a window manager anymore :-| --- dwl.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'dwl.c') diff --git a/dwl.c b/dwl.c index 4922c6b..14b6fb6 100644 --- a/dwl.c +++ b/dwl.c @@ -126,6 +126,7 @@ struct render_data { static void arrange(Monitor *m); static void axisnotify(struct wl_listener *listener, void *data); static void buttonpress(struct wl_listener *listener, void *data); +static void chvt(const Arg *arg); static void createkeyboard(struct wlr_input_device *device); static void createmon(struct wl_listener *listener, void *data); static void createnotify(struct wl_listener *listener, void *data); @@ -229,6 +230,15 @@ axisnotify(struct wl_listener *listener, void *data) event->delta_discrete, event->source); } +void +chvt(const Arg *arg) +{ + struct wlr_session *s = wlr_backend_get_session(backend); + if (!s) + return; + wlr_session_change_vt(s, arg->ui); +} + void buttonpress(struct wl_listener *listener, void *data) { -- cgit v1.2.3