aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar S. Christoffer Eliesen <christoffer@eliesen.no>2015-10-18 19:53:56 +0200
committerLibravatar S. Christoffer Eliesen <christoffer@eliesen.no>2015-10-18 19:53:56 +0200
commit3be11a08e61cfc9e72beab612469466035d320c7 (patch)
treeb7343c26b946eb21f7f73564190aa56c9b0ebbae
parentMerge pull request #193 from sce/multi_user (diff)
downloadsway-3be11a08e61cfc9e72beab612469466035d320c7.tar.gz
sway-3be11a08e61cfc9e72beab612469466035d320c7.tar.zst
sway-3be11a08e61cfc9e72beab612469466035d320c7.zip
main: Implement --get-socketpath switch.
-rw-r--r--include/ipc.h1
-rw-r--r--sway/main.c8
2 files changed, 7 insertions, 2 deletions
diff --git a/include/ipc.h b/include/ipc.h
index 2d71c666..1932ad2d 100644
--- a/include/ipc.h
+++ b/include/ipc.h
@@ -14,5 +14,6 @@ enum ipc_command_type {
14 14
15void ipc_init(void); 15void ipc_init(void);
16void ipc_terminate(void); 16void ipc_terminate(void);
17struct sockaddr_un *ipc_user_sockaddr(void);
17 18
18#endif 19#endif
diff --git a/sway/main.c b/sway/main.c
index de17f440..a4fe5823 100644
--- a/sway/main.c
+++ b/sway/main.c
@@ -4,6 +4,7 @@
4#include <wlc/wlc.h> 4#include <wlc/wlc.h>
5#include <sys/wait.h> 5#include <sys/wait.h>
6#include <sys/types.h> 6#include <sys/types.h>
7#include <sys/un.h>
7#include <signal.h> 8#include <signal.h>
8#include <getopt.h> 9#include <getopt.h>
9#include "layout.h" 10#include "layout.h"
@@ -105,8 +106,11 @@ int main(int argc, char **argv) {
105 case 'V': // verbose 106 case 'V': // verbose
106 verbose = 1; 107 verbose = 1;
107 break; 108 break;
108 case 'p': // --get-socketpath 109 case 'p': ; // --get-socketpath
109 // TODO 110 struct sockaddr_un *ipc_sockaddr = ipc_user_sockaddr();
111 fprintf(stdout, "%s\n", ipc_sockaddr->sun_path);
112 free(ipc_sockaddr);
113 exit(0);
110 break; 114 break;
111 } 115 }
112 } 116 }