]> git.lizzy.rs Git - bspwm.git/commitdiff
New message: 'swap'
authorBastien Dejean <nihilhill@gmail.com>
Wed, 9 Jan 2013 20:45:18 +0000 (21:45 +0100)
committerBastien Dejean <nihilhill@gmail.com>
Wed, 9 Jan 2013 20:45:18 +0000 (21:45 +0100)
README.md
TODO.md
bspwm.1
messages.c

index 3aa63771804e942fbb63183667178111a344db73..a97b9a4719ade632e15d8596d7350f37df75184c 100644 (file)
--- a/README.md
+++ b/README.md
@@ -116,6 +116,9 @@ The following messages are handled:
     shift left|right|up|down
         Exchange the current window with the given neighbor.
 
+    swap
+        Swap the focused window with the last focused window.
+
     push left|right|up|down
         Push the fence located in the given direction.
 
diff --git a/TODO.md b/TODO.md
index 516e4a1e6eae744f1c2c1a3670a63a73b5ca8dc7..e57d336cbf6d742d3f5347bdf535f57d42657ad2 100644 (file)
--- a/TODO.md
+++ b/TODO.md
@@ -1,5 +1,4 @@
 - Window move/resize pointer cursor feedbacks (via *util-cursor*).
-- Swap with last focused window message.
 - Grow/shrink through swap.
 - Send to previous/next desktop.
 - Command line completion for *bspc*.
diff --git a/bspwm.1 b/bspwm.1
index 6087d22c6313e1158c05602ee1b29f964ad64835..2c01e11246422f1026556a0b38054db0615f9944 100644 (file)
--- a/bspwm.1
+++ b/bspwm.1
@@ -141,6 +141,9 @@ Focus the neighbor window situated in the given direction.
 .BI shift " left|right|up|down"
 Exchange the current window with the given neighbor.
 .TP
+.BI swap
+Swap the focused window with the last focused window.
+.TP
 .BI push " left|right|up|down"
 Push the fence located in the given direction.
 .TP
index 968e4b5f88967579a067b51cd0cc50f9c79b8ca3..27ff3cef8dfc4a45042d432434d0b72552498101 100644 (file)
@@ -346,6 +346,8 @@ void process_message(char *msg, char *rsp)
             if (sscanf(arg, "%X", &uid) > 0)
                 remove_rule_by_uid(uid);
         return;
+    } else if (strcmp(cmd, "swap") == 0) {
+        swap_nodes(mon->desk->focus, mon->desk->last_focus);
     } else if (strcmp(cmd, "alternate") == 0) {
         focus_node(mon, mon->desk, mon->desk->last_focus, true);
         return;