added fullscreen patch and status bar renders in all monitors

This commit is contained in:
Fernando 2022-10-24 23:08:05 -06:00
parent 3ead516da8
commit 5e39a05bdf
3 changed files with 22 additions and 2 deletions

7
.gitignore vendored Normal file
View File

@ -0,0 +1,7 @@
config.def.h.orig
drw.o
dwm
dwm.c.orig
dwm.c.rej
dwm.o
util.o

View File

@ -33,6 +33,7 @@ static const Rule rules[] = {
*/
/* class instance title tags mask isfloating monitor */
{ "Firefox", NULL, NULL, 1 << 8, 0, -1 },
{ "Pulseeffects", NULL, NULL, 1 << 2, 0, +1 },
{ NULL, NULL, "dragon", (1 << 9)-1, 1, -1 },
};
@ -132,6 +133,7 @@ static Key keys[] = {
{ MODKEY|ShiftMask, XK_m, setlayout, {.v = &layouts[11]} },
{ MODKEY, XK_space, setlayout, {0} },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
{ MODKEY|ShiftMask, XK_f, togglefullscr, {0} },
{ MODKEY, XK_0, view, {.ui = ~0 } },
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
{ MODKEY, XK_comma, focusmon, {.i = -1 } },

15
dwm.c
View File

@ -203,6 +203,7 @@ static int sendevent(Client *c, Atom proto);
static void sendmon(Client *c, Monitor *m);
static void setclientstate(Client *c, long state);
static void setfocus(Client *c);
static void togglefullscr(const Arg *arg);
static void setfullscreen(Client *c, int fullscreen);
static void setlayout(const Arg *arg);
static void setmfact(const Arg *arg);
@ -716,7 +717,7 @@ drawbar(Monitor *m)
Client *c;
/* draw status first so it can be overdrawn by tags later */
if (m == selmon) { /* status is only drawn on selected monitor */
if (m == selmon || 1) { /* status is only drawn on selected monitor */
drw_setscheme(drw, scheme[SchemeNorm]);
tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0);
@ -1721,6 +1722,13 @@ togglebar(const Arg *arg)
arrange(selmon);
}
void
togglefullscr(const Arg *arg)
{
if (selmon->sel)
setfullscreen(selmon->sel, !selmon->sel->isfullscreen);
}
void
togglefloating(const Arg *arg)
{
@ -2003,9 +2011,11 @@ updatesizehints(Client *c)
void
updatestatus(void)
{
Monitor *m;
if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext)))
strcpy(stext, "dwm-"VERSION);
drawbar(selmon);
for(m = mons; m; m = m->next)
drawbar(m);
}
void
@ -2163,3 +2173,4 @@ main(int argc, char *argv[])
XCloseDisplay(dpy);
return EXIT_SUCCESS;
}