Compare commits
3 commits
e9f05098d8
...
ffc3dfd6bf
Author | SHA1 | Date | |
---|---|---|---|
ffc3dfd6bf | |||
94232212fa | |||
42a3e4ae85 |
2 changed files with 14 additions and 4 deletions
6
config.h
6
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}},
|
||||
|
|
12
dwm.c
12
dwm.c
|
@ -35,6 +35,7 @@
|
|||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#ifdef XINERAMA
|
||||
#include <X11/extensions/Xinerama.h>
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue