about summary refs log tree commit diff
path: root/config.h
diff options
context:
space:
mode:
authorYour Name <you@example.com>2020-10-21 20:03:55 +0100
committerYour Name <you@example.com>2020-10-21 20:03:55 +0100
commit61fb8628182db20d974eb63cedf41dceb7abf14c (patch)
tree583539acf5622edc8f642bf881dd181f14b89ba3 /config.h
parentRemove scripts (diff)
downloaddwm-61fb8628182db20d974eb63cedf41dceb7abf14c.tar.gz
dwm-61fb8628182db20d974eb63cedf41dceb7abf14c.tar.bz2
dwm-61fb8628182db20d974eb63cedf41dceb7abf14c.zip
Removed keyhandling functionality
Diffstat (limited to 'config.h')
-rw-r--r--config.h91
1 files changed, 80 insertions, 11 deletions
diff --git a/config.h b/config.h
index 7cdf81d..dc270f9 100644
--- a/config.h
+++ b/config.h
@@ -39,14 +39,14 @@ static const unsigned int alphas[][3]      = {
 /* tagging */
 static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
 
-static const Rule rules[] = {
+/*static const Rule rules[] = {
 	/* xprop(1):
 	 *	WM_CLASS(STRING) = instance, class
 	 *	WM_NAME(STRING) = title
 	 */
 	 /* class      instance    title       tags mask     isfloating   monitor */
-	 	{ NULL,      NULL,       NULL,       0,            False,       -1 },
-};
+/*	 	{ NULL,      NULL,       NULL,       0,            False,       -1 },
+};*/
 
 /* layout(s) */
 static const float mfact     = 0.50; /* factor of master area size [0.05..0.95] */
@@ -78,12 +78,10 @@ static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont,
 static const char *termcmd[]  = { "st", NULL };
 
 #include "movestack.c"
-static Key keys[] = {
+/*static Key keys[] = {
 	/* modifier                     key        function        argument */
-  /*
-	{ MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
+	/*{ MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
   { MODKEY|ShiftMask,             XK_Return, spawn,          {.v = termcmd } },
-	*/
 	{ MODKEY,                       XK_b,      togglebar,      {0} },
 	{ MODKEY,                       XK_j,		   focusstack,		 {.i = +1 } },
 	{ MODKEY,                       XK_k,		   focusstack,		 {.i = -1 } },
@@ -98,11 +96,9 @@ static Key keys[] = {
 	{ NULL,                         XK_F11,    togglefullscreen,{0}},
 	{ MODKEY,                       XK_Tab,    view,           {0} },
 	{ MODKEY,                       XK_q,      killclient,     {0} },
-	/*
 	{ MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
 	{ MODKEY,                       XK_f,      setlayout,      {.v = &layouts[1]} },
 	{ MODKEY,                       XK_m,      setlayout,      {.v = &layouts[2]} },
-	*/
 	{ MODKEY|ControlMask,		        XK_comma,  cyclelayout,    {.i = -1 } },
 	{ MODKEY|ControlMask,           XK_period, cyclelayout,    {.i = +1 } },
 	{ MODKEY,                       XK_space,  setlayout,      {0} },
@@ -123,8 +119,7 @@ static Key keys[] = {
 	TAGKEYS(                        XK_8,                      7)
 	TAGKEYS(                        XK_9,                      8)
 	{ MODKEY|ShiftMask,             XK_q,      quit,           {0} },
-
-};
+};/*
 
 /* button definitions */
 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
@@ -142,3 +137,77 @@ static Button buttons[] = {
 	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
 	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
 };
+
+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}));
+}
+
+/* signal definitions */
+/* signum must be greater than 0 */
+/* trigger signals using `xsetroot -name "fsignal:<signame> [<type> <value>]"` */
+static Signal signals[] = {
+	/* signum           function */
+	{ "focusstack",     focusstack },
+	{ "movestack",      movestack },
+    { "setmfact",       setmfact },
+	{ "togglebar",      togglebar },
+	{ "incnmaster",     incnmaster },
+	{ "togglefloating", togglefloating },
+    { "togglefullscreen", togglefullscreen },
+    { "focusmon",       focusmon },
+	{ "tagmon",         tagmon },
+	{ "zoom",           zoom },
+	{ "view",           view },
+	{ "viewall",        viewall },
+	{ "viewex",         viewex },
+	{ "toggleview",     view },
+	{ "toggleviewex",   toggleviewex },
+	{ "tag",            tag },
+	{ "tagall",         tagall },
+	{ "tagex",          tagex },
+	{ "toggletag",      tag },
+	{ "toggletagex",    toggletagex },
+	{ "killclient",     killclient },
+	{ "quit",           quit },
+	{ "setlayout",      setlayout },
+	{ "setlayoutex",    setlayoutex },
+	{ "cyclelayout",    cyclelayout },
+};