mirror of
https://github.com/vale981/bspwm
synced 2025-03-04 17:31:39 -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
|
||||
|
||||
bspwm [-v|-s STATUS_FIFO]
|
||||
bspwm [-h|-v|-s STATUS_FIFO|-p STATUS_PREFIX]
|
||||
|
||||
bspc MESSAGE [ARGUMENTS] [OPTIONS]
|
||||
|
||||
|
|
2
bspwm.1
2
bspwm.1
|
@ -3,7 +3,7 @@
|
|||
bspwm \- Tiling window manager based on binary space partitioning
|
||||
.SH SYNOPSIS
|
||||
.B bspwm
|
||||
.RI [ -v | "-s STATUS_FIFO" ]
|
||||
.RI [ -h | -v | "-s STATUS_FIFO" | "-p STATUS_PREFIX" ]
|
||||
.P
|
||||
.BI bspc " MESSAGE"
|
||||
.RI [ ARGUMENTS ]
|
||||
|
|
8
bspwm.c
8
bspwm.c
|
@ -140,6 +140,7 @@ int main(int argc, char *argv[])
|
|||
fd_set descriptors;
|
||||
char socket_path[MAXLEN];
|
||||
char *fifo_path = NULL;
|
||||
status_prefix = NULL;
|
||||
int sock_fd, ret_fd, dpy_fd, sel, n;
|
||||
struct sockaddr_un sock_address;
|
||||
size_t rsplen = 0;
|
||||
|
@ -148,10 +149,10 @@ int main(int argc, char *argv[])
|
|||
xcb_generic_event_t *event;
|
||||
char opt;
|
||||
|
||||
while ((opt = getopt(argc, argv, "hvs:")) != -1) {
|
||||
while ((opt = getopt(argc, argv, "hvs:p:")) != -1) {
|
||||
switch (opt) {
|
||||
case 'h':
|
||||
printf("bspwm [-h|-v|-s FIFO]\n");
|
||||
printf("bspwm [-h|-v|-s STATUS_FIFO|-p STATUS_PREFIX]\n");
|
||||
exit(EXIT_SUCCESS);
|
||||
break;
|
||||
case 'v':
|
||||
|
@ -161,6 +162,9 @@ int main(int argc, char *argv[])
|
|||
case 's':
|
||||
fifo_path = optarg;
|
||||
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;
|
||||
uint8_t root_depth;
|
||||
FILE *status_fifo;
|
||||
char *status_prefix;
|
||||
|
||||
split_mode_t split_mode;
|
||||
direction_t split_dir;
|
||||
|
|
2
tree.c
2
tree.c
|
@ -812,6 +812,8 @@ void put_status(void)
|
|||
{
|
||||
if (status_fifo == NULL)
|
||||
return;
|
||||
if (status_prefix != NULL)
|
||||
fprintf(status_fifo, "%s", status_prefix);
|
||||
bool urgent = false;
|
||||
for (monitor_t *m = mon_head; m != NULL; m = m->next) {
|
||||
fprintf(status_fifo, "%c%s:", (mon == m ? 'M' : 'm'), m->name);
|
||||
|
|
Loading…
Add table
Reference in a new issue