diff --git a/desktop.c b/desktop.c
index 1bf8c01..396fb14 100644
--- a/desktop.c
+++ b/desktop.c
@@ -77,7 +77,7 @@ void change_layout(monitor_t *m, desktop_t *d, layout_t l)
{
d->layout = l;
arrange(m, d);
- if (d == mon->desk)
+ if (d == m->desk)
put_status();
}
diff --git a/doc/bspwm.1 b/doc/bspwm.1
index fab196a..a3691db 100644
--- a/doc/bspwm.1
+++ b/doc/bspwm.1
@@ -2,12 +2,12 @@
.\" Title: bspwm
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.78.1
-.\" Date: 07/18/2014
+.\" Date: 07/19/2014
.\" Manual: Bspwm Manual
.\" Source: Bspwm 0.8.9
.\" Language: English
.\"
-.TH "BSPWM" "1" "07/18/2014" "Bspwm 0\&.8\&.9" "Bspwm Manual"
+.TH "BSPWM" "1" "07/19/2014" "Bspwm 0\&.8\&.9" "Bspwm Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -1194,9 +1194,9 @@ Urgent focused desktop\&.
Urgent unfocused desktop\&.
.RE
.PP
-\fIL(tiled|monocle)\fR
+\fIL(T|M)\fR
.RS 4
-Layout of the focused desktop of the focused monitor\&.
+Layout of the focused desktop of a monitor\&.
.RE
.SH "ENVIRONMENT VARIABLES"
.PP
diff --git a/doc/bspwm.1.txt b/doc/bspwm.1.txt
index 0139404..016781d 100644
--- a/doc/bspwm.1.txt
+++ b/doc/bspwm.1.txt
@@ -741,8 +741,8 @@ Each item has the form '' where '' is the first character of
'u'::
Urgent unfocused desktop.
-'L(tiled|monocle)'::
- Layout of the focused desktop of the focused monitor.
+'L(T|M)'::
+ Layout of the focused desktop of a monitor.
Environment Variables
---------------------
diff --git a/examples/panel/panel_bar b/examples/panel/panel_bar
index 74d61ae..ff592e5 100755
--- a/examples/panel/panel_bar
+++ b/examples/panel/panel_bar
@@ -25,7 +25,7 @@ while read -r line ; do
case $item in
O*)
# focused occupied desktop
- wm_infos="$wm_infos %{F$COLOR_FOCUSED_OCCUPIED_FG}%{B$COLOR_FOCUSED_OCCUPIED_BG}%{U$COLOR_FOREGROUND}%{+u}${name}%{-u}"
+ wm_infos="$wm_infos %{F$COLOR_FOCUSED_OCCUPIED_FG}%{B$COLOR_FOCUSED_OCCUPIED_BG}%{U$COLOR_FOREGROUND}%{+u}${name}%{B-}%{-u}"
;;
F*)
# focused free desktop
@@ -49,8 +49,7 @@ while read -r line ; do
;;
L*)
# layout
- layout=$(printf "%s" "${name}" | sed 's/\(.\).*/\U\1/')
- wm_infos="$wm_infos %{F$COLOR_LAYOUT_FG}%{B$COLOR_LAYOUT_BG}$layout"
+ wm_infos="$wm_infos %{F$COLOR_LAYOUT_FG}%{B$COLOR_LAYOUT_BG}${name}"
;;
esac
shift
diff --git a/examples/panel/panel_dzen2 b/examples/panel/panel_dzen2
index 9491843..342c998 100755
--- a/examples/panel/panel_dzen2
+++ b/examples/panel/panel_dzen2
@@ -82,8 +82,7 @@ while read -r line ; do
;;
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)^ca(1, bspc desktop -l next)${PADDING}$layout${PADDING}^ca()"
+ wm_infos="${wm_infos}^fg()^bg()${PADDING}${PADDING}^fg($COLOR_LAYOUT_FG)^bg($COLOR_LAYOUT_BG)^ca(1, bspc desktop -l next)${PADDING}${item#?}${PADDING}^ca()"
;;
esac
shift
diff --git a/subscribe.c b/subscribe.c
index 104c873..9aaf33b 100644
--- a/subscribe.c
+++ b/subscribe.c
@@ -87,9 +87,8 @@ int print_status(FILE *stream)
c = toupper(c);
fprintf(stream, "%c%s:", c, d->name);
}
+ fprintf(stream, "L%c", (m->desk->layout == LAYOUT_TILED ? 'T' : 'M'));
}
- if (mon != NULL && mon->desk != NULL)
- fprintf(stream, "L%s", (mon->desk->layout == LAYOUT_TILED ? "tiled" : "monocle"));
fprintf(stream, "%s", "\n");
return fflush(stream);
}