mirror of
https://github.com/mintycube/dwm.git
synced 2024-10-22 14:05:45 +02:00
Adding winview patch
This commit is contained in:
parent
f8f67508d8
commit
f60b0b5121
@ -13,6 +13,8 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
|
||||
|
||||
### Changelog:
|
||||
|
||||
2019-09-15 - Added xrdb and winview patches
|
||||
|
||||
2019-09-14 - Added setborderpx, selfrestart and push (no master variant), sticky and warp patches
|
||||
|
||||
2019-09-13 - Added titlecolor and push patches
|
||||
@ -162,6 +164,12 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
|
||||
- sometimes a single application opens different windows depending on the task at hand and this is often reflected in the WM_WINDOW_ROLE(STRING) x property
|
||||
- this patch adds the role field to the rule configuration so that one can differentiate between, say, Firefox "browser" vs "Preferences" vs "Manager" or Google-chrome "browser" vs "pop-up".
|
||||
|
||||
- [winview](http://dwm.suckless.org/patches/winview/)
|
||||
- allows switching the view to that of a given client from the all-window view (Mod-0) using a keyboard shortcut
|
||||
|
||||
- [xrdb](http://dwm.suckless.org/patches/xrdb/)
|
||||
- allows dwm to read colors from xrdb (.Xresources) during runtime
|
||||
|
||||
- [zoomswap](https://dwm.suckless.org/patches/zoomswap/)
|
||||
- allows a master and a stack window to swap places rather than every window on the screen changing position
|
||||
|
||||
|
33
config.def.h
33
config.def.h
@ -29,14 +29,14 @@ static char normfgcolor[] = "#bbbbbb";
|
||||
static char normbgcolor[] = "#222222";
|
||||
static char normbordercolor[] = "#444444";
|
||||
#if FLOAT_BORDER_COLOR_PATCH
|
||||
static char normflcolor[] = "#db8fd9";
|
||||
static char normfloatcolor[] = "#db8fd9";
|
||||
#endif // FLOAT_BORDER_COLOR_PATCH
|
||||
|
||||
static char selfgcolor[] = "#eeeeee";
|
||||
static char selbgcolor[] = "#005577";
|
||||
static char selbordercolor[] = "#005577";
|
||||
#if FLOAT_BORDER_COLOR_PATCH
|
||||
static char selflcolor[] = "#005577";
|
||||
static char selfloatcolor[] = "#005577";
|
||||
#endif // FLOAT_BORDER_COLOR_PATCH
|
||||
|
||||
#if AWESOMEBAR_PATCH
|
||||
@ -44,7 +44,7 @@ static char hidfgcolor[] = "#005577";
|
||||
static char hidbgcolor[] = "#222222";
|
||||
static char hidbordercolor[] = "#005577";
|
||||
#if FLOAT_BORDER_COLOR_PATCH
|
||||
static char hidflcolor[] = "#f76e0c";
|
||||
static char hidfloatcolor[] = "#f76e0c";
|
||||
#endif // FLOAT_BORDER_COLOR_PATCH
|
||||
#endif // AWESOMEBAR_PATCH
|
||||
|
||||
@ -53,7 +53,7 @@ static char titlefgcolor[] = "#eeeeee";
|
||||
static char titlebgcolor[] = "#005577";
|
||||
static char titlebordercolor[] = "#005577";
|
||||
#if FLOAT_BORDER_COLOR_PATCH
|
||||
static char titleflcolor[] = "#005577";
|
||||
static char titlefloatcolor[] = "#005577";
|
||||
#endif // FLOAT_BORDER_COLOR_PATCH
|
||||
#endif // TITLECOLOR_PATCH
|
||||
|
||||
@ -73,19 +73,27 @@ static const unsigned int alphas[][3] = {
|
||||
};
|
||||
#endif // ALPHA_PATCH
|
||||
#if FLOAT_BORDER_COLOR_PATCH
|
||||
static char *colors[][4] = {
|
||||
/* fg bg border float */
|
||||
[SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor, normflcolor },
|
||||
[SchemeSel] = { selfgcolor, selbgcolor, selbordercolor, selflcolor },
|
||||
static
|
||||
#if !XRDB_PATCH
|
||||
const
|
||||
#endif // XRDB_PATCH
|
||||
char *colors[][4] = {
|
||||
/* fg bg border float */
|
||||
[SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor, normfloatcolor },
|
||||
[SchemeSel] = { selfgcolor, selbgcolor, selbordercolor, selfloatcolor },
|
||||
#if AWESOMEBAR_PATCH
|
||||
[SchemeHid] = { hidfgcolor, hidbgcolor, hidbordercolor, hidflcolor },
|
||||
[SchemeHid] = { hidfgcolor, hidbgcolor, hidbordercolor, hidfloatcolor },
|
||||
#endif // AWESOMEBAR_PATCH
|
||||
#if TITLECOLOR_PATCH
|
||||
[SchemeTitle] = { titlefgcolor, titlebgcolor, titlebordercolor, titleflcolor },
|
||||
[SchemeTitle] = { titlefgcolor, titlebgcolor, titlebordercolor, titlefloatcolor },
|
||||
#endif // TITLECOLOR_PATCH
|
||||
};
|
||||
#else
|
||||
static char *colors[][3] = {
|
||||
static
|
||||
#if !XRDB_PATCH
|
||||
const
|
||||
#endif // XRDB_PATCH
|
||||
char *colors[][3] = {
|
||||
/* fg bg border */
|
||||
[SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor },
|
||||
[SchemeSel] = { selfgcolor, selbgcolor, selbordercolor },
|
||||
@ -304,6 +312,9 @@ static Key keys[] = {
|
||||
{ MODKEY|ShiftMask, XK_r, self_restart, {0} },
|
||||
#endif // SELFRESTART_PATCH
|
||||
{ MODKEY|ShiftMask, XK_q, quit, {0} },
|
||||
#if WINVIEW_PATCH
|
||||
{ MODKEY, XK_o, winview, {0} },
|
||||
#endif // WINVIEW_PATCH
|
||||
#if XRDB_PATCH
|
||||
{ MODKEY|ShiftMask, XK_F5, xrdb, {.v = NULL } },
|
||||
#endif // XRDB_PATCH
|
||||
|
@ -86,6 +86,10 @@
|
||||
#include "warp.c"
|
||||
#endif
|
||||
|
||||
#if WINVIEW_PATCH
|
||||
#include "winview.c"
|
||||
#endif
|
||||
|
||||
#if ZOOMSWAP_PATCH
|
||||
#include "zoomswap.c"
|
||||
#endif
|
||||
|
@ -82,6 +82,10 @@
|
||||
#include "warp.h"
|
||||
#endif
|
||||
|
||||
#if WINVIEW_PATCH
|
||||
#include "winview.h"
|
||||
#endif
|
||||
|
||||
#if ZOOMSWAP_PATCH
|
||||
#include "zoomswap.h"
|
||||
#endif
|
||||
|
@ -43,7 +43,7 @@ char *get_dwm_path()
|
||||
perror("readlink:");
|
||||
return NULL;
|
||||
}
|
||||
} while(r >= length);
|
||||
} while (r >= length);
|
||||
|
||||
path[r] = '\0';
|
||||
|
||||
@ -65,4 +65,4 @@ void self_restart(const Arg *arg)
|
||||
}
|
||||
|
||||
execv(argv[0], argv);
|
||||
}
|
||||
}
|
||||
|
20
patch/winview.c
Normal file
20
patch/winview.c
Normal file
@ -0,0 +1,20 @@
|
||||
/* Selects for the view of the focused window. The list of tags */
|
||||
/* to be displayed is matched to the focused window tag list. */
|
||||
void
|
||||
winview(const Arg* arg)
|
||||
{
|
||||
Window win, win_r, win_p, *win_c;
|
||||
unsigned nc;
|
||||
int unused;
|
||||
Client* c;
|
||||
Arg a;
|
||||
|
||||
if (!XGetInputFocus(dpy, &win, &unused)) return;
|
||||
while (XQueryTree(dpy, win, &win_r, &win_p, &win_c, &nc)
|
||||
&& win_p != win_r) win = win_p;
|
||||
|
||||
if (!(c = wintoclient(win))) return;
|
||||
|
||||
a.ui = c->tags;
|
||||
view(&a);
|
||||
}
|
1
patch/winview.h
Normal file
1
patch/winview.h
Normal file
@ -0,0 +1 @@
|
||||
static void winview(const Arg* arg);
|
@ -20,14 +20,14 @@ loadxrdb()
|
||||
XRDB_LOAD_COLOR("dwm.normbgcolor", normbgcolor);
|
||||
XRDB_LOAD_COLOR("dwm.normbordercolor", normbordercolor);
|
||||
#if FLOAT_BORDER_COLOR_PATCH
|
||||
XRDB_LOAD_COLOR("dwm.normflcolor", normflcolor);
|
||||
XRDB_LOAD_COLOR("dwm.normfloatcolor", normfloatcolor);
|
||||
#endif // FLOAT_BORDER_COLOR_PATCH
|
||||
|
||||
XRDB_LOAD_COLOR("dwm.selfgcolor", selfgcolor);
|
||||
XRDB_LOAD_COLOR("dwm.selbgcolor", selbgcolor);
|
||||
XRDB_LOAD_COLOR("dwm.selbordercolor", selbordercolor);
|
||||
#if FLOAT_BORDER_COLOR_PATCH
|
||||
XRDB_LOAD_COLOR("dwm.selflcolor", selflcolor);
|
||||
XRDB_LOAD_COLOR("dwm.selfloatcolor", selfloatcolor);
|
||||
#endif // FLOAT_BORDER_COLOR_PATCH
|
||||
|
||||
#if AWESOMEBAR_PATCH
|
||||
@ -35,7 +35,7 @@ loadxrdb()
|
||||
XRDB_LOAD_COLOR("dwm.hidbgcolor", hidbgcolor);
|
||||
XRDB_LOAD_COLOR("dwm.hidbordercolor", hidbordercolor);
|
||||
#if FLOAT_BORDER_COLOR_PATCH
|
||||
XRDB_LOAD_COLOR("dwm.hidflcolor", hidflcolor);
|
||||
XRDB_LOAD_COLOR("dwm.hidfloatcolor", hidfloatcolor);
|
||||
#endif // FLOAT_BORDER_COLOR_PATCH
|
||||
#endif // AWESOMEBAR_PATCH
|
||||
|
||||
@ -44,7 +44,7 @@ loadxrdb()
|
||||
XRDB_LOAD_COLOR("dwm.titlebgcolor", titlebgcolor);
|
||||
XRDB_LOAD_COLOR("dwm.titlebordercolor", titlebordercolor);
|
||||
#if FLOAT_BORDER_COLOR_PATCH
|
||||
XRDB_LOAD_COLOR("dwm.titleflcolor", titleflcolor);
|
||||
XRDB_LOAD_COLOR("dwm.titlefloatcolor", titlefloatcolor);
|
||||
#endif // FLOAT_BORDER_COLOR_PATCH
|
||||
#endif // TITLECOLOR_PATCH
|
||||
}
|
||||
|
@ -285,7 +285,14 @@
|
||||
*/
|
||||
#define WINDOWROLERULE_PATCH 0
|
||||
|
||||
/* Allows dwm to read colors from xrdb (.Xresources) at run time.
|
||||
/* The winview patch allows switching the view to that of a given client from the all-window
|
||||
* view (Mod-0) using a keyboard shortcut.
|
||||
* http://dwm.suckless.org/patches/winview/
|
||||
*/
|
||||
#define WINVIEW_PATCH 0
|
||||
|
||||
/* Allows dwm to read colors from xrdb (.Xresources) during runtime. Compatible with
|
||||
* the float border color, awesomebar and titlecolor patches.
|
||||
* https://dwm.suckless.org/patches/xrdb/
|
||||
*/
|
||||
#define XRDB_PATCH 0
|
||||
|
Loading…
Reference in New Issue
Block a user