]> git.lizzy.rs Git - bspwm.git/commitdiff
New setting: remove_disabled_monitor
authorBastien Dejean <nihilhill@gmail.com>
Sun, 10 Nov 2013 11:07:14 +0000 (12:07 +0100)
committerBastien Dejean <nihilhill@gmail.com>
Sun, 10 Nov 2013 11:07:14 +0000 (12:07 +0100)
contrib/bash_completion
contrib/zsh_completion
doc/bspwm.1
doc/bspwm.1.txt
messages.c
monitor.c
settings.c
settings.h

index 17c3999327d9ead1138dd0f6b2e5382a8ef1a593..0ca1d4749f2ea7c01231203dcec6de1abd749705 100644 (file)
@@ -1,7 +1,7 @@
 _bspc() {
     local commands='window desktop monitor query pointer restore control config quit'
 
-    local settings='rule_command status_prefix focused_border_color active_border_color normal_border_color presel_border_color focused_locked_border_color active_locked_border_color normal_locked_border_color focused_sticky_border_color normal_sticky_border_color focused_private_border_color active_private_border_color normal_private_border_color urgent_border_color focused_frame_opacity active_frame_opacity normal_frame_opacity border_width window_gap top_padding right_padding bottom_padding left_padding split_ratio growth_factor borderless_monocle gapless_monocle focus_follows_pointer pointer_follows_monitor apply_floating_atom auto_alternate auto_cancel history_aware_focus ignore_ewmh_focus'
+    local settings='rule_command status_prefix focused_border_color active_border_color normal_border_color presel_border_color focused_locked_border_color active_locked_border_color normal_locked_border_color focused_sticky_border_color normal_sticky_border_color focused_private_border_color active_private_border_color normal_private_border_color urgent_border_color focused_frame_opacity active_frame_opacity normal_frame_opacity border_width window_gap top_padding right_padding bottom_padding left_padding split_ratio growth_factor borderless_monocle gapless_monocle focus_follows_pointer pointer_follows_monitor apply_floating_atom auto_alternate auto_cancel history_aware_focus ignore_ewmh_focus remove_disabled_monitor'
 
     COMPREPLY=()
 
index 3e0ae422d057fa11b6d434a324c183cedb358ef1..0feeeca825c80d796fc7b055916f51e0cbc83c1b 100644 (file)
@@ -3,7 +3,7 @@
 _bspc() {
     local -a commands settings
     commands=('window' 'desktop' 'monitor' 'query' 'pointer' 'restore' 'control' 'config' 'quit')
-    settings=('rule_command' 'status_prefix' 'focused_border_color' 'active_border_color' 'normal_border_color' 'presel_border_color' 'focused_locked_border_color' 'active_locked_border_color' 'normal_locked_border_color' 'focused_sticky_border_color' 'normal_sticky_border_color' 'focused_private_border_color' 'active_private_border_color' 'normal_private_border_color' 'urgent_border_color' 'focused_frame_opacity' 'active_frame_opacity' 'normal_frame_opacity' 'border_width' 'window_gap' 'top_padding' 'right_padding' 'bottom_padding' 'left_padding' 'split_ratio' 'growth_factor' 'borderless_monocle' 'gapless_monocle' 'focus_follows_pointer' 'pointer_follows_monitor' 'apply_floating_atom' 'auto_alternate' 'auto_cancel' 'history_aware_focus' 'ignore_ewmh_focus')
+    settings=('rule_command' 'status_prefix' 'focused_border_color' 'active_border_color' 'normal_border_color' 'presel_border_color' 'focused_locked_border_color' 'active_locked_border_color' 'normal_locked_border_color' 'focused_sticky_border_color' 'normal_sticky_border_color' 'focused_private_border_color' 'active_private_border_color' 'normal_private_border_color' 'urgent_border_color' 'focused_frame_opacity' 'active_frame_opacity' 'normal_frame_opacity' 'border_width' 'window_gap' 'top_padding' 'right_padding' 'bottom_padding' 'left_padding' 'split_ratio' 'growth_factor' 'borderless_monocle' 'gapless_monocle' 'focus_follows_pointer' 'pointer_follows_monitor' 'apply_floating_atom' 'auto_alternate' 'auto_cancel' 'history_aware_focus' 'ignore_ewmh_focus' 'remove_disabled_monitor')
     if (( CURRENT == 2 )) ; then
         _values 'command' "$commands[@]"
     elif (( CURRENT == 3 )) ; then
index a4a7198a53d096b99eba94def934401fe50a5c2b..47430bb83921a50c9c233a666a05ca16968bbb53 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: 11/08/2013
+.\"      Date: 11/10/2013
 .\"    Manual: Bspwm Manual
 .\"    Source: Bspwm 0.8.6
 .\"  Language: English
 .\"
-.TH "BSPWM" "1" "11/08/2013" "Bspwm 0\&.8\&.6" "Bspwm Manual"
+.TH "BSPWM" "1" "11/10/2013" "Bspwm 0\&.8\&.6" "Bspwm Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -1037,6 +1037,11 @@ atom of each window according to its floating state\&.
 .RS 4
 Ignore EWMH requests to focus a window\&.
 .RE
+.PP
+\fIremove_disabled_monitor\fR
+.RS 4
+Consider disabled monitors as disconnected\&.
+.RE
 .SS "Monitor Settings"
 .PP
 \fItop_padding\fR, \fIright_padding\fR, \fIbottom_padding\fR, \fIleft_padding\fR
index 9417cfe2d47746d1762a30590ee34cf05c53e7ac..e9bfcb5b194a950aa5f56dc94bdd655e2971c8da 100644 (file)
@@ -622,6 +622,9 @@ Global Settings
 'ignore_ewmh_focus'::
     Ignore EWMH requests to focus a window.
 
+'remove_disabled_monitor'::
+    Consider disabled monitors as disconnected.
+
 Monitor Settings
 ~~~~~~~~~~~~~~~~
 
index 9add04b74f30c8868cc37ed9961c686a54121563..5fb5d9d33e3077ce37431a78a71117be25c6d545 100644 (file)
@@ -883,6 +883,7 @@ bool set_setting(coordinates_t loc, char *name, char *value)
         SETBOOL(auto_cancel)
         SETBOOL(history_aware_focus)
         SETBOOL(ignore_ewmh_focus)
+        SETBOOL(remove_disabled_monitor)
 #undef SETBOOL
     } else {
         return false;
@@ -960,6 +961,7 @@ bool get_setting(coordinates_t loc, char *name, char* rsp)
     GETBOOL(auto_cancel)
     GETBOOL(history_aware_focus)
     GETBOOL(ignore_ewmh_focus)
+    GETBOOL(remove_disabled_monitor)
 #undef GETBOOL
     else
         return false;
index 519418676b53719c420f73d7335953d259127b49..43b60158f5c7650acc02592ff1622fccdfb5bb2f 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -353,7 +353,7 @@ bool import_monitors(void)
                     }
                 }
                 free(cir);
