mirror of
https://github.com/vale981/bspwm
synced 2025-03-06 02:01:42 -05:00
parent
5e037978dd
commit
a7fe634bf0
5 changed files with 16 additions and 16 deletions
8
bspc.c
8
bspc.c
|
@ -42,10 +42,12 @@ int main(int argc, char *argv[])
|
|||
if (argc < 2)
|
||||
err("No arguments given.\n");
|
||||
|
||||
char *sp = getenv(SOCKET_ENV_VAR);
|
||||
|
||||
sock_address.sun_family = AF_UNIX;
|
||||
snprintf(sock_address.sun_path, sizeof(sock_address.sun_path), "%s", (sp == NULL ? DEFAULT_SOCKET_PATH : sp));
|
||||
char *sp = getenv(SOCKET_ENV_VAR);
|
||||
if (sp != NULL)
|
||||
snprintf(sock_address.sun_path, sizeof(sock_address.sun_path), "%s", sp);
|
||||
else
|
||||
snprintf(sock_address.sun_path, sizeof(sock_address.sun_path), SOCKET_PATH_TPL, getenv("DISPLAY"));
|
||||
|
||||
argc--, argv++;
|
||||
int msg_len = 0;
|
||||
|
|
7
bspwm.c
7
bspwm.c
|
@ -97,11 +97,13 @@ int main(int argc, char *argv[])
|
|||
dpy_fd = xcb_get_file_descriptor(dpy);
|
||||
|
||||
char *sp = getenv(SOCKET_ENV_VAR);
|
||||
snprintf(socket_path, sizeof(socket_path), "%s", (sp == NULL ? DEFAULT_SOCKET_PATH : sp));
|
||||
if (sp != NULL)
|
||||
snprintf(socket_path, sizeof(socket_path), "%s", sp);
|
||||
else
|
||||
snprintf(socket_path, sizeof(socket_path), SOCKET_PATH_TPL, getenv("DISPLAY"));
|
||||
|
||||
sock_address.sun_family = AF_UNIX;
|
||||
snprintf(sock_address.sun_path, sizeof(sock_address.sun_path), "%s", socket_path);
|
||||
unlink(socket_path);
|
||||
|
||||
sock_fd = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||
|
||||
|
@ -180,6 +182,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
cleanup();
|
||||
close(sock_fd);
|
||||
unlink(socket_path);
|
||||
xcb_ewmh_connection_wipe(ewmh);
|
||||
xcb_destroy_window(dpy, motion_recorder);
|
||||
free(ewmh);
|
||||
|
|
6
common.h
6
common.h
|
@ -25,8 +25,8 @@
|
|||
#ifndef BSPWM_COMMON_H
|
||||
#define BSPWM_COMMON_H
|
||||
|
||||
#define DEFAULT_SOCKET_PATH "/tmp/bspwm-socket"
|
||||
#define SOCKET_ENV_VAR "BSPWM_SOCKET"
|
||||
#define MESSAGE_FAILURE '\x18'
|
||||
#define SOCKET_PATH_TPL "/tmp/bspwm%s-socket"
|
||||
#define SOCKET_ENV_VAR "BSPWM_SOCKET"
|
||||
#define MESSAGE_FAILURE '\x18'
|
||||
|
||||
#endif
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
.\" Title: bspwm
|
||||
.\" Author: [see the "Author" section]
|
||||
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
|
||||
.\" Date: 12/16/2013
|
||||
.\" Date: 12/23/2013
|
||||
.\" Manual: Bspwm Manual
|
||||
.\" Source: Bspwm 0.8.7
|
||||
.\" Language: English
|
||||
.\"
|
||||
.TH "BSPWM" "1" "12/16/2013" "Bspwm 0\&.8\&.7" "Bspwm Manual"
|
||||
.TH "BSPWM" "1" "12/23/2013" "Bspwm 0\&.8\&.7" "Bspwm Manual"
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * Define some portability stuff
|
||||
.\" -----------------------------------------------------------------
|
||||
|
@ -1169,11 +1169,6 @@ Layout of the focused desktop of the focused monitor\&.
|
|||
.PP
|
||||
\fIBSPWM_SOCKET\fR
|
||||
.RS 4
|
||||
The path of the socket used for the communication between
|
||||
\fBbspc\fR
|
||||
and
|
||||
\fBbspwm\fR\&. If it isn\(cqt defined, then the following path is used:
|
||||
\fI/tmp/bspwm\-socket\fR\&.
|
||||
.RE
|
||||
.SH "PANELS"
|
||||
.sp
|
||||
|
|
|
@ -724,7 +724,7 @@ Environment Variables
|
|||
---------------------
|
||||
|
||||
'BSPWM_SOCKET'::
|
||||
The path of the socket used for the communication between *bspc* and *bspwm*. If it isn't defined, then the following path is used: '/tmp/bspwm-socket'.
|
||||
The path of the socket used for the communication between *bspc* and *bspwm*. If it isn't defined, then the following path is used: '/tmp/bspwm${DISPLAY}-socket'.
|
||||
|
||||
Panels
|
||||
------
|
||||
|
|
Loading…
Add table
Reference in a new issue