-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
33 lines (30 loc) · 1.05 KB
/
main.py
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
import sys
from PyQt6.QtWidgets import QApplication
from qt_gui_manager import QtGUIManager
from PyQt6.QtWidgets import QSystemTrayIcon
from PyQt6.QtGui import QIcon, QPixmap
import ctypes
from pathlib import Path
if __name__ == "__main__":
app = QApplication(sys.argv)
# Tray Icon
trayIcon = QSystemTrayIcon(QIcon("./resources/vrcm.ico"), app)
trayIcon.setToolTip("VRChat Cache Manager")
trayIcon.show()
if sys.platform == "win32":
# Taskbar icon for Windows
appid = 'vrcachemanager.vrcm.0.1' # arbitrary string
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(appid)
path_to_icon = './resources/vrcm.ico'
pixmap = QPixmap()
pixmap.loadFromData(Path(path_to_icon).read_bytes())
appIcon = QIcon(pixmap)
app.setWindowIcon(appIcon)
else:
# Set icon for other platforms
path_to_icon = './resources/vrcm.ico'
appIcon = QIcon(path_to_icon)
app.setWindowIcon(appIcon)
ex = QtGUIManager()
ex.show()
sys.exit(app.exec())