]> git.lizzy.rs Git - bspwm.git/commitdiff
Handle optional desktop name in 'list'
authorBastien Dejean <nihilhill@gmail.com>
Sun, 11 Nov 2012 18:05:12 +0000 (19:05 +0100)
committerBastien Dejean <nihilhill@gmail.com>
Sun, 11 Nov 2012 18:05:12 +0000 (19:05 +0100)
README.md
bspwm.1
messages.c

index 2486770c991d4acfbc91e68253297647d8ff4bf0..a3598c433ee717443c6109452635f19c9c47f345 100644 (file)
--- a/README.md
+++ b/README.md
@@ -77,7 +77,7 @@ The following messages are handled:
     set SETTING VALUE
         Set the value of the given setting.
 
-    list
+    list [DESKTOP_NAME]
         Output the internal representation of the window tree.
 
     list_desktops [--quiet]
diff --git a/bspwm.1 b/bspwm.1
index 2e3114cd727935873ca08ed67c8d70e015293251..b06219dd7346b4662a2f042e063b1dd9b5cd85f7 100644 (file)
--- a/bspwm.1
+++ b/bspwm.1
@@ -104,7 +104,7 @@ Return the value of the given setting.
 .BI set " SETTING VALUE"
 Set the value of the given setting.
 .TP
-.BI list
+.BI list " [DESKTOP_NAME]"
 Output the internal representation of the window tree.
 .TP
 .BI list_desktops " [--quiet]"
index f7b9303227ec56b91e9fef36e145eaac2b0f2114..c16cfa6eac0b9a9eb34078cc9434015be90614c0 100644 (file)
@@ -28,7 +28,14 @@ void process_message(char *msg, char *rsp)
         set_setting(name, value, rsp);
         return;
     } else if (strcmp(cmd, "list") == 0) {
-        dump_tree(mon->desk, mon->desk->root, rsp, 0);
+        char *name = strtok(NULL, TOK_SEP);
+        if (name != NULL) {
+            desktop_location_t loc;
+            if (locate_desktop(name, &loc))
+                dump_tree(loc.desktop, loc.desktop->root, rsp, 0);
+        } else {
+            dump_tree(mon->desk, mon->desk->root, rsp, 0);
+        }
         return;
     } else if (strcmp(cmd, "list_monitors") == 0) {
         char *arg = strtok(NULL, TOK_SEP);