mirror of
https://github.com/swaywm/sway.git
synced 2024-12-28 16:06:37 +01:00
main: Implement --get-socketpath switch.
This commit is contained in:
parent
16e904634c
commit
3be11a08e6
2 changed files with 7 additions and 2 deletions
|
@ -14,5 +14,6 @@ enum ipc_command_type {
|
|||
|
||||
void ipc_init(void);
|
||||
void ipc_terminate(void);
|
||||
struct sockaddr_un *ipc_user_sockaddr(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue