]> git.lizzy.rs Git - bspwm.git/commitdiff
New setting: persistent_monitors
authorBastien Dejean <nihilhill@gmail.com>
Tue, 29 Apr 2014 09:50:09 +0000 (11:50 +0200)
committerBastien Dejean <nihilhill@gmail.com>
Tue, 29 Apr 2014 09:50:09 +0000 (11:50 +0200)
contrib/bash_completion
contrib/zsh_completion
doc/bspwm.1
doc/bspwm.1.txt
messages.c
monitor.c
settings.c
settings.h

index a9e36797c80656b7075e85d1ec721ab21d7d7bc4..372918d707a9a37169df1d227426acb851daee07 100644 (file)
@@ -1,7 +1,7 @@
 _bspc() {
        local commands='window desktop monitor query pointer rule restore control config quit'
 
-       local settings='external_rules_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 border_width window_gap top_padding right_padding bottom_padding left_padding split_ratio 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'
+       local settings='external_rules_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 border_width window_gap top_padding right_padding bottom_padding left_padding split_ratio 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 persistent_monitors'
 
        COMPREPLY=()
 
index 203b88401451424a9183c04b71087500a11d1dbf..9f6b167ddc714edc7531a671c55b5bfc12d62e3c 100644 (file)
@@ -3,7 +3,7 @@
 _bspc() {
        local -a commands settings
        commands=('window' 'desktop' 'monitor' 'query' 'pointer' 'rule' 'restore' 'control' 'config' 'quit')
-       settings=('external_rules_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' 'border_width' 'window_gap' 'top_padding' 'right_padding' 'bottom_padding' 'left_padding' 'split_ratio' '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')
+       settings=('external_rules_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' 'border_width' 'window_gap' 'top_padding' 'right_padding' 'bottom_padding' 'left_padding' 'split_ratio' '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' 'persistent_monitors')
        if (( CURRENT == 2 )) ; then
                _values 'command' "$commands[@]"
        elif (( CURRENT == 3 )) ; then
index b6e42ec77ca0a558db18024258584965e1c855ef..f6a50bd917257b8aac7e99aa23b809ca5c3ebb10 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: 02/17/2014
+.\"      Date: 04/29/2014
 .\"    Manual: Bspwm Manual
 .\"    Source: Bspwm 0.8.8
 .\"  Language: English
 .\"
-.TH "BSPWM" "1" "02/17/2014" "Bspwm 0\&.8\&.8" "Bspwm Manual"
+.TH "BSPWM" "1" "04/29/2014" "Bspwm 0\&.8\&.8" "Bspwm Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -1115,6 +1115,11 @@ Ignore EWMH focus requests coming from applications\&.
 .RS 4
 Consider disabled monitors as disconnected\&.
 .RE
+.PP
+\fIpersistent_monitors\fR
+.RS 4
+Don\(cqt remove unplugged monitors\&.
+.RE
 .SS "Monitor and Desktop Settings"
 .PP
 \fItop_padding\fR, \fIright_padding\fR, \fIbottom_padding\fR, \fIleft_padding\fR
index 3cad7907ef1448d89c54233468e6b3f1d0526141..f2ae038e8bc82394230986b2ce75ff3be7cf8070 100644 (file)
@@ -679,6 +679,9 @@ Global Settings
 'remove_disabled_monitor'::
        Consider disabled monitors as disconnected.
 
+'persistent_monitors'::
+       Don't remove unplugged monitors.
+
 Monitor and Desktop Settings
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
index 145c997ad22f46c9d22d20dc5b4741f9d65b149e..83dfb8faba906bd241f33bf1f7222470dd570661 100644 (file)
@@ -998,6 +998,7 @@ int set_setting(coordinates_t loc, char *name, char *value)
                SETBOOL(history_aware_focus)
                SETBOOL(ignore_ewmh_focus)
                SETBOOL(remove_disabled_monitor)
+               SETBOOL(persistent_monitors)
 #undef SETBOOL
        } else {
                return MSG_FAILURE;
@@ -1071,6 +1072,7 @@ int get_setting(coordinates_t loc, char *name, FILE* rsp)
        GETBOOL(history_aware_focus)
        GETBOOL(ignore_ewmh_focus)
        GETBOOL(remove_disabled_monitor)
+       GETBOOL(persistent_monitors)
 #undef GETBOOL
        else
                return MSG_FAILURE;
index 10c4dacf58bba221d586c9427becfac4e29ab81b..5aa9605e0aeebc1530d7e6da7c9ce0bcb2b0e0ee 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -411,14 +411,16 @@ bool import_monitors(void)
        }
 
        /* merge and remove disconnected monitors */
-       m = mon_head;
-       while (m != NULL) {
-               monitor_t *next = m->next;
-               if (!m->wired) {
-                       merge_monitors(m, mm);
-                       remove_monitor(m);
+       if (!persistent_monitors) {
+               m = mon_head;
+               while (m != NULL) {
+                       monitor_t *next = m->next;
+                       if (!m->wired) {
+                               merge_monitors(m, mm);
+                               remove_monitor(m);
+                       }
+                       m = next;
                }
-               m = next;
        }
 
        /* add one desktop to each new monitor */
index 4b0ed4e0ae752d4a1911914b733f31fbecaa2ebf..443e7a3501e506e1166970fe20444931718610f3 100644 (file)
@@ -73,4 +73,5 @@ void load_settings(void)
        history_aware_focus = HISTORY_AWARE_FOCUS;
        ignore_ewmh_focus = IGNORE_EWMH_FOCUS;
        remove_disabled_monitor = REMOVE_DISABLED_MONITOR;
+       persistent_monitors = PERSISTENT_MONITORS;
 }
index 06195f947249a5d895a80e21a8bf8f610291486d..c490c01d5166cd8c7f7644412ed9d9aba714fd37 100644 (file)
@@ -64,6 +64,7 @@
 #define APPLY_FLOATING_ATOM      false
 #define IGNORE_EWMH_FOCUS        false
 #define REMOVE_DISABLED_MONITOR  false
+#define PERSISTENT_MONITORS      false
 
 char external_rules_command[MAXLEN];
 char status_prefix[MAXLEN];
@@ -95,6 +96,7 @@ bool auto_cancel;
 bool history_aware_focus;
 bool ignore_ewmh_focus;
 bool remove_disabled_monitor;
+bool persistent_monitors;
 
 void run_config(void);
 void load_settings(void);