Compare commits

..

No commits in common. "ffc3dfd6bfd62c08a5ce3fb82b896482218881c3" and "e9f05098d8bccc5a933309caf64870aa2ace0f23" have entirely different histories.

2 changed files with 4 additions and 14 deletions

View file

@ -99,7 +99,6 @@ static const Rule rules[] = {
{"Python3", NULL, NULL, 0, 1, 0, 1, -1}, {"Python3", NULL, NULL, 0, 1, 0, 1, -1},
//{ "" , NULL , NULL , 0 , 1 , 0 , 1 , -1 } , //{ "" , NULL , NULL , 0 , 1 , 0 , 1 , -1 } ,
{"St", NULL, NULL, 0, 0, 1, 0, -1}, {"St", NULL, NULL, 0, 0, 1, 0, -1},
{"ghostty", NULL, NULL, 0, 0, 1, 0, -1},
{"Firefox", NULL, NULL, 1 << 4, 0, 0, 0, -1}, {"Firefox", NULL, NULL, 1 << 4, 0, 0, 0, -1},
{"Navigator", NULL, NULL, 1 << 4, 0, 0, 0, -1}, {"Navigator", NULL, NULL, 1 << 4, 0, 0, 0, -1},
{"zen", NULL, NULL, 1 << 4, 0, 0, 0, -1}, {"zen", NULL, NULL, 1 << 4, 0, 0, 0, -1},
@ -146,7 +145,7 @@ static const Layout layouts[] = {
static char dmenumon[2] = static char dmenumon[2] =
"0"; /* component of dmenucmd, manipulated in spawn() */ "0"; /* component of dmenucmd, manipulated in spawn() */
static const char *dmenucmd[] = {"rofi", "-show", "drun", NULL}; static const char *dmenucmd[] = {"rofi", "-show", "drun", NULL};
static const char *termcmd[] = {"ghostty", NULL}; static const char *termcmd[] = {"st", NULL};
static const char scratchpadname[] = "scratchpad"; static const char scratchpadname[] = "scratchpad";
static const char *scratchpadcmd[] = {"st", "-t", scratchpadname, static const char *scratchpadcmd[] = {"st", "-t", scratchpadname,
"-g", "120x34", NULL}; "-g", "120x34", NULL};
@ -171,6 +170,7 @@ static Key keys[] = {
{MODKEY, XK_t, setlayout, {.v = &layouts[0]}}, {MODKEY, XK_t, setlayout, {.v = &layouts[0]}},
{MODKEY, XK_f, setlayout, {.v = &layouts[1]}}, {MODKEY, XK_f, setlayout, {.v = &layouts[1]}},
{MODKEY, XK_m, setlayout, {.v = &layouts[2]}}, {MODKEY, XK_m, setlayout, {.v = &layouts[2]}},
{MODKEY, XK_c, setlayout, {.v = &layouts[3]}},
{MODKEY, XK_space, setlayout, {0}}, {MODKEY, XK_space, setlayout, {0}},
{MODKEY | ShiftMask, XK_space, togglefloating, {0}}, {MODKEY | ShiftMask, XK_space, togglefloating, {0}},
{MODKEY, XK_comma, focusmon, {.i = -1}}, {MODKEY, XK_comma, focusmon, {.i = -1}},
@ -200,7 +200,7 @@ static Button buttons[] = {
{ClkWinTitle, 0, Button2, zoom, {0}}, {ClkWinTitle, 0, Button2, zoom, {0}},
{ClkStatusText, 0, Button2, spawn, {.v = termcmd}}, {ClkStatusText, 0, Button2, spawn, {.v = termcmd}},
{ClkClientWin, MODKEY, Button1, movemouse, {0}}, {ClkClientWin, MODKEY, Button1, movemouse, {0}},
// {ClkClientWin, MODKEY, Button2, togglefloating, {0}}, {ClkClientWin, MODKEY, Button2, togglefloating, {0}},
{ClkClientWin, MODKEY, Button3, resizemouse, {0}}, {ClkClientWin, MODKEY, Button3, resizemouse, {0}},
{ClkTagBar, 0, Button1, view, {0}}, {ClkTagBar, 0, Button1, view, {0}},
{ClkTagBar, 0, Button3, toggleview, {0}}, {ClkTagBar, 0, Button3, toggleview, {0}},

12
dwm.c
View file

@ -35,7 +35,6 @@
#include <string.h> #include <string.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <time.h>
#include <unistd.h> #include <unistd.h>
#ifdef XINERAMA #ifdef XINERAMA
#include <X11/extensions/Xinerama.h> #include <X11/extensions/Xinerama.h>
@ -53,7 +52,6 @@
/* macros */ /* macros */
#define MAX_LINE_LENGTH 1024 #define MAX_LINE_LENGTH 1024
#define CENTER_UPDATE_INTERVAL 1 /* seconds between updates */
#define BUTTONMASK (ButtonPressMask | ButtonReleaseMask) #define BUTTONMASK (ButtonPressMask | ButtonReleaseMask)
#define CLEANMASK(mask) \ #define CLEANMASK(mask) \
(mask & ~(numlockmask | LockMask) & \ (mask & ~(numlockmask | LockMask) & \
@ -1611,18 +1609,10 @@ void run(void) {
XEvent ev; XEvent ev;
/* main event loop */ /* main event loop */
XSync(dpy, False); XSync(dpy, False);
time_t last_update = 0; int ticks = 0;
while (running && !XNextEvent(dpy, &ev)) { while (running && !XNextEvent(dpy, &ev)) {
if (handler[ev.type]) if (handler[ev.type])
handler[ev.type](&ev); /* call handler */ handler[ev.type](&ev); /* call handler */
// Check for timeout-based center text update
time_t now = time(NULL);
if (now - last_update >= CENTER_UPDATE_INTERVAL) {
last_update = now;
drawbars();
}
} }
} }