mirror of
https://github.com/mintycube/dwm.git
synced 2024-10-22 12:05:45 +00:00
Adding swaptags patch
This commit is contained in:
parent
8cb609fa1e
commit
90a848d608
@ -15,6 +15,8 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
|
|||||||
|
|
||||||
### Changelog:
|
### Changelog:
|
||||||
|
|
||||||
|
2020-02-11 - Added swaptags patch
|
||||||
|
|
||||||
2020-02-09 - Added alternative scratchpad patch
|
2020-02-09 - Added alternative scratchpad patch
|
||||||
|
|
||||||
2020-02-02 - Added fsignal and transferall patches
|
2020-02-02 - Added fsignal and transferall patches
|
||||||
@ -313,6 +315,9 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
|
|||||||
- [swapfocus](https://dwm.suckless.org/patches/swapfocus/)
|
- [swapfocus](https://dwm.suckless.org/patches/swapfocus/)
|
||||||
- this patch depends on the pertag patch and makes it possible to switch focus with a single shortcut (mod-s) instead of having to think if you should use mod-j or mod-k for reaching the previously used window
|
- this patch depends on the pertag patch and makes it possible to switch focus with a single shortcut (mod-s) instead of having to think if you should use mod-j or mod-k for reaching the previously used window
|
||||||
|
|
||||||
|
- [swaptags](https://dwm.suckless.org/patches/swaptags/)
|
||||||
|
- allows swapping the contents of the currently selected tag with another tag by using keyboard shortcuts
|
||||||
|
|
||||||
- [switchcol](https://dwm.suckless.org/patches/switchcol/)
|
- [switchcol](https://dwm.suckless.org/patches/switchcol/)
|
||||||
- allows you to switch focus between the master and stack columns using a single keybinding
|
- allows you to switch focus between the master and stack columns using a single keybinding
|
||||||
|
|
||||||
|
@ -514,13 +514,15 @@ static const Layout layouts[] = {
|
|||||||
{ MODKEY, KEY, comboview, {.ui = 1 << TAG} }, \
|
{ MODKEY, KEY, comboview, {.ui = 1 << TAG} }, \
|
||||||
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
|
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
|
||||||
{ MODKEY|ShiftMask, KEY, combotag, {.ui = 1 << TAG} }, \
|
{ MODKEY|ShiftMask, KEY, combotag, {.ui = 1 << TAG} }, \
|
||||||
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
|
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, \
|
||||||
|
{ MODKEY|Mod4Mask|ShiftMask, KEY, swaptags, {.ui = 1 << TAG} },
|
||||||
#else
|
#else
|
||||||
#define TAGKEYS(KEY,TAG) \
|
#define TAGKEYS(KEY,TAG) \
|
||||||
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
|
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
|
||||||
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
|
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
|
||||||
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
|
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
|
||||||
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
|
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, \
|
||||||
|
{ MODKEY|Mod4Mask|ShiftMask, KEY, swaptags, {.ui = 1 << TAG} },
|
||||||
#endif // COMBO_PATCH
|
#endif // COMBO_PATCH
|
||||||
|
|
||||||
#if HOLDBAR_PATCH
|
#if HOLDBAR_PATCH
|
||||||
|
@ -113,6 +113,9 @@
|
|||||||
#if SWAPFOCUS_PATCH && PERTAG_PATCH
|
#if SWAPFOCUS_PATCH && PERTAG_PATCH
|
||||||
#include "swapfocus.c"
|
#include "swapfocus.c"
|
||||||
#endif
|
#endif
|
||||||
|
#if SWAPTAGS_PATCH
|
||||||
|
#include "swaptags.c"
|
||||||
|
#endif
|
||||||
#if SWITCHCOL_PATCH
|
#if SWITCHCOL_PATCH
|
||||||
#include "switchcol.c"
|
#include "switchcol.c"
|
||||||
#endif
|
#endif
|
||||||
|
@ -113,6 +113,9 @@
|
|||||||
#if SWAPFOCUS_PATCH && PERTAG_PATCH
|
#if SWAPFOCUS_PATCH && PERTAG_PATCH
|
||||||
#include "swapfocus.h"
|
#include "swapfocus.h"
|
||||||
#endif
|
#endif
|
||||||
|
#if SWAPTAGS_PATCH
|
||||||
|
#include "swaptags.h"
|
||||||
|
#endif
|
||||||
#if SWITCHCOL_PATCH
|
#if SWITCHCOL_PATCH
|
||||||
#include "switchcol.h"
|
#include "switchcol.h"
|
||||||
#endif
|
#endif
|
||||||
|
22
patch/swaptags.c
Normal file
22
patch/swaptags.c
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
void
|
||||||
|
swaptags(const Arg *arg)
|
||||||
|
{
|
||||||
|
unsigned int newtag = arg->ui & TAGMASK;
|
||||||
|
unsigned int curtag = selmon->tagset[selmon->seltags];
|
||||||
|
|
||||||
|
if (newtag == curtag || !curtag || (curtag & (curtag-1)))
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (Client *c = selmon->clients; c != NULL; c = c->next) {
|
||||||
|
if ((c->tags & newtag) || (c->tags & curtag))
|
||||||
|
c->tags ^= curtag ^ newtag;
|
||||||
|
|
||||||
|
if (!c->tags)
|
||||||
|
c->tags = newtag;
|
||||||
|
}
|
||||||
|
|
||||||
|
selmon->tagset[selmon->seltags] = newtag;
|
||||||
|
|
||||||
|
focus(NULL);
|
||||||
|
arrange(selmon);
|
||||||
|
}
|
1
patch/swaptags.h
Normal file
1
patch/swaptags.h
Normal file
@ -0,0 +1 @@
|
|||||||
|
static void swaptags(const Arg *arg);
|
@ -468,6 +468,12 @@
|
|||||||
*/
|
*/
|
||||||
#define SWAPFOCUS_PATCH 0
|
#define SWAPFOCUS_PATCH 0
|
||||||
|
|
||||||
|
/* This patch allows swapping the contents of the currently selected tag with another tag using
|
||||||
|
* keyboard shortcuts.
|
||||||
|
* https://dwm.suckless.org/patches/swaptags/
|
||||||
|
*/
|
||||||
|
#define SWAPTAGS_PATCH 0
|
||||||
|
|
||||||
/* Switch focus between the master and stack columns using a single keybinding.
|
/* Switch focus between the master and stack columns using a single keybinding.
|
||||||
* https://dwm.suckless.org/patches/switchcol/
|
* https://dwm.suckless.org/patches/switchcol/
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user