mirror of
https://github.com/mintycube/dwm.git
synced 2024-10-22 12:05:45 +00: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:
|
### 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-14 - Added setborderpx, selfrestart and push (no master variant), sticky and warp patches
|
||||||
|
|
||||||
2019-09-13 - Added titlecolor and push 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
|
- 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".
|
- 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/)
|
- [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
|
- 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 normbgcolor[] = "#222222";
|
||||||
static char normbordercolor[] = "#444444";
|
static char normbordercolor[] = "#444444";
|
||||||
#if FLOAT_BORDER_COLOR_PATCH
|
#if FLOAT_BORDER_COLOR_PATCH
|
||||||
static char normflcolor[] = "#db8fd9";
|
static char normfloatcolor[] = "#db8fd9";
|
||||||
#endif // FLOAT_BORDER_COLOR_PATCH
|
#endif // FLOAT_BORDER_COLOR_PATCH
|
||||||
|
|
||||||
static char selfgcolor[] = "#eeeeee";
|
static char selfgcolor[] = "#eeeeee";
|
||||||
static char selbgcolor[] = "#005577";
|
static char selbgcolor[] = "#005577";
|
||||||
static char selbordercolor[] = "#005577";
|
static char selbordercolor[] = "#005577";
|
||||||
#if FLOAT_BORDER_COLOR_PATCH
|
#if FLOAT_BORDER_COLOR_PATCH
|
||||||
static char selflcolor[] = "#005577";
|
static char selfloatcolor[] = "#005577";
|
||||||
#endif // FLOAT_BORDER_COLOR_PATCH
|
#endif // FLOAT_BORDER_COLOR_PATCH
|
||||||
|
|
||||||
#if AWESOMEBAR_PATCH
|
#if AWESOMEBAR_PATCH
|
||||||
@ -44,7 +44,7 @@ static char hidfgcolor[] = "#005577";
|
|||||||
static char hidbgcolor[] = "#222222";
|
static char hidbgcolor[] = "#222222";
|
||||||
static char hidbordercolor[] = "#005577";
|
static char hidbordercolor[] = "#005577";
|
||||||
#if FLOAT_BORDER_COLOR_PATCH
|
#if FLOAT_BORDER_COLOR_PATCH
|
||||||
static char hidflcolor[] = "#f76e0c";
|
static char hidfloatcolor[] = "#f76e0c";
|
||||||
#endif // FLOAT_BORDER_COLOR_PATCH
|
#endif // FLOAT_BORDER_COLOR_PATCH
|
||||||
#endif // AWESOMEBAR_PATCH
|
#endif // AWESOMEBAR_PATCH
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ static char titlefgcolor[] = "#eeeeee";
|
|||||||
static char titlebgcolor[] = "#005577";
|
static char titlebgcolor[] = "#005577";
|
||||||
static char titlebordercolor[] = "#005577";
|
static char titlebordercolor[] = "#005577";
|
||||||
#if FLOAT_BORDER_COLOR_PATCH
|
#if FLOAT_BORDER_COLOR_PATCH
|
||||||
static char titleflcolor[] = "#005577";
|
static char titlefloatcolor[] = "#005577";
|
||||||
#endif // FLOAT_BORDER_COLOR_PATCH
|
#endif // FLOAT_BORDER_COLOR_PATCH
|
||||||
#endif // TITLECOLOR_PATCH
|
#endif // TITLECOLOR_PATCH
|
||||||
|
|
||||||
@ -73,19 +73,27 @@ static const unsigned int alphas[][3] = {
|
|||||||
};
|
};
|
||||||
#endif // ALPHA_PATCH
|
#endif // ALPHA_PATCH
|
||||||
#if FLOAT_BORDER_COLOR_PATCH
|
#if FLOAT_BORDER_COLOR_PATCH
|
||||||
static char *colors[][4] = {
|
static
|
||||||
/* fg bg border float */
|
#if !XRDB_PATCH
|
||||||
[SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor, normflcolor },
|
const
|
||||||
[SchemeSel] = { selfgcolor, selbgcolor, selbordercolor, selflcolor },
|
#endif // XRDB_PATCH
|
||||||
|
char *colors[][4] = {
|
||||||
|
/* fg bg border float */
|
||||||
|
[SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor, normfloatcolor },
|
||||||
|
[SchemeSel] = { selfgcolor, selbgcolor, selbordercolor, selfloatcolor },
|
||||||
#if AWESOMEBAR_PATCH
|
#if AWESOMEBAR_PATCH
|
||||||
[SchemeHid] = { hidfgcolor, hidbgcolor, hidbordercolor, hidflcolor },
|
[SchemeHid] = { hidfgcolor, hidbgcolor, hidbordercolor, hidfloatcolor },
|
||||||
#endif // AWESOMEBAR_PATCH
|
#endif // AWESOMEBAR_PATCH
|
||||||
#if TITLECOLOR_PATCH
|
#if TITLECOLOR_PATCH
|
||||||
[SchemeTitle] = { titlefgcolor, titlebgcolor, titlebordercolor, titleflcolor },
|
[SchemeTitle] = { titlefgcolor, titlebgcolor, titlebordercolor, titlefloatcolor },
|
||||||
#endif // TITLECOLOR_PATCH
|
#endif // TITLECOLOR_PATCH
|
||||||
};
|
};
|
||||||
#else
|
#else
|
||||||
static char *colors[][3] = {
|
static
|
||||||
|
#if !XRDB_PATCH
|
||||||
|
const
|
||||||
|
#endif // XRDB_PATCH
|
||||||
|
char *colors[][3] = {
|
||||||
/* fg bg border */
|
/* fg bg border */
|
||||||
[SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor },
|
[SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor },
|
||||||
[SchemeSel] = { selfgcolor, selbgcolor, selbordercolor },
|
[SchemeSel] = { selfgcolor, selbgcolor, selbordercolor },
|
||||||
@ -304,6 +312,9 @@ static Key keys[] = {
|
|||||||
{ MODKEY|ShiftMask, XK_r, self_restart, {0} },
|
{ MODKEY|ShiftMask, XK_r, self_restart, {0} },
|
||||||
#endif // SELFRESTART_PATCH
|
#endif // SELFRESTART_PATCH
|
||||||
{ MODKEY|ShiftMask, XK_q, quit, {0} },
|
{ MODKEY|ShiftMask, XK_q, quit, {0} },
|
||||||
|
#if WINVIEW_PATCH
|
||||||
|
{ MODKEY, XK_o, winview, {0} },
|
||||||
|
#endif // WINVIEW_PATCH
|
||||||
#if XRDB_PATCH
|
#if XRDB_PATCH
|
||||||
{ MODKEY|ShiftMask, XK_F5, xrdb, {.v = NULL } },
|
{ MODKEY|ShiftMask, XK_F5, xrdb, {.v = NULL } },
|
||||||
#endif // XRDB_PATCH
|
#endif // XRDB_PATCH
|
||||||
|
@ -86,6 +86,10 @@
|
|||||||
#include "warp.c"
|
#include "warp.c"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if WINVIEW_PATCH
|
||||||
|
#include "winview.c"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if ZOOMSWAP_PATCH
|
#if ZOOMSWAP_PATCH
|
||||||
#include "zoomswap.c"
|
#include "zoomswap.c"
|
||||||
#endif
|
#endif
|
||||||
|
@ -82,6 +82,10 @@
|
|||||||
#include "warp.h"
|
#include "warp.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if WINVIEW_PATCH
|
||||||
|
#include "winview.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if ZOOMSWAP_PATCH
|
#if ZOOMSWAP_PATCH
|
||||||
#include "zoomswap.h"
|
#include "zoomswap.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -43,7 +43,7 @@ char *get_dwm_path()
|
|||||||
perror("readlink:");
|
perror("readlink:");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
} while(r >= length);
|
} while (r >= length);
|
||||||
|
|
||||||
path[r] = '\0';
|
path[r] = '\0';
|
||||||
|
|
||||||
|
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.normbgcolor", normbgcolor);
|
||||||
XRDB_LOAD_COLOR("dwm.normbordercolor", normbordercolor);
|
XRDB_LOAD_COLOR("dwm.normbordercolor", normbordercolor);
|
||||||
#if FLOAT_BORDER_COLOR_PATCH
|
#if FLOAT_BORDER_COLOR_PATCH
|
||||||
XRDB_LOAD_COLOR("dwm.normflcolor", normflcolor);
|
XRDB_LOAD_COLOR("dwm.normfloatcolor", normfloatcolor);
|
||||||
#endif // FLOAT_BORDER_COLOR_PATCH
|
#endif // FLOAT_BORDER_COLOR_PATCH
|
||||||
|
|
||||||
XRDB_LOAD_COLOR("dwm.selfgcolor", selfgcolor);
|
XRDB_LOAD_COLOR("dwm.selfgcolor", selfgcolor);
|
||||||
XRDB_LOAD_COLOR("dwm.selbgcolor", selbgcolor);
|
XRDB_LOAD_COLOR("dwm.selbgcolor", selbgcolor);
|
||||||
XRDB_LOAD_COLOR("dwm.selbordercolor", selbordercolor);
|
XRDB_LOAD_COLOR("dwm.selbordercolor", selbordercolor);
|
||||||
#if FLOAT_BORDER_COLOR_PATCH
|
#if FLOAT_BORDER_COLOR_PATCH
|
||||||
XRDB_LOAD_COLOR("dwm.selflcolor", selflcolor);
|
XRDB_LOAD_COLOR("dwm.selfloatcolor", selfloatcolor);
|
||||||
#endif // FLOAT_BORDER_COLOR_PATCH
|
#endif // FLOAT_BORDER_COLOR_PATCH
|
||||||
|
|
||||||
#if AWESOMEBAR_PATCH
|
#if AWESOMEBAR_PATCH
|
||||||
@ -35,7 +35,7 @@ loadxrdb()
|
|||||||
XRDB_LOAD_COLOR("dwm.hidbgcolor", hidbgcolor);
|
XRDB_LOAD_COLOR("dwm.hidbgcolor", hidbgcolor);
|
||||||
XRDB_LOAD_COLOR("dwm.hidbordercolor", hidbordercolor);
|
XRDB_LOAD_COLOR("dwm.hidbordercolor", hidbordercolor);
|
||||||
#if FLOAT_BORDER_COLOR_PATCH
|
#if FLOAT_BORDER_COLOR_PATCH
|
||||||
XRDB_LOAD_COLOR("dwm.hidflcolor", hidflcolor);
|
XRDB_LOAD_COLOR("dwm.hidfloatcolor", hidfloatcolor);
|
||||||
#endif // FLOAT_BORDER_COLOR_PATCH
|
#endif // FLOAT_BORDER_COLOR_PATCH
|
||||||
#endif // AWESOMEBAR_PATCH
|
#endif // AWESOMEBAR_PATCH
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ loadxrdb()
|
|||||||
XRDB_LOAD_COLOR("dwm.titlebgcolor", titlebgcolor);
|
XRDB_LOAD_COLOR("dwm.titlebgcolor", titlebgcolor);
|
||||||
XRDB_LOAD_COLOR("dwm.titlebordercolor", titlebordercolor);
|
XRDB_LOAD_COLOR("dwm.titlebordercolor", titlebordercolor);
|
||||||
#if FLOAT_BORDER_COLOR_PATCH
|
#if FLOAT_BORDER_COLOR_PATCH
|
||||||
XRDB_LOAD_COLOR("dwm.titleflcolor", titleflcolor);
|
XRDB_LOAD_COLOR("dwm.titlefloatcolor", titlefloatcolor);
|
||||||
#endif // FLOAT_BORDER_COLOR_PATCH
|
#endif // FLOAT_BORDER_COLOR_PATCH
|
||||||
#endif // TITLECOLOR_PATCH
|
#endif // TITLECOLOR_PATCH
|
||||||
}
|
}
|
||||||
|
@ -285,7 +285,14 @@
|
|||||||
*/
|
*/
|
||||||
#define WINDOWROLERULE_PATCH 0
|
#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/
|
* https://dwm.suckless.org/patches/xrdb/
|
||||||
*/
|
*/
|
||||||
#define XRDB_PATCH 0
|
#define XRDB_PATCH 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user