LiquidGUI [1.0.0.0]

This commit is contained in:
Dunestorm
2023-08-18 16:44:05 +01:00
commit e001645c65
13 changed files with 2489 additions and 0 deletions
Vendored
+5
View File
@@ -0,0 +1,5 @@
__pycache__
dist
build
.venv
LiquidGUI.spec
+16
View File
@@ -0,0 +1,16 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": true
}
]
}
+16
View File
@@ -0,0 +1,16 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Build",
"type": "shell",
"command": "cmd.exe /c build.bat",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

+3
View File
@@ -0,0 +1,3 @@
@echo off
pyside6-rcc.exe resources.qrc -o resources.py
pyinstaller.exe main.pyw --onefile --paths .venv\Lib\site-packages --icon resources\LiquidGUI.ico --name LiquidGUI
+32
View File
@@ -0,0 +1,32 @@
from liquidctl import find_liquidctl_devices
class LiquidCTL_Init():
device_name = None
device_temp = 0
device_fanSpeed = 0
device_pumpSpeed = 0
device_fwVers = 0
devices = find_liquidctl_devices()
for dev in devices:
with dev.connect():
#print(f'{dev.description}')
device_name = dev.description
init_status = dev.initialize()
if init_status:
for key, value, unit in init_status:
#print(f'- {key}: {value} {unit}')
device_fwVers = value
def Update(self):
with self.dev.connect():
status = self.dev.get_status()
for key, value, unit in status:
#print(f'- {key}: {value} {unit}')
if key == "Liquid temperature":
self.device_temp = value
elif key == "Fan speed":
self.device_fanSpeed = value
elif key == "Pump speed":
self.device_pumpSpeed = value
+82
View File
@@ -0,0 +1,82 @@
import sys
import qdarktheme
import win32mica
import liquidctl_worker
import resources
from PySide6.QtWidgets import QApplication, QMainWindow, QWidget, QVBoxLayout, QLabel, QProgressBar, QGroupBox
from PySide6.QtCore import Qt, QTimer, QThreadPool
from PySide6.QtGui import QFont, QIcon
class MainWindow(QMainWindow):
def __init__(self):
super(MainWindow, self).__init__()
self.setWindowTitle("LiquidGUI")
self.setFixedSize(450, 300)
self.setWindowFlags(Qt.WindowType.Dialog)
widget = QWidget(self)
font_style = QFont("Calibri", 16, weight=QFont.Weight.Bold)
self.lbl_device_name = QLabel()
self.lbl_device_name.setFont(font_style)
self.lbl_temp = QLabel("Liquid Temperature:")
self.prg_temp = QProgressBar(format="%v°C",
minimum=0,
maximum=50)
self.lbl_fanSpeed = QLabel("Fan Speed:")
self.prg_fanSpeed = QProgressBar(format="%v rpm",
minimum=520,
maximum=1700)
self.lbl_pumpSpeed = QLabel("Pump Speed:")
self.prg_pumpSpeed = QProgressBar(format="%v rpm",
minimum=1900,
maximum=2700)
self.lbl_fwVers = QLabel()
layout = QVBoxLayout(widget)
layout.addWidget(self.lbl_device_name)
layout.addWidget(self.lbl_temp)
layout.addWidget(self.prg_temp)
layout.addWidget(self.lbl_fanSpeed)
layout.addWidget(self.prg_fanSpeed)
layout.addWidget(self.lbl_pumpSpeed)
layout.addWidget(self.prg_pumpSpeed)
layout.addWidget(self.lbl_fwVers)
layout.setSpacing(10)
self.setLayout(layout)
self.setCentralWidget(widget)
self.setContentsMargins(40, 20, 40, 20)
self.thread_manager = QThreadPool()
self.timer = QTimer()
self.timer.setInterval(1000)
self.timer.timeout.connect(lambda: self.thread_manager.start(lctl_worker.Update))
self.timer.timeout.connect(self.update_widgets)
self.timer.start()
def update_widgets(self):
self.lbl_device_name.setText(lctl_worker.device_name)
self.prg_temp.setValue(lctl_worker.device_temp)
self.prg_fanSpeed.setValue(lctl_worker.device_fanSpeed)
self.prg_pumpSpeed.setValue(lctl_worker.device_pumpSpeed)
self.lbl_fwVers.setText(f"Fimrware: v{lctl_worker.device_fwVers}")
app = QApplication(sys.argv)
icon = QIcon(":/icons/LiquidGUI.ico")
app.setWindowIcon(icon)
lctl_worker = liquidctl_worker.LiquidCTL_Init()
window = MainWindow()
window.setWindowIcon(icon)
window.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground)
qdarktheme.setup_theme("dark", custom_colors={"background": "#00000000"})
win32mica.ApplyMica(window.winId(), win32mica.MICAMODE.DARK)
window.show()
app.exec()
BIN
View File
Binary file not shown.
+2329
View File
File diff suppressed because it is too large Load Diff
+6
View File
@@ -0,0 +1,6 @@
<!DOCTYPE RCC>
<RCC version="1.0">
<qresource prefix="icons">
<file alias="LiquidGUI.ico">resources/LiquidGUI.ico</file>
</qresource>
</RCC>
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB