From a7ffed9020bebeea741266c249837336fa465989 Mon Sep 17 00:00:00 2001 From: Mouad Alami Date: Mon, 7 Aug 2023 11:32:37 +0100 Subject: Updated steam class name and added pause button for lenovo --- config.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config.h b/config.h index 2c02b9f..06ad154 100644 --- a/config.h +++ b/config.h @@ -47,7 +47,7 @@ static const Rule rules[] = { /* class instance title tags mask isfloating monitor */ { "Gimp", NULL, NULL, 1 << 5, 1, -1 }, { "discord", NULL, NULL, 1 << 3, 0, -1 }, - { "Steam", NULL, NULL, 1 << 4, 0, -1 }, + { "steam", NULL, NULL, 1 << 4, 0, -1 }, }; /* layout(s) */ @@ -152,6 +152,7 @@ static const Key keys[] = { {Mod1Mask, XK_F3, spawn, SHCMD("mpc next")}, {0, XK_Pause, spawn, SHCMD("playerctl play-pause")}, + {0, XF86XK_AudioPlay, spawn, SHCMD("playerctl play-pause")}, /* screenshot */ {MODKEY, XK_F12, spawn, SHCMD("scrot -e 'mv $f /home/mouad/Pictures/Screenshots/' && notify-send '📸 Screenshot taken'")}, -- cgit v1.2.3 From 9a59b1ec1aee0d49a1baaba2f27c1ca3ad1c8a0e Mon Sep 17 00:00:00 2001 From: Mouad Alami Date: Mon, 7 Aug 2023 11:48:25 +0100 Subject: fakefullscreen patch --- README | 2 +- config.h | 2 +- dwm.c | 30 +++--------------------------- 3 files changed, 5 insertions(+), 29 deletions(-) diff --git a/README b/README index eca7244..a75133d 100644 --- a/README +++ b/README @@ -49,4 +49,4 @@ and (re)compiling the source code. Patches applied --------------- -zoomswap - scratchpad - sticky - statuscmd - pertag - noborder - movestack - hide vacant tags - actualfullscreen - bar height - alpha monocle layout +zoomswap - scratchpad - sticky - statuscmd - pertag - noborder - movestack - hide vacant tags - actualfullscreen - bar height - alpha monocle layout - fakefullscreen diff --git a/config.h b/config.h index 06ad154..ba9c633 100644 --- a/config.h +++ b/config.h @@ -54,7 +54,7 @@ static const Rule rules[] = { static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ static const int nmaster = 1; /* number of clients in master area */ static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ -static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ +static const int lockfullscreen = 0; /* 1 will force focus on the fullscreen window */ static const Layout layouts[] = { /* symbol arrange function */ diff --git a/dwm.c b/dwm.c index c10f57b..19454f2 100644 --- a/dwm.c +++ b/dwm.c @@ -569,7 +569,7 @@ clientmessage(XEvent *e) if (cme->data.l[1] == netatom[NetWMFullscreen] || cme->data.l[2] == netatom[NetWMFullscreen]) setfullscreen(c, (cme->data.l[0] == 1 /* _NET_WM_STATE_ADD */ - || (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ && !c->isfullscreen))); + || cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */)); if (cme->data.l[1] == netatom[NetWMSticky] || cme->data.l[2] == netatom[NetWMSticky]) @@ -603,8 +603,7 @@ void configurenotify(XEvent *e) { Monitor *m; - Client *c; - XConfigureEvent *ev = &e->xconfigure; + XConfigureEvent *ev = &e->xconfigure; int dirty; /* TODO: updategeom handling sucks, needs to be simplified */ @@ -616,9 +615,6 @@ configurenotify(XEvent *e) drw_resize(drw, sw, bh); updatebars(); for (m = mons; m; m = m->next) { - for (c = m->clients; c; c = c->next) - if (c->isfullscreen) - resizeclient(c, m->mx, m->my, m->mw, m->mh); XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh); } focus(NULL); @@ -1284,8 +1280,6 @@ movemouse(const Arg *arg) if (!(c = selmon->sel)) return; - if (c->isfullscreen) /* no support moving fullscreen windows by mouse */ - return; restack(selmon); ocx = c->x; ocy = c->y; @@ -1447,8 +1441,6 @@ resizemouse(const Arg *arg) if (!(c = selmon->sel)) return; - if (c->isfullscreen) /* no support resizing fullscreen windows by mouse */ - return; restack(selmon); ocx = c->x; ocy = c->y; @@ -1625,24 +1617,10 @@ setfullscreen(Client *c, int fullscreen) XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1); c->isfullscreen = 1; - c->oldstate = c->isfloating; - c->oldbw = c->bw; - c->bw = 0; - c->isfloating = 1; - resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); - XRaiseWindow(dpy, c->win); } else if (!fullscreen && c->isfullscreen){ XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, PropModeReplace, (unsigned char*)0, 0); c->isfullscreen = 0; - c->isfloating = c->oldstate; - c->bw = c->oldbw; - c->x = c->oldx; - c->y = c->oldy; - c->w = c->oldw; - c->h = c->oldh; - resizeclient(c, c->x, c->y, c->w, c->h); - arrange(c->mon); } } @@ -1790,7 +1768,7 @@ showhide(Client *c) if (ISVISIBLE(c)) { /* show clients top down */ XMoveWindow(dpy, c->win, c->x, c->y); - if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) && !c->isfullscreen) + if (!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) resize(c, c->x, c->y, c->w, c->h, 0); showhide(c->snext); } else { @@ -1897,8 +1875,6 @@ togglefloating(const Arg *arg) { if (!selmon->sel) return; - if (selmon->sel->isfullscreen) /* no support for fullscreen windows */ - return; selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; if (selmon->sel->isfloating) resize(selmon->sel, selmon->sel->x, selmon->sel->y, -- cgit v1.2.3 From 941f42bb8cf70701cc247ea426444719e7606cb4 Mon Sep 17 00:00:00 2001 From: Mouad Alami Date: Mon, 7 Aug 2023 12:24:16 +0100 Subject: Revert "fakefullscreen patch" This reverts commit 9a59b1ec1aee0d49a1baaba2f27c1ca3ad1c8a0e. --- README | 2 +- config.h | 2 +- dwm.c | 30 +++++++++++++++++++++++++++--- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/README b/README index a75133d..eca7244 100644 --- a/README +++ b/README @@ -49,4 +49,4 @@ and (re)compiling the source code. Patches applied --------------- -zoomswap - scratchpad - sticky - statuscmd - pertag - noborder - movestack - hide vacant tags - actualfullscreen - bar height - alpha monocle layout - fakefullscreen +zoomswap - scratchpad - sticky - statuscmd - pertag - noborder - movestack - hide vacant tags - actualfullscreen - bar height - alpha monocle layout diff --git a/config.h b/config.h index ba9c633..06ad154 100644 --- a/config.h +++ b/config.h @@ -54,7 +54,7 @@ static const Rule rules[] = { static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ static const int nmaster = 1; /* number of clients in master area */ static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ -static const int lockfullscreen = 0; /* 1 will force focus on the fullscreen window */ +static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ static const Layout layouts[] = { /* symbol arrange function */ diff --git a/dwm.c b/dwm.c index 19454f2..c10f57b 100644 --- a/dwm.c +++ b/dwm.c @@ -569,7 +569,7 @@ clientmessage(XEvent *e) if (cme->data.l[1] == netatom[NetWMFullscreen] || cme->data.l[2] == netatom[NetWMFullscreen]) setfullscreen(c, (cme->data.l[0] == 1 /* _NET_WM_STATE_ADD */ - || cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */)); + || (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ && !c->isfullscreen))); if (cme->data.l[1] == netatom[NetWMSticky] || cme->data.l[2] == netatom[NetWMSticky]) @@ -603,7 +603,8 @@ void configurenotify(XEvent *e) { Monitor *m; - XConfigureEvent *ev = &e->xconfigure; + Client *c; + XConfigureEvent *ev = &e->xconfigure; int dirty; /* TODO: updategeom handling sucks, needs to be simplified */ @@ -615,6 +616,9 @@ configurenotify(XEvent *e) drw_resize(drw, sw, bh); updatebars(); for (m = mons; m; m = m->next) { + for (c = m->clients; c; c = c->next) + if (c->isfullscreen) + resizeclient(c, m->mx, m->my, m->mw, m->mh); XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh); } focus(NULL); @@ -1280,6 +1284,8 @@ movemouse(const Arg *arg) if (!(c = selmon->sel)) return; + if (c->isfullscreen) /* no support moving fullscreen windows by mouse */ + return; restack(selmon); ocx = c->x; ocy = c->y; @@ -1441,6 +1447,8 @@ resizemouse(const Arg *arg) if (!(c = selmon->sel)) return; + if (c->isfullscreen) /* no support resizing fullscreen windows by mouse */ + return; restack(selmon); ocx = c->x; ocy = c->y; @@ -1617,10 +1625,24 @@ setfullscreen(Client *c, int fullscreen) XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1); c->isfullscreen = 1; + c->oldstate = c->isfloating; + c->oldbw = c->bw; + c->bw = 0; + c->isfloating = 1; + resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); + XRaiseWindow(dpy, c->win); } else if (!fullscreen && c->isfullscreen){ XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, PropModeReplace, (unsigned char*)0, 0); c->isfullscreen = 0; + c->isfloating = c->oldstate; + c->bw = c->oldbw; + c->x = c->oldx; + c->y = c->oldy; + c->w = c->oldw; + c->h = c->oldh; + resizeclient(c, c->x, c->y, c->w, c->h); + arrange(c->mon); } } @@ -1768,7 +1790,7 @@ showhide(Client *c) if (ISVISIBLE(c)) { /* show clients top down */ XMoveWindow(dpy, c->win, c->x, c->y); - if (!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) + if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) && !c->isfullscreen) resize(c, c->x, c->y, c->w, c->h, 0); showhide(c->snext); } else { @@ -1875,6 +1897,8 @@ togglefloating(const Arg *arg) { if (!selmon->sel) return; + if (selmon->sel->isfullscreen) /* no support for fullscreen windows */ + return; selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; if (selmon->sel->isfloating) resize(selmon->sel, selmon->sel->x, selmon->sel->y, -- cgit v1.2.3 From 48c4a82ec30a106e9cab7d6bb2f6bfc99fa28094 Mon Sep 17 00:00:00 2001 From: Mouad Alami Date: Thu, 7 Sep 2023 13:24:10 +0100 Subject: remove notifications from keyboard layout change and update statusbar --- config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.h b/config.h index 06ad154..afe4ba1 100644 --- a/config.h +++ b/config.h @@ -127,8 +127,8 @@ static const Key keys[] = { {MODKEY | ShiftMask, XK_l, spawn, SHCMD("slock")}, /* keyboard layout */ - {Mod1Mask | ShiftMask, XK_e, spawn, SHCMD("setxkbmap -option caps:escape && setxkbmap -layout us && notify-send '🇬🇧'")}, - {Mod1Mask | ShiftMask, XK_f, spawn, SHCMD("setxkbmap -option caps:escape && setxkbmap -layout fr && notify-send '🇫🇷'")}, + {Mod1Mask | ShiftMask, XK_e, spawn, SHCMD("setxkbmap -option caps:escape && setxkbmap -layout us && kill -45 $(pidof dwmblocks)")}, + {Mod1Mask | ShiftMask, XK_f, spawn, SHCMD("setxkbmap -option caps:escape && setxkbmap -layout fr && kill -45 $(pidof dwmblocks)")}, /* dunst control */ -- cgit v1.2.3