-            } else if (info->connection != XCB_RANDR_CONNECTION_DISCONNECTED) {
+            } else if (!remove_disabled_monitor && info->connection != XCB_RANDR_CONNECTION_DISCONNECTED) {
                 m = get_monitor_by_id(outputs[i]);
                 if (m != NULL)
                     m->wired = true;
index 00efabbf8f890d152e56a6e3d9861d3643bd2230..1cfaadfc63f84d0f3df302631108c5577c14c425 100644 (file)
@@ -73,4 +73,5 @@ void load_settings(void)
     auto_cancel = AUTO_CANCEL;
     history_aware_focus = HISTORY_AWARE_FOCUS;
     ignore_ewmh_focus = IGNORE_EWMH_FOCUS;
+    remove_disabled_monitor = REMOVE_DISABLED_MONITOR;
 }
index ecf9a410f5851fe6e627dde1c602861f074f3361..4b68e90319590f772796d15772a2f8dd2d400147 100644 (file)
@@ -64,6 +64,7 @@
 #define AUTO_CANCEL              false
 #define APPLY_FLOATING_ATOM      false
 #define IGNORE_EWMH_FOCUS        false
+#define REMOVE_DISABLED_MONITOR  false
 
 char rule_command[MAXLEN];
 char status_prefix[MAXLEN];
@@ -99,6 +100,7 @@ bool auto_alternate;
 bool auto_cancel;
 bool history_aware_focus;
 bool ignore_ewmh_focus;
+bool remove_disabled_monitor;
 
 void run_config(void);
 void load_settings(void);