--- dwm.c.original	2022-01-07 13:42:00.000000000 +0200
+++ dwm.c	2022-03-30 08:02:00.000000000 +0300
@@ -275,6 +275,26 @@
 /* compile-time check if all tags fit into an unsigned int bit array. */
 struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
 
+#include <stdio.h>
+#include <time.h>
+
+#include <inttypes.h>
+void logwrite(char *s, char *q)
+{
+        char hostname[64]={0};
+        gethostname(hostname, 64);
+
+        time_t t = time(NULL);
+        struct tm tm = *localtime(&t);
+        char fname[128];
+        sprintf (fname, "/home/i/tmp/dwm-log-%s-%04d-%02d-%02d", hostname, tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday);
+        FILE *f=fopen (fname, "a");
+        if (f==NULL)
+                return;
+        fprintf (f, "%" PRId64 " %02d:%02d:%02d [%s] %s\n", t, tm.tm_hour, tm.tm_min, tm.tm_sec, s, q);
+        fclose (f);
+}
+
 /* function implementations */
 void
 applyrules(Client *c)
@@ -822,6 +842,10 @@
 void
 focusmon(const Arg *arg)
 {
+        char tmp[8];
+        snprintf (tmp, 8, "%d", arg->i);
+        logwrite ("focusmon", tmp);
+
 	Monitor *m;
 
 	if (!mons->next)
@@ -836,6 +860,10 @@
 void
 focusstack(const Arg *arg)
 {
+        char tmp[8];
+        snprintf (tmp, 8, "%d", arg->i);
+        logwrite ("focusstack", tmp);
+
 	Client *c = NULL, *i;
 
 	if (!selmon->sel || (selmon->sel->isfullscreen && lockfullscreen))
@@ -2005,6 +2033,7 @@
 		gettextprop(c->win, XA_WM_NAME, c->name, sizeof c->name);
 	if (c->name[0] == '\0') /* hack to mark broken clients */
 		strcpy(c->name, broken);
+        logwrite ("title", c->name);
 }
 
 void
@@ -2041,6 +2070,10 @@
 void
 view(const Arg *arg)
 {
+        char tmp[8];
+        snprintf (tmp, 8, "%d", arg->ui);
+        logwrite ("view", tmp);
+
 	if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
 		return;
 	selmon->seltags ^= 1; /* toggle sel tagset */
