Skip to content

Commit 59e3fc6

Browse files
committed
debugging+todos
1 parent f482fe2 commit 59e3fc6

File tree

6 files changed

+22
-11
lines changed

6 files changed

+22
-11
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Resolution,Left-Top,Right-Bottom,Active,Disconnected,Primary,Colors,Frequency,Orientation,Maximum Resolution,Name,Adapter,Device ID,Device Key,Monitor ID,Short Monitor ID,Monitor Key,Monitor String,Monitor Name,Monitor Serial Number
2-
1920 X 1080,"1601, -1080","3521, 0",Yes,No,No,32,60,Default,1920 X 1080,\\.\DISPLAY3,NVIDIA GeForce RTX 2080 Ti,PCI\VEN_10DE&DEV_1E07&SUBSYS_866A1043&REV_A1,\Registry\Machine\System\CurrentControlSet\Control\Video\{3AB1B141-D3F6-11EE-A460-106FD93C4F11}\0002,MONITOR\GSM0001\{4d36e96e-e325-11ce-bfc1-08002be10318}\0010,GSM0001,\Registry\Machine\System\CurrentControlSet\Control\Class\{4d36e96e-e325-11ce-bfc1-08002be10318}\0010,Generic PnP Monitor,LG TV,
2+
0 X 0,"0, 0","0, 0",No,No,No,0,0,Default,1920 X 1080,\\.\DISPLAY3,NVIDIA GeForce RTX 2080 Ti,PCI\VEN_10DE&DEV_1E07&SUBSYS_866A1043&REV_A1,\Registry\Machine\System\CurrentControlSet\Control\Video\{3AB1B141-D3F6-11EE-A460-106FD93C4F11}\0002,MONITOR\GSM0001\{4d36e96e-e325-11ce-bfc1-08002be10318}\0010,GSM0001,\Registry\Machine\System\CurrentControlSet\Control\Class\{4d36e96e-e325-11ce-bfc1-08002be10318}\0010,Generic PnP Monitor,LG TV,
33
2560 X 1440,"2560, 0","5120, 1440",Yes,No,No,32,60,Default,2560 X 1440,\\.\DISPLAY2,NVIDIA GeForce RTX 2080 Ti,PCI\VEN_10DE&DEV_1E07&SUBSYS_866A1043&REV_A1,\Registry\Machine\System\CurrentControlSet\Control\Video\{3AB1B141-D3F6-11EE-A460-106FD93C4F11}\0001,MONITOR\LEN66FB\{4d36e96e-e325-11ce-bfc1-08002be10318}\0008,LEN66FB,\Registry\Machine\System\CurrentControlSet\Control\Class\{4d36e96e-e325-11ce-bfc1-08002be10318}\0008,Generic PnP Monitor,C27q-35,URHK6FCP
44
2560 X 1440,"0, 0","2560, 1440",Yes,No,Yes,32,144,Default,2560 X 1440,\\.\DISPLAY1,NVIDIA GeForce RTX 2080 Ti,PCI\VEN_10DE&DEV_1E07&SUBSYS_866A1043&REV_A1,\Registry\Machine\System\CurrentControlSet\Control\Video\{3AB1B141-D3F6-11EE-A460-106FD93C4F11}\0000,MONITOR\ACI27EC\{4d36e96e-e325-11ce-bfc1-08002be10318}\0009,ACI27EC,\Registry\Machine\System\CurrentControlSet\Control\Class\{4d36e96e-e325-11ce-bfc1-08002be10318}\0009,ROG PG279Q,ROG PG279Q,#ASNImfyQBwHd

SimpleMonitorControlTray/configHandler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def read_config():
5151

5252
global AUTOSTART, MULTIMONITORTOOL_PATH, CSV_FILE_PATH, MM_CONFIG_FILE_PATH, MONITOR_NAME
5353

54-
if not os.path.exists(config_file_path):
54+
if not os.path.exists(os.path.join(currentPath, asset_iconEnabled)):
5555
nH.sendError(config_file_path + fileNotFound)
5656
tH.exitItemClicked()
5757

SimpleMonitorControlTray/notificationHandler.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import threading
2-
3-
from win10toast import ToastNotifier
1+
# from win10toast import ToastNotifier
42

53

64
def sendError(text):
7-
toaster = ToastNotifier()
8-
toaster.show_toast("Error", text, duration=7)
5+
# toaster = ToastNotifier()
6+
# toaster.show_toast("Error", text, duration=7)
7+
pass
98

109

1110
def sendNotification(text, duration):

SimpleMonitorControlTray/registryHandler.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import os
22
import winreg as reg
33

4+
import main
5+
46
keyName = "SimpleMonitorControlTray"
57

6-
exe_path = os.path.join(os.getcwd(), keyName + ".exe")
8+
exe_path = os.path.join(main.script_dir, keyName + ".exe")
79
registry_key = r"Software\Microsoft\Windows\CurrentVersion\Run"
810

911

SimpleMonitorControlTray/trayHandler.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
from PIL import Image
55
from pystray import MenuItem as item
66

7+
import main
78
import SimpleMonitorControlTray.configHandler as cH
89
import SimpleMonitorControlTray.monitorHandler as mH
910
import SimpleMonitorControlTray.registryHandler as rH
1011

1112
# TODO this returns the wrong path (System32) if run from registry autostart
12-
script_dir = os.getcwd()
13+
script_dir = main.script_dir
1314

1415
imageIconEnabled = Image.open(os.path.join(script_dir, "assets\iconEnabled.png"))
1516
imageIconDisabled = Image.open(os.path.join(script_dir, "assets\iconDisabled.png"))
@@ -85,7 +86,7 @@ def initTray():
8586
saveMultiMonitorToolConfigClicked,
8687
),
8788
item("Open Config.ini", openConfigClicked),
88-
item("Quit", exitItemClicked),
89+
item("Exit", exitItemClicked),
8990
)
9091

9192
firstImageIcon = None

main.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
1+
import os
2+
import sys
3+
14
import SimpleMonitorControlTray.configHandler as cH
25
import SimpleMonitorControlTray.trayHandler as tH
36

7+
script_dir = ""
8+
9+
if getattr(sys, "frozen", False):
10+
script_dir = os.path.dirname(sys.executable)
11+
else:
12+
script_dir = os.path.dirname(os.path.abspath(__file__))
13+
414

515
def main():
616
cH.read_config()
717
tH.initTray()
8-
# testcommit in vscode
918

1019

1120
if __name__ == "__main__":

0 commit comments

Comments
 (0)