aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorS. Christoffer Eliesen <christoffer@eliesen.no>2015-10-18 19:53:56 +0200
committerS. Christoffer Eliesen <christoffer@eliesen.no>2015-10-18 19:53:56 +0200
commit3be11a08e61cfc9e72beab612469466035d320c7 (patch)
treeb7343c26b946eb21f7f73564190aa56c9b0ebbae /sway
parent16e904634c65128610537bed7fcb16ac3bb45165 (diff)
main: Implement --get-socketpath switch.
Diffstat (limited to 'sway')
-rw-r--r--sway/main.c8
1 files changed, 6 insertions, 2 deletions
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 @@
#include <wlc/wlc.h>
#include <sys/wait.h>
#include <sys/types.h>
+#include <sys/un.h>
#include <signal.h>
#include <getopt.h>
#include "layout.h"
@@ -105,8 +106,11 @@ int main(int argc, char **argv) {
case 'V': // verbose
verbose = 1;
break;
- case 'p': // --get-socketpath
- // TODO
+ case 'p': ; // --get-socketpath
+ struct sockaddr_un *ipc_sockaddr = ipc_user_sockaddr();
+ fprintf(stdout, "%s\n", ipc_sockaddr->sun_path);
+ free(ipc_sockaddr);
+ exit(0);
break;
}
}