From def35721172f205c6934fa5a683f63f68342ddec Mon Sep 17 00:00:00 2001 From: "Devin J. Pohly" Date: Wed, 22 Apr 2020 11:20:08 -0500 Subject: add setlayout function --- dwl.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'dwl.c') diff --git a/dwl.c b/dwl.c index bba372f..d21a4dc 100644 --- a/dwl.c +++ b/dwl.c @@ -143,6 +143,7 @@ static void resize(Client *c, int x, int y, int w, int h); static void resizemouse(const Arg *arg); static void run(char *startup_cmd); static void setcursor(struct wl_listener *listener, void *data); +static void setlayout(const Arg *arg); static void setup(void); static void spawn(const Arg *arg); static void tile(Monitor *m); @@ -885,6 +886,16 @@ setcursor(struct wl_listener *listener, void *data) } } +void +setlayout(const Arg *arg) +{ + if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) + selmon->sellt ^= 1; + if (arg && arg->v) + selmon->lt[selmon->sellt] = (Layout *)arg->v; + /* XXX change layout symbol? */ +} + void setup(void) { -- cgit v1.2.3