]> git.lizzy.rs Git - bspwm.git/commitdiff
Provide the layout of the focused desk. of every monitor
authorBastien Dejean <nihilhill@gmail.com>
Sat, 19 Jul 2014 08:32:04 +0000 (10:32 +0200)
committerBastien Dejean <nihilhill@gmail.com>
Sat, 19 Jul 2014 08:32:04 +0000 (10:32 +0200)
desktop.c
doc/bspwm.1
doc/bspwm.1.txt
examples/panel/panel_bar
examples/panel/panel_dzen2
subscribe.c

index 1bf8c0160615acbbb1ce38d25a799227ada0feb3..396fb14b0aa497dae552f3eedebfb752fdc6f8e2 100644 (file)
--- 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();
 }
 
index fab196a8cbc40e49da18dd822f69111e902ed309..a3691db8113741f737789c482066165a6eae21d7 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: bspwm
 .\"    Author: [see the "Author" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      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
index 0139404e070d327eebd35b7587a7a222ddee9381..016781db173e32033e09a1f8e736d3f4a8081c95 100644 (file)
@@ -741,8 +741,8 @@ Each item has the form '<type><value>' where '<type>' is the first character of
 'u<desktop_name>'::
        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
 ---------------------
index 74d61ae8491f9625bfffeea4c7eac0c518e92c01..ff592e56ad1b16b55fbd8360161237c8f7a8ac62 100755 (executable)
@@ -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
index 949184305e634dc7dd1a93bfd3395c707c99c5fa..342c998a82dc98ac84071f8e20d5e74e879e4c66 100755 (executable)
@@ -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
index 104c873c4d345cd62fe1b6c47c9a2ba5eb0df348..9aaf33b628e11def40a4c64d179a82f19711026c 100644 (file)
@@ -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);
 }