Skip to content

Commit

Permalink
default monitor from name added
Browse files Browse the repository at this point in the history
  • Loading branch information
sulincix committed Sep 24, 2024
1 parent 760e660 commit dcc4c7a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/data/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
[screen]
#mirror=true
#default-monitor=0
#default-monitor-name=DP-1
#ignore-event=false


Expand Down
3 changes: 3 additions & 0 deletions src/module/screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ def _update_resolution_event(flag=None):
resolution = monitor.get_common_resolution()
else:
i = int(float(get("default-monitor", "0", "screen")))
n = get("default-monitor-name", "", "screen")))
monitor.init_monitor()
mlist = monitor.get_monitors()
if n in mlist:
i = mlist.index(n)
if len(mlist) -1 < i:
i = len(mlist)-1
m = mlist[i]
Expand Down

0 comments on commit dcc4c7a

Please sign in to comment.