about summary refs log tree commit diff
path: root/dwm.c
diff options
context:
space:
mode:
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c55
1 files changed, 53 insertions, 2 deletions
diff --git a/dwm.c b/dwm.c
index bf4f942..13eb462 100644
--- a/dwm.c
+++ b/dwm.c
@@ -157,6 +157,13 @@ static void arrange(Monitor *m);
 static void arrangemon(Monitor *m);
 static void attach(Client *c);
 static void attachstack(Client *c);
+void setlayoutex(const Arg *arg);
+void viewex(const Arg *arg);
+void viewall(const Arg *arg);
+void toggleviewex(const Arg *arg);
+void tagex(const Arg *arg);
+void toggletagex(const Arg *arg);
+void tagall(const Arg *arg);
 static int fake_signal(void);
 static void buttonpress(XEvent *e);
 static void checkotherwm(void);
@@ -1020,6 +1027,48 @@ keypress(XEvent *e)
 			keys[i].func(&(keys[i].arg));
 }**/
 
+void
+setlayoutex(const Arg *arg)
+{
+        setlayout(&((Arg) { .v = &layouts[arg->i] }));
+}
+
+void
+viewex(const Arg *arg)
+{
+        view(&((Arg) { .ui = 1 << (arg->ui - 1)}));
+}
+
+void
+viewall(const Arg *arg)
+{
+        view(&((Arg){.ui = ~0}));
+}
+
+void
+toggleviewex(const Arg *arg)
+{
+        toggleview(&((Arg) { .ui = 1 << (arg->ui - 1)}));
+}
+
+void
+tagex(const Arg *arg)
+{
+        tag(&((Arg) { .ui = 1 << (arg->ui - 1)}));
+}
+
+void
+toggletagex(const Arg *arg)
+{
+        toggletag(&((Arg) { .ui = 1 << (arg->ui - 1)}));
+}
+
+void
+tagall(const Arg *arg)
+{
+        tag(&((Arg){.ui = ~0}));
+}
+
 int
 fake_signal(void)
 {
@@ -1052,8 +1101,10 @@ fake_signal(void)
                         // Check if a signal was found, and if so handle it
                         for (i = 0; i < LENGTH(signals); i++)
                                 if (strncmp(str_sig, signals[i].sig, len_str_sig) == 0 && signals[i].func)
-                                        signals[i].func(&(arg));
-
+                                {
+                                    signals[i].func(&(arg));
+                                    return 1;
+                                }
                         // A fake signal was sent
                         return 1;
                 }