aboutsummaryrefslogtreecommitdiff
path: root/dwl.c
diff options
context:
space:
mode:
authorDevin J. Pohly <djpohly@gmail.com>2020-04-22 11:20:08 -0500
committerDevin J. Pohly <djpohly@gmail.com>2020-04-22 11:20:23 -0500
commitdef35721172f205c6934fa5a683f63f68342ddec (patch)
treeaf44a140430f622a994e2dddfe2653f378a289c8 /dwl.c
parentfdbe9ee29a62eb19938b6a8a39cb7b208b84ec16 (diff)
add setlayout function
Diffstat (limited to 'dwl.c')
-rw-r--r--dwl.c11
1 files changed, 11 insertions, 0 deletions
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);
@@ -886,6 +887,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)
{
/* The backend is a wlroots feature which abstracts the underlying input and