File tree Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -46,10 +46,15 @@ def enable_monitor():
4646
4747
4848def disable_monitor ():
49- _run_mmt_command ("/disable" , get_monitor_id ())
49+ _run_mmt_command ("/disable" , get_selected_monitor_id ())
5050
5151
52- def get_monitor_id ():
52+ def enable_all_disabled_monitors ():
53+ for _monitor_id in _get_all_disabled_monitor_ids ():
54+ _run_mmt_command ("/enable" , _monitor_id )
55+
56+
57+ def get_selected_monitor_id ():
5358 for monitor in _get_monitor_df ():
5459 if (
5560 monitor ["Monitor Name" ] == config .MONITOR_NAME_VALUE
@@ -59,7 +64,16 @@ def get_monitor_id():
5964 return _id [- 1 ]
6065
6166
62- def is_monitor_enabled ():
67+ def _get_all_disabled_monitor_ids ():
68+ _monitor_id_list = []
69+ for monitor in _get_monitor_df ():
70+ if monitor ["Active" ].upper () == "NO" :
71+ _id = monitor ["Name" ]
72+ _monitor_id_list .append (_id [- 1 ])
73+ return _monitor_id_list
74+
75+
76+ def is_selected_monitor_enabled ():
6377 for monitor in _get_monitor_df ():
6478 if (
6579 monitor ["Monitor Name" ] == config .MONITOR_NAME_VALUE
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ def save_mmt_config_clicked():
1717
1818
1919def icon_tray_clicked ():
20- if multimonitortool .is_monitor_enabled ():
20+ if multimonitortool .is_selected_monitor_enabled ():
2121 multimonitortool .disable_monitor ()
2222 ICON .icon = ICON_DISABLED_IMAGE
2323 else :
@@ -88,7 +88,7 @@ def init_tray():
8888
8989 first_image_icon = None
9090
91- if multimonitortool .is_monitor_enabled ():
91+ if multimonitortool .is_selected_monitor_enabled ():
9292 first_image_icon = ICON_ENABLED_IMAGE
9393 multimonitortool .save_mmt_config ()
9494 else :
You can’t perform that action at this time.
0 commit comments