|
10 | 10 | import shutil
|
11 | 11 | import string
|
12 | 12 | import subprocess
|
| 13 | +import sys |
13 | 14 | import threading
|
14 | 15 | import time
|
15 | 16 | import winreg as reg
|
|
28 | 29 | config = configparser.ConfigParser()
|
29 | 30 |
|
30 | 31 | # Read the config.ini file
|
31 |
| -config.read('config.ini') |
| 32 | +# Validates path if argument is passed for config path |
| 33 | +config.read(sys.argv[1] if len(sys.argv) > 1 and os.path.isfile(sys.argv[1]) and sys.argv[1].endswith('config.ini') else 'config.ini') |
32 | 34 |
|
33 | 35 | # ------------------------ Constants Code -------------------------- #
|
34 | 36 |
|
@@ -1788,11 +1790,6 @@ def __bug_desktop():
|
1788 | 1790 | while time.time() < end_time:
|
1789 | 1791 | # Randomly flicker desktop visibility
|
1790 | 1792 | ctypes.windll.user32.ShowWindow(desktop_hwnd, random.choice([5, 0, 1])) # 5: Minimize, 0: Hide, 1: Show
|
1791 |
| - |
1792 |
| - # Random background color change for chaos |
1793 |
| - random_color = random.choice([random.randint(0, 0xFFFFFF) for _ in range(5)]) |
1794 |
| - ctypes.windll.user32.SetSysColors(1, (5,), random_color) |
1795 |
| - |
1796 | 1793 | time.sleep(0.1) # Small delay between chaotic effects
|
1797 | 1794 |
|
1798 | 1795 | def __bug_windows(self):
|
@@ -1862,7 +1859,7 @@ def __init__(self):
|
1862 | 1859 | user32.SetProcessDPIAware()
|
1863 | 1860 | self.screen_width = user32.GetSystemMetrics(0) # SM_CXSCREEN
|
1864 | 1861 | self.screen_height = user32.GetSystemMetrics(1) # SM_CYSCREEN
|
1865 |
| - self.TIMEOUT = 2 # TODO: Config.ini |
| 1862 | + self.TIMEOUT = config.getfloat("Tomfoolery.WindowTeleport", "TIMEOUT", fallback=1.0) |
1866 | 1863 |
|
1867 | 1864 | # Teleport windows forever
|
1868 | 1865 | def __tp_windows_forever(self):
|
|
0 commit comments