mirror of
https://github.com/vale981/bspwm
synced 2025-03-05 09:51:38 -05:00
New option for bspwm
: -p STATUS_PREFIX
This commit is contained in:
parent
f97d35cd96
commit
42afe4ad11
5 changed files with 11 additions and 4 deletions
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
## Synopsis
|
## Synopsis
|
||||||
|
|
||||||
bspwm [-v|-s STATUS_FIFO]
|
bspwm [-h|-v|-s STATUS_FIFO|-p STATUS_PREFIX]
|
||||||
|
|
||||||
bspc MESSAGE [ARGUMENTS] [OPTIONS]
|
bspc MESSAGE [ARGUMENTS] [OPTIONS]
|
||||||
|
|
||||||
|
|
2
bspwm.1
2
bspwm.1
|
@ -3,7 +3,7 @@
|
||||||
bspwm \- Tiling window manager based on binary space partitioning
|
bspwm \- Tiling window manager based on binary space partitioning
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B bspwm
|
.B bspwm
|
||||||
.RI [ -v | "-s STATUS_FIFO" ]
|
.RI [ -h | -v | "-s STATUS_FIFO" | "-p STATUS_PREFIX" ]
|
||||||
.P
|
.P
|
||||||
.BI bspc " MESSAGE"
|
.BI bspc " MESSAGE"
|
||||||
.RI [ ARGUMENTS ]
|
.RI [ ARGUMENTS ]
|
||||||
|
|
8
bspwm.c
8
bspwm.c
|
@ -140,6 +140,7 @@ int main(int argc, char *argv[])
|
||||||
fd_set descriptors;
|
fd_set descriptors;
|
||||||
char socket_path[MAXLEN];
|
char socket_path[MAXLEN];
|
||||||
char *fifo_path = NULL;
|
char *fifo_path = NULL;
|
||||||
|
status_prefix = NULL;
|
||||||
int sock_fd, ret_fd, dpy_fd, sel, n;
|
int sock_fd, ret_fd, dpy_fd, sel, n;
|
||||||
struct sockaddr_un sock_address;
|
struct sockaddr_un sock_address;
|
||||||
size_t rsplen = 0;
|
size_t rsplen = 0;
|
||||||
|
@ -148,10 +149,10 @@ int main(int argc, char *argv[])
|
||||||
xcb_generic_event_t *event;
|
xcb_generic_event_t *event;
|
||||||
char opt;
|
char opt;
|
||||||
|
|
||||||
while ((opt = getopt(argc, argv, "hvs:")) != -1) {
|
while ((opt = getopt(argc, argv, "hvs:p:")) != -1) {
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
case 'h':
|
case 'h':
|
||||||
printf("bspwm [-h|-v|-s FIFO]\n");
|
printf("bspwm [-h|-v|-s STATUS_FIFO|-p STATUS_PREFIX]\n");
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
break;
|
break;
|
||||||
case 'v':
|
case 'v':
|
||||||
|
@ -161,6 +162,9 @@ int main(int argc, char *argv[])
|
||||||
case 's':
|
case 's':
|
||||||
fifo_path = optarg;
|
fifo_path = optarg;
|
||||||
break;
|
break;
|
||||||
|
case 'p':
|
||||||
|
status_prefix = optarg;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
1
bspwm.h
1
bspwm.h
|
@ -20,6 +20,7 @@ xcb_screen_t *screen;
|
||||||
xcb_window_t root;
|
xcb_window_t root;
|
||||||
uint8_t root_depth;
|
uint8_t root_depth;
|
||||||
FILE *status_fifo;
|
FILE *status_fifo;
|
||||||
|
char *status_prefix;
|
||||||
|
|
||||||
split_mode_t split_mode;
|
split_mode_t split_mode;
|
||||||
direction_t split_dir;
|
direction_t split_dir;
|
||||||
|
|
2
tree.c
2
tree.c
|
@ -812,6 +812,8 @@ void put_status(void)
|
||||||
{
|
{
|
||||||
if (status_fifo == NULL)
|
if (status_fifo == NULL)
|
||||||
return;
|
return;
|
||||||
|
if (status_prefix != NULL)
|
||||||
|
fprintf(status_fifo, "%s", status_prefix);
|
||||||
bool urgent = false;
|
bool urgent = false;
|
||||||
for (monitor_t *m = mon_head; m != NULL; m = m->next) {
|
for (monitor_t *m = mon_head; m != NULL; m = m->next) {
|
||||||
fprintf(status_fifo, "%c%s:", (mon == m ? 'M' : 'm'), m->name);
|
fprintf(status_fifo, "%c%s:", (mon == m ? 'M' : 'm'), m->name);
|
||||||
|
|
Loading…
Add table
Reference in a new issue