]> git.lizzy.rs Git - bspwm.git/commitdiff
New optional EXIT_STATUS argument for 'quit'
authorBastien Dejean <nihilhill@gmail.com>
Mon, 24 Dec 2012 11:02:35 +0000 (12:02 +0100)
committerBastien Dejean <nihilhill@gmail.com>
Mon, 24 Dec 2012 11:02:35 +0000 (12:02 +0100)
Also removed the 'reload' message because of its uselessness.

README.md
bspwm.1
bspwm.c
bspwm.h
messages.c

index 7c24b143e15ebc0013e62b5b902465a87ed29377..9b87a754ed42b7b1ec2dd5b7702012de79061269 100644 (file)
--- a/README.md
+++ b/README.md
@@ -206,10 +206,7 @@ The following messages are handled:
     reload_settings
         Reload the default settings.
 
-    reload
-        Reload the autostart file and the default settings.
-
-    quit
+    quit [EXIT_STATUS]
         Quit.
 
 ## Settings
diff --git a/bspwm.1 b/bspwm.1
index f91e886f6cf0b097d142483fcddf6990cd626652..6d0369d2217a512f4da66e744caf5e397c79a6d9 100644 (file)
--- a/bspwm.1
+++ b/bspwm.1
@@ -229,10 +229,7 @@ Reload the autostart file.
 .BI reload_settings
 Reload the default settings.
 .TP
-.BI reload
-Reload the autostart file and the default settings.
-.TP
-.BI quit
+.BI quit " [EXIT_STATUS]"
 Quit.
 .SH SETTINGS
 Colors are either
diff --git a/bspwm.c b/bspwm.c
index 09189350105fe767c2ba920731bf297364785ec4..ea3b0ecd468d583fba5437e32d1a45d89e298d60 100644 (file)
--- a/bspwm.c
+++ b/bspwm.c
@@ -139,6 +139,7 @@ void setup(void)
     last_entered = XCB_NONE;
     split_mode = MODE_AUTOMATIC;
     visible = true;
+    exit_status = 0;
 }
 
 int main(int argc, char *argv[])
@@ -250,5 +251,5 @@ int main(int argc, char *argv[])
     free(ewmh);
     xcb_flush(dpy);
     xcb_disconnect(dpy);
-    return 0;
+    return exit_status;
 }
diff --git a/bspwm.h b/bspwm.h
index 07c5ed1fac1bbbea2f5e630905e8deca3a1889a5..e7f685e2cd1203f3332daca786a1b87b9473fba4 100644 (file)
--- a/bspwm.h
+++ b/bspwm.h
@@ -28,6 +28,7 @@ rule_t *rule_head;
 pointer_state_t *frozen_pointer;
 xcb_point_t pointer_position;
 xcb_window_t last_entered;
+int exit_status;
 
 bool visible;
 bool running;
index 1a413cc6576edc19f295f9d1459dc58f8a9e6504..d41127ae433f2fda3447ba199d5a607af31781c5 100644 (file)
@@ -343,14 +343,14 @@ void process_message(char *msg, char *rsp)
             return;
     } else if (strcmp(cmd, "adopt_orphans") == 0) {
         adopt_orphans();
-    } else if (strcmp(cmd, "reload") == 0) {
-        load_settings();
-        run_autostart();
     } else if (strcmp(cmd, "reload_autostart") == 0) {
         run_autostart();
     } else if (strcmp(cmd, "reload_settings") == 0) {
         load_settings();
     } else if (strcmp(cmd, "quit") == 0) {
+        char *arg = strtok(NULL, TOK_SEP);
+        if (arg != NULL)
+            sscanf(arg, "%i", &exit_status);
         quit();
         return;
     } else {