-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
54 lines (40 loc) · 1.25 KB
/
Copy pathmain.py
File metadata and controls
54 lines (40 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env python3
"""
Dynamic Power Plan Tray Application
A system tray application that automatically switches Windows power plans
and Lian Li fan configurations based on CPU/GPU usage or running applications.
Usage:
python main.py [--config PATH]
Arguments:
--config PATH Path to custom config file (optional)
"""
import argparse
import sys
import os
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from src.config import Config
from src.tray_app import TrayApp
def main():
parser = argparse.ArgumentParser(
description='Dynamic Power Plan Tray Application'
)
parser.add_argument(
'--config', '-c',
type=str,
default=None,
help='Path to custom config file'
)
args = parser.parse_args()
config = Config(args.config)
print(f"Config file: {config.config_path}")
print(f"Normal plan: {config.normal_plan}")
print(f"Boost plan: {config.boost_plan}")
print(f"CPU threshold: {config.cpu_threshold}%")
print(f"GPU threshold: {config.gpu_threshold}%")
print(f"Watched games: {config.watched_games}")
print()
print("Starting tray application...")
app = TrayApp(config)
app.run()
if __name__ == '__main__':
main()