mirror of
https://github.com/vale981/bspwm
synced 2025-03-06 02:01:42 -05:00
Merge branch 'master' of github.com:baskerville/bspwm
This commit is contained in:
commit
f5140c46dd
9 changed files with 51 additions and 28 deletions
|
@ -173,6 +173,8 @@ The following messages are handled:
|
|||
|
||||
- `remove_rule UID ...` — Remove the rules with the given UIDs.
|
||||
|
||||
- `put_status` — Output the current state to the panel fifo.
|
||||
|
||||
- `adopt_orphans` — Manage all the unmanaged windows remaining from a previous session.
|
||||
|
||||
- `restore FILE_PATH` — Restore the layout of each desktop from the content of `FILE_PATH`.
|
||||
|
|
3
bspwm.1
3
bspwm.1
|
@ -243,6 +243,9 @@ Create a new rule (PATTERN must match the class or instance name).
|
|||
.BI remove_rule " UID ..."
|
||||
Remove the rules with the given UIDs.
|
||||
.TP
|
||||
.BI put_status
|
||||
Output the current state to the panel fifo.
|
||||
.TP
|
||||
.BI adopt_orphans
|
||||
Manage all the unmanaged windows remaining from a previous session.
|
||||
.TP
|
||||
|
|
1
ewmh.c
1
ewmh.c
|
@ -117,4 +117,5 @@ void ewmh_update_client_list(void)
|
|||
return;
|
||||
|
||||
xcb_ewmh_set_client_list(ewmh, default_screen, num_clients, wins);
|
||||
xcb_ewmh_set_client_list_stacking(ewmh, default_screen, num_clients, wins);
|
||||
}
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
|
||||
flavor=${1:-bar}
|
||||
|
||||
bspc put_status
|
||||
xtitle -sf 'T%s' > "$PANEL_FIFO" &
|
||||
clock 'S%A %H:%M' 5 > "$PANEL_FIFO" &
|
||||
clock -sf 'S%a %H:%M' > "$PANEL_FIFO" &
|
||||
case "$flavor" in
|
||||
bar)
|
||||
cat "$PANEL_FIFO" | panel_bar | bar
|
||||
|
|
|
@ -17,11 +17,11 @@ while read -r line ; do
|
|||
while [ $# -gt 0 ] ; do
|
||||
item=$1
|
||||
case $item in
|
||||
[d_]!*)
|
||||
u*)
|
||||
# urgent desktop
|
||||
wm_infos="$wm_infos \\b3\\f0${item#??}\\fr\\br"
|
||||
;;
|
||||
D*)
|
||||
[DU]*)
|
||||
# active desktop
|
||||
wm_infos="$wm_infos \\u5\\b2\\f9${item#??}\\fr\\br\\ur"
|
||||
;;
|
||||
|
@ -29,7 +29,7 @@ while read -r line ; do
|
|||
# inactive but occupied desktop
|
||||
wm_infos="$wm_infos \\f7${item#??}\\fr"
|
||||
;;
|
||||
_*)
|
||||
E*)
|
||||
# inactive desktop
|
||||
wm_infos="$wm_infos ${item#??}"
|
||||
;;
|
||||
|
|
|
@ -32,38 +32,52 @@ shift $((OPTIND - 1))
|
|||
while read -r line ; do
|
||||
case $line in
|
||||
S*)
|
||||
sys_infos="^fg($COLOR_STATUS_FG)^bg($COLOR_STATUS_BG)${PADDING}${line#?}${PADDING}^fg()^bg()${PADDING}"
|
||||
# system informations
|
||||
sys_infos="^fg($COLOR_STATUS_FG)^bg($COLOR_STATUS_BG)^ca(1, bspc toggle_visibility)${PADDING}${line#?}${PADDING}^ca()^fg()^bg()${PADDING}"
|
||||
;;
|
||||
T*)
|
||||
title="^fg($COLOR_TITLE_FG)^bg($COLOR_TITLE_BG)${PADDING}${line#?}${PADDING}"
|
||||
# focused window title
|
||||
title="^fg($COLOR_TITLE_FG)^bg($COLOR_TITLE_BG)^ca(1, bspc toggle_floating)^ca(2, bspc toggle_locked)^ca(3, bspc close)${PADDING}${line#?}${PADDING}^ca()^ca()^ca()"
|
||||
;;
|
||||
W*)
|
||||
# window manager informations
|
||||
wm_infos="$PADDING"
|
||||
IFS=$FIELDIFS
|
||||
set - ${line#?}
|
||||
while [ $# -gt 0 ] ; do
|
||||
item=$1
|
||||
case $item in
|
||||
[d_]!*)
|
||||
# urgent desktop
|
||||
wm_infos="${wm_infos}^fg($COLOR_URGENT_FG)^bg($COLOR_URGENT_BG)${PADDING}${item#??}${PADDING}"
|
||||
;;
|
||||
D*)
|
||||
# active desktop
|
||||
wm_infos="${wm_infos}^fg($COLOR_ACTIVE_FG)^bg($COLOR_ACTIVE_BG)${PADDING}${item#??}${PADDING}"
|
||||
;;
|
||||
d*)
|
||||
# inactive desktop
|
||||
wm_infos="${wm_infos}^fg($COLOR_INACTIVE_FG)^bg($COLOR_INACTIVE_BG)${PADDING}${item#??}${PADDING}"
|
||||
;;
|
||||
_*)
|
||||
# empty desktop
|
||||
wm_infos="${wm_infos}^fg($COLOR_EMPTY_FG)^bg($COLOR_EMPTY_BG)${PADDING}${item#??}${PADDING}"
|
||||
[DdEUu]*)
|
||||
# desktops
|
||||
name=${item#?}
|
||||
case $item in
|
||||
u*)
|
||||
# urgent (inactive) desktop
|
||||
FG=$COLOR_URGENT_FG
|
||||
BG=$COLOR_URGENT_BG
|
||||
;;
|
||||
[DU]*)
|
||||
# active desktop
|
||||
FG=$COLOR_ACTIVE_FG
|
||||
BG=$COLOR_ACTIVE_BG
|
||||
;;
|
||||
d*)
|
||||
# inactive desktop
|
||||
FG=$COLOR_INACTIVE_FG
|
||||
BG=$COLOR_INACTIVE_BG
|
||||
;;
|
||||
E*)
|
||||
# empty desktop
|
||||
FG=$COLOR_EMPTY_FG
|
||||
BG=$COLOR_EMPTY_BG
|
||||
;;
|
||||
esac
|
||||
wm_infos="${wm_infos}^fg(${FG})^bg(${BG})^ca(1, bspc use ${name})^ca(2, bspc send_to ${name})^ca(3, bspc send_to ${name} --follow)${PADDING}${name}${PADDING}^ca()^ca()^ca()"
|
||||
;;
|
||||
L*)
|
||||
# layout
|
||||
layout=$(printf "%s" "${item#?}" | sed 's/\(.\).*/\U\1/')
|
||||
wm_infos="${wm_infos}^fg()^bg()${PADDING}${PADDING}^fg($COLOR_LAYOUT_FG)^bg($COLOR_LAYOUT_BG)${PADDING}$layout${PADDING}"
|
||||
layout=$(printf "%s" "${item#?}" | sed 's/^\(.\).*/\U\1/')
|
||||
wm_infos="${wm_infos}^fg()^bg()${PADDING}${PADDING}^fg($COLOR_LAYOUT_FG)^bg($COLOR_LAYOUT_BG)^ca(1, bspc cycle_layout)^ca(2, bspc balance)${PADDING}$layout${PADDING}^ca()^ca()"
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
|
|
|
@ -72,4 +72,4 @@ super + space
|
|||
super + Escape
|
||||
pkill -USR1 -x sxhkd
|
||||
|
||||
vim: set ft=sxhkdrc:
|
||||
# vim: set ft=sxhkdrc:
|
||||
|
|
|
@ -432,6 +432,8 @@ void process_message(char *msg, char *rsp)
|
|||
}
|
||||
if (mon->desk->layout == LAYOUT_TILED)
|
||||
return;
|
||||
} else if (strcmp(cmd, "put_status") == 0) {
|
||||
put_status();
|
||||
} else if (strcmp(cmd, "adopt_orphans") == 0) {
|
||||
adopt_orphans();
|
||||
} else if (strcmp(cmd, "restore") == 0) {
|
||||
|
|
8
tree.c
8
tree.c
|
@ -404,6 +404,7 @@ void insert_node(monitor_t *m, desktop_t *d, node_t *n)
|
|||
if (focus->vacant)
|
||||
update_vacant_state(fopar);
|
||||
}
|
||||
put_status();
|
||||
}
|
||||
|
||||
void focus_node(monitor_t *m, desktop_t *d, node_t *n, bool is_mapped)
|
||||
|
@ -455,7 +456,6 @@ void focus_node(monitor_t *m, desktop_t *d, node_t *n, bool is_mapped)
|
|||
}
|
||||
|
||||
ewmh_update_active_window();
|
||||
put_status();
|
||||
}
|
||||
|
||||
void update_current(void)
|
||||
|
@ -464,7 +464,6 @@ void update_current(void)
|
|||
ewmh_update_active_window();
|
||||
else
|
||||
focus_node(mon, mon->desk, mon->desk->focus, true);
|
||||
put_status();
|
||||
}
|
||||
|
||||
void unlink_node(desktop_t *d, node_t *n)
|
||||
|
@ -518,6 +517,7 @@ void unlink_node(desktop_t *d, node_t *n)
|
|||
|
||||
update_vacant_state(b->parent);
|
||||
}
|
||||
put_status();
|
||||
}
|
||||
|
||||
void remove_node(desktop_t *d, node_t *n)
|
||||
|
@ -820,10 +820,10 @@ void put_status(void)
|
|||
for (desktop_t *d = m->desk_head; d != NULL; d = d->next, urgent = false) {
|
||||
for (node_t *n = first_extrema(d->root); n != NULL && !urgent; n = next_leaf(n))
|
||||
urgent |= n->client->urgent;
|
||||
fprintf(status_fifo, "%c%c%s:", (m->desk == d ? 'D' : (d->root != NULL ? 'd' : '_')), (urgent ? '!' : '_'), d->name);
|
||||
fprintf(status_fifo, "%c%s:", m->desk == d ? (urgent ? 'U' : 'D') : (d->root == NULL ? 'E' : (urgent ? 'u' : 'd')), d->name);
|
||||
}
|
||||
}
|
||||
fprintf(status_fifo, "L%s:W%X\n", (mon->desk->layout == LAYOUT_TILED ? "tiled" : "monocle"), (mon->desk->focus == NULL ? 0 : mon->desk->focus->client->window));
|
||||
fprintf(status_fifo, "L%s\n", (mon->desk->layout == LAYOUT_TILED ? "tiled" : "monocle"));
|
||||
fflush(status_fifo);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue