Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f9e01cfd8e | |||
| 4d91e54e65 | |||
| 3cc53d0c81 | |||
| 03fca21675 | |||
| 040fff0677 |
@@ -0,0 +1,32 @@
|
|||||||
|
import subprocess
|
||||||
|
import re
|
||||||
|
|
||||||
|
class LiquidCTL_Helper():
|
||||||
|
device_name = None
|
||||||
|
device_temp = 0
|
||||||
|
device_fanSpeed = 0
|
||||||
|
device_pumpSpeed = 0
|
||||||
|
device_fwVers = None
|
||||||
|
|
||||||
|
devices = None
|
||||||
|
|
||||||
|
def ForceInit(self):
|
||||||
|
NotImplemented
|
||||||
|
|
||||||
|
def TestConnectionState(self):
|
||||||
|
output = subprocess.run(["liquidctl", "status"], stdout=subprocess.PIPE, universal_newlines=True)
|
||||||
|
if len(output.stdout) > 0:
|
||||||
|
return False
|
||||||
|
else:
|
||||||
|
return True
|
||||||
|
|
||||||
|
def Update(self):
|
||||||
|
output = subprocess.run(["liquidctl", "status"], stdout=subprocess.PIPE, universal_newlines=True)
|
||||||
|
self.device_name = str(re.search(r'^[^\n]*', output.stdout).group(0))
|
||||||
|
self.device_temp = float(re.search(r'Liquid temperature\s+(\d+\.?\d*)', output.stdout).group(1))
|
||||||
|
self.device_fanSpeed = int(re.search(r'Fan speed\s+(\d+)', output.stdout).group(1))
|
||||||
|
self.device_pumpSpeed = int(re.search(r'Pump speed\s+(\d+)', output.stdout).group(1))
|
||||||
|
|
||||||
|
|
||||||
|
def SetFanSpeed(self, speed):
|
||||||
|
NotImplemented
|
||||||
+1
-1
@@ -6,6 +6,6 @@ class MessageHandler():
|
|||||||
msg = QMessageBox()
|
msg = QMessageBox()
|
||||||
msg.setWindowTitle("LiquidGUI Error")
|
msg.setWindowTitle("LiquidGUI Error")
|
||||||
msg.setText("No suitable devices could be detected. Please ensure you have a cooler \
|
msg.setText("No suitable devices could be detected. Please ensure you have a cooler \
|
||||||
both compatible with LiquidCTL, and connected to the system.")
|
compatible with LiquidCTL, and connected to the system.")
|
||||||
msg.setIcon(QMessageBox.Icon.Warning)
|
msg.setIcon(QMessageBox.Icon.Warning)
|
||||||
msg.exec()
|
msg.exec()
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
pyside6-rcc resources.qrc -o resources.py
|
||||||
|
pyinstaller main.pyw --onefile --icon resources/LiquidGUI.png --name LiquidGUI
|
||||||
@@ -18,5 +18,5 @@ class MinMaxCurrent:
|
|||||||
self.min = _cur
|
self.min = _cur
|
||||||
|
|
||||||
return (f"🟢 Current: {self.cur}{_unit}\n"
|
return (f"🟢 Current: {self.cur}{_unit}\n"
|
||||||
f"❄️ Min: {self.min}{_unit} / "
|
f"Min: {self.min}{_unit} / "
|
||||||
f"☀️ Max: {self.max}{_unit}")
|
f"Max: {self.max}{_unit}")
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import platform
|
||||||
|
|
||||||
|
os = None
|
||||||
|
_platform = platform.platform()
|
||||||
|
if _platform.startswith("Linux"):
|
||||||
|
os = "Linux"
|
||||||
|
elif _platform.startswith("Windows"):
|
||||||
|
os = "Windows"
|
||||||
@@ -1,16 +1,30 @@
|
|||||||
# External Dependencies
|
# External Dependencies v####################################
|
||||||
import sys
|
import sys
|
||||||
import win32mica
|
from PySide6.QtWidgets import (QApplication,
|
||||||
from PySide6.QtWidgets import QApplication, QMainWindow, QWidget, QVBoxLayout, QLabel, QProgressBar, QPushButton
|
QMainWindow,
|
||||||
from PySide6.QtCore import Qt, QTimer, QThreadPool
|
QWidget,
|
||||||
from PySide6.QtGui import QFont, QIcon
|
QVBoxLayout,
|
||||||
import darkdetect
|
QProgressBar,
|
||||||
# Internal Imports
|
QPushButton)
|
||||||
from LiquidCTL_Helper import LiquidCTL_Helper
|
from PySide6.QtCore import (Qt,
|
||||||
from MessageHandler import MessageHandler
|
QTimer,
|
||||||
from styles import Labels
|
QThreadPool)
|
||||||
|
from PySide6.QtGui import QIcon
|
||||||
|
## Internal Imports #########################################
|
||||||
|
import resources
|
||||||
import common
|
import common
|
||||||
import resources, pkg_resources.extern
|
from MessageHandler import MessageHandler
|
||||||
|
## Platform Imports #########################################
|
||||||
|
import globals
|
||||||
|
if globals.os == "Windows":
|
||||||
|
from LiquidCTL_Helper_Windows import LiquidCTL_Helper
|
||||||
|
from styles import Labels_Windows as Labels
|
||||||
|
import win32mica
|
||||||
|
import darkdetect
|
||||||
|
elif globals.os == "Linux":
|
||||||
|
from LiquidCTL_Helper_Linux import LiquidCTL_Helper
|
||||||
|
from styles import Labels_Linux as Labels
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
class MainWindow(QMainWindow):
|
class MainWindow(QMainWindow):
|
||||||
@@ -18,7 +32,7 @@ class MainWindow(QMainWindow):
|
|||||||
|
|
||||||
def __init__(self, lctl):
|
def __init__(self, lctl):
|
||||||
super(MainWindow, self).__init__()
|
super(MainWindow, self).__init__()
|
||||||
self.setWindowTitle("LiquidGUI (v.1.1.3.0)")
|
self.setWindowTitle("LiquidGUI (v.1.2.0.0)")
|
||||||
self.setFixedSize(450, 500)
|
self.setFixedSize(450, 500)
|
||||||
|
|
||||||
self.lctl = lctl
|
self.lctl = lctl
|
||||||
@@ -112,23 +126,28 @@ class MainWindow(QMainWindow):
|
|||||||
def main():
|
def main():
|
||||||
""" Initialize application and setup window parameters. """
|
""" Initialize application and setup window parameters. """
|
||||||
app = QApplication(sys.argv)
|
app = QApplication(sys.argv)
|
||||||
icon = QIcon(":/icons/LiquidGUI.ico")
|
|
||||||
app.setWindowIcon(icon)
|
|
||||||
|
|
||||||
window = MainWindow(LiquidCTL_Helper())
|
window = MainWindow(LiquidCTL_Helper())
|
||||||
window.setWindowIcon(icon)
|
|
||||||
|
if globals.os == "Windows":
|
||||||
window.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground)
|
window.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground)
|
||||||
|
icon = QIcon(":/icons/LiquidGUI.ico")
|
||||||
|
|
||||||
|
if darkdetect.isDark():
|
||||||
|
win32mica.ApplyMica(window.winId(), win32mica.MICAMODE.DARK)
|
||||||
|
elif darkdetect.isLight():
|
||||||
|
win32mica.ApplyMica(window.winId(), win32mica.MICAMODE.LIGHT)
|
||||||
|
|
||||||
|
elif globals.os == "Linux":
|
||||||
|
app.setDesktopFileName("LiquidGUI")
|
||||||
|
icon = QIcon(":/icons/LiquidGUI.png")
|
||||||
|
|
||||||
|
app.setWindowIcon(icon)
|
||||||
|
|
||||||
# Show error and quit app if no devices are found
|
# Show error and quit app if no devices are found
|
||||||
if window.lctl.TestConnectionState():
|
if window.lctl.TestConnectionState():
|
||||||
MessageHandler().ShowNoDevicesFoundError()
|
MessageHandler().ShowNoDevicesFoundError()
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
if darkdetect.isDark():
|
|
||||||
win32mica.ApplyMica(window.winId(), win32mica.MICAMODE.DARK)
|
|
||||||
elif darkdetect.isLight():
|
|
||||||
win32mica.ApplyMica(window.winId(), win32mica.MICAMODE.LIGHT)
|
|
||||||
|
|
||||||
window.show()
|
window.show()
|
||||||
app.exec()
|
app.exec()
|
||||||
|
|
||||||
|
|||||||
+2703
-3
File diff suppressed because it is too large
Load Diff
@@ -2,5 +2,6 @@
|
|||||||
<RCC version="1.0">
|
<RCC version="1.0">
|
||||||
<qresource prefix="icons">
|
<qresource prefix="icons">
|
||||||
<file alias="LiquidGUI.ico">resources/LiquidGUI.ico</file>
|
<file alias="LiquidGUI.ico">resources/LiquidGUI.ico</file>
|
||||||
|
<file alias="LiquidGUI.png">resources/LiquidGUI.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
from PySide6.QtWidgets import QLabel
|
||||||
|
from PySide6.QtGui import QFont
|
||||||
|
from PySide6.QtCore import Qt
|
||||||
|
|
||||||
|
class MainLabel(QLabel):
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
self.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
||||||
|
self.setFont(QFont("Noto Sans",
|
||||||
|
16,
|
||||||
|
weight=QFont.Weight.ExtraBold))
|
||||||
|
class SubLabel(QLabel):
|
||||||
|
""" Formatting for sub-labels. """
|
||||||
|
|
||||||
|
def __init__(self, value):
|
||||||
|
super().__init__()
|
||||||
|
self.setFont(QFont("Noto Sans", 12, weight=QFont.Weight.Thin))
|
||||||
|
self.setText(value)
|
||||||
|
class SubLabelValue(QLabel):
|
||||||
|
""" Formatting for values. """
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
self.setAlignment(Qt.AlignmentFlag.AlignRight)
|
||||||
|
self.setFont(QFont("Noto Sans Mono", 8))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -7,7 +7,7 @@ class MainLabel(QLabel):
|
|||||||
super().__init__()
|
super().__init__()
|
||||||
self.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
self.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
||||||
self.setFont(QFont("Calibri",
|
self.setFont(QFont("Calibri",
|
||||||
18,
|
14.5,
|
||||||
weight=QFont.Weight.ExtraBold))
|
weight=QFont.Weight.ExtraBold))
|
||||||
class SubLabel(QLabel):
|
class SubLabel(QLabel):
|
||||||
""" Formatting for sub-labels. """
|
""" Formatting for sub-labels. """
|
||||||
Reference in New Issue
Block a user