diff --git a/config.h b/config.h index c05101f..a94fca4 100644 --- a/config.h +++ b/config.h @@ -99,6 +99,7 @@ static const Rule rules[] = { {"Python3", NULL, NULL, 0, 1, 0, 1, -1}, //{ "" , NULL , NULL , 0 , 1 , 0 , 1 , -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}, {"Navigator", NULL, NULL, 1 << 4, 0, 0, 0, -1}, {"zen", NULL, NULL, 1 << 4, 0, 0, 0, -1}, @@ -145,7 +146,7 @@ static const Layout layouts[] = { static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ static const char *dmenucmd[] = {"rofi", "-show", "drun", NULL}; -static const char *termcmd[] = {"st", NULL}; +static const char *termcmd[] = {"ghostty", NULL}; static const char scratchpadname[] = "scratchpad"; static const char *scratchpadcmd[] = {"st", "-t", scratchpadname, "-g", "120x34", NULL}; @@ -170,7 +171,6 @@ static Key keys[] = { {MODKEY, XK_t, setlayout, {.v = &layouts[0]}}, {MODKEY, XK_f, setlayout, {.v = &layouts[1]}}, {MODKEY, XK_m, setlayout, {.v = &layouts[2]}}, - {MODKEY, XK_c, setlayout, {.v = &layouts[3]}}, {MODKEY, XK_space, setlayout, {0}}, {MODKEY | ShiftMask, XK_space, togglefloating, {0}}, {MODKEY, XK_comma, focusmon, {.i = -1}}, @@ -200,7 +200,7 @@ static Button buttons[] = { {ClkWinTitle, 0, Button2, zoom, {0}}, {ClkStatusText, 0, Button2, spawn, {.v = termcmd}}, {ClkClientWin, MODKEY, Button1, movemouse, {0}}, - {ClkClientWin, MODKEY, Button2, togglefloating, {0}}, + // {ClkClientWin, MODKEY, Button2, togglefloating, {0}}, {ClkClientWin, MODKEY, Button3, resizemouse, {0}}, {ClkTagBar, 0, Button1, view, {0}}, {ClkTagBar, 0, Button3, toggleview, {0}}, diff --git a/dwm.c b/dwm.c index 02892b4..03e4233 100644 --- a/dwm.c +++ b/dwm.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #ifdef XINERAMA #include @@ -52,6 +53,7 @@ /* macros */ #define MAX_LINE_LENGTH 1024 +#define CENTER_UPDATE_INTERVAL 1 /* seconds between updates */ #define BUTTONMASK (ButtonPressMask | ButtonReleaseMask) #define CLEANMASK(mask) \ (mask & ~(numlockmask | LockMask) & \ @@ -1609,10 +1611,18 @@ void run(void) { XEvent ev; /* main event loop */ XSync(dpy, False); - int ticks = 0; + time_t last_update = 0; + while (running && !XNextEvent(dpy, &ev)) { if (handler[ev.type]) 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(); + } } }