mirror of
https://github.com/mintycube/dwm.git
synced 2024-10-22 14:05:45 +02:00
Adding shiftboth patch ref. #270
This commit is contained in:
parent
279c571986
commit
d3ab291944
@ -995,6 +995,10 @@ static Key keys[] = {
|
||||
{ MODKEY|Mod4Mask, XK_Tab, shiftviewclients, { .i = -1 } },
|
||||
{ MODKEY|Mod4Mask, XK_backslash, shiftviewclients, { .i = +1 } },
|
||||
#endif // SHIFTVIEW_CLIENTS_PATCH
|
||||
#if SHIFTBOTH_PATCH
|
||||
{ MODKEY|ControlMask, XK_Left, shiftboth, { .i = -1 } }, // note keybinding conflict with focusadjacenttag tagandviewtoleft
|
||||
{ MODKEY|ControlMask, XK_Right, shiftboth, { .i = +1 } }, // note keybinding conflict with focusadjacenttag tagandviewtoright
|
||||
#endif // SHIFTBOTH_PATCH
|
||||
#if BAR_WINTITLEACTIONS_PATCH
|
||||
{ MODKEY|ControlMask, XK_z, showhideclient, {0} },
|
||||
#endif // BAR_WINTITLEACTIONS_PATCH
|
||||
|
@ -232,6 +232,9 @@
|
||||
#if SETBORDERPX_PATCH
|
||||
#include "setborderpx.c"
|
||||
#endif
|
||||
#if SHIFTBOTH_PATCH
|
||||
#include "shiftboth.c"
|
||||
#endif
|
||||
#if SHIFTTAG_PATCH
|
||||
#include "shifttag.c"
|
||||
#endif
|
||||
|
@ -234,6 +234,9 @@
|
||||
#if SETBORDERPX_PATCH
|
||||
#include "setborderpx.h"
|
||||
#endif
|
||||
#if SHIFTBOTH_PATCH
|
||||
#include "shiftboth.h"
|
||||
#endif
|
||||
#if SHIFTTAG_PATCH
|
||||
#include "shifttag.h"
|
||||
#endif
|
||||
|
21
patch/shiftboth.c
Normal file
21
patch/shiftboth.c
Normal file
@ -0,0 +1,21 @@
|
||||
void
|
||||
shiftboth(const Arg *arg)
|
||||
{
|
||||
Arg shifted;
|
||||
#if SCRATCHPADS_PATCH && !RENAMED_SCRATCHPADS_PATCH
|
||||
shifted.ui = selmon->tagset[selmon->seltags];
|
||||
#else
|
||||
shifted.ui = selmon->tagset[selmon->seltags];
|
||||
#endif // SCRATCHPADS_PATCH
|
||||
|
||||
if (arg->i > 0) /* left circular shift */
|
||||
shifted.ui = ((shifted.ui << arg->i) | (shifted.ui >> (NUMTAGS - arg->i)));
|
||||
else /* right circular shift */
|
||||
shifted.ui = ((shifted.ui >> -arg->i) | (shifted.ui << (NUMTAGS + arg->i)));
|
||||
#if SCRATCHPADS_PATCH && !RENAMED_SCRATCHPADS_PATCH
|
||||
shifted.ui &= ~SPTAGMASK;
|
||||
#endif // SCRATCHPADS_PATCH
|
||||
|
||||
tag(&shifted);
|
||||
view(&shifted);
|
||||
}
|
1
patch/shiftboth.h
Normal file
1
patch/shiftboth.h
Normal file
@ -0,0 +1 @@
|
||||
static void shiftboth(const Arg *arg);
|
@ -968,6 +968,12 @@
|
||||
*/
|
||||
#define SETBORDERPX_PATCH 0
|
||||
|
||||
/* Combines shifttag and shiftview. Basically moves the window to the next/prev tag and follows it.
|
||||
* Also see the focusadjacenttag patch.
|
||||
* https://dwm.suckless.org/patches/shift-tools/
|
||||
*/
|
||||
#define SHIFTBOTH_PATCH 0
|
||||
|
||||
/* Moves the current selected client to the adjacent tag.
|
||||
* Also see the focusadjacenttag patch.
|
||||
* https://dwm.suckless.org/patches/shift-tools/
|
||||
|
Loading…
Reference in New Issue
Block a user