sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

commit 424b0fe9257d48604dd4868350af6830f95dbaf4
parent 2162e22b7e662808401a7f94507e9755fcbd14f8
Author: Ricardo Jesus <rj.bcjesus@gmail.com>
Date:   Mon, 10 Feb 2020 15:34:49 +0000

[dwm][patch] swaptags (swap the contents of two tags)

Diffstat:
Adwm.suckless.org/patches/swaptags/dwm-swaptags-6.2.diff | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adwm.suckless.org/patches/swaptags/index.md | 15+++++++++++++++
2 files changed, 74 insertions(+), 0 deletions(-)

diff --git a/dwm.suckless.org/patches/swaptags/dwm-swaptags-6.2.diff b/dwm.suckless.org/patches/swaptags/dwm-swaptags-6.2.diff @@ -0,0 +1,59 @@ +From 66122d908f338538f4af0e09332dec80b90524d8 Mon Sep 17 00:00:00 2001 +From: Ricardo Jesus <rj.bcjesus@gmail.com> +Date: Sat, 29 Jun 2019 11:48:54 +0100 +Subject: [PATCH] Allow swapping the contents of two tags + +--- + config.def.h | 26 +++++++++++++++++++++++++- + 1 file changed, 25 insertions(+), 1 deletion(-) + +diff --git a/config.def.h b/config.def.h +index 1c0b587..701f8da 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -43,13 +43,16 @@ static const Layout layouts[] = { + { "[M]", monocle }, + }; + ++void swaptags(const Arg *arg); ++ + /* key definitions */ + #define MODKEY Mod1Mask + #define TAGKEYS(KEY,TAG) \ + { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ + { MODKEY|ControlMask, KEY, toggleview, {.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} }, \ ++ { Mod4Mask|ShiftMask, KEY, swaptags, {.ui = 1 << TAG} }, + + /* helper for spawning shell commands in the pre dwm-5.0 fashion */ + #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } +@@ -113,3 +116,24 @@ static Button buttons[] = { + { ClkTagBar, MODKEY, Button3, toggletag, {0} }, + }; + ++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); ++} +-- +2.22.0 + diff --git a/dwm.suckless.org/patches/swaptags/index.md b/dwm.suckless.org/patches/swaptags/index.md @@ -0,0 +1,15 @@ +swaptags +======== + +Description +----------- +Allow swapping the contents of the currently selected tag with tag N by +selecting Mod4+Shift+N. + +Download +-------- +* [dwm-swaptags-6.2.diff](dwm-swaptags-6.2.diff) (1.9K) + +Author +------ +* Ricardo J. Jesus <rj.bcjesus@gmail.com>