Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f9e01cfd8e | |||
| 4d91e54e65 | |||
| 3cc53d0c81 | |||
| 03fca21675 | |||
| 040fff0677 | |||
| ca036a5576 | |||
| 39c8fe48c8 |
@@ -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.setWindowTitle("LiquidGUI Error")
|
||||
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.exec()
|
||||
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
pyside6-rcc resources.qrc -o resources.py
|
||||
pyinstaller main.pyw --onefile --icon resources/LiquidGUI.png --name LiquidGUI
|
||||
@@ -17,4 +17,6 @@ class MinMaxCurrent:
|
||||
if self.cur < self.min:
|
||||
self.min = _cur
|
||||
|
||||
return f"Current: {self.cur}{_unit}\n(Min: {self.min}{_unit} / Max: {self.max}{_unit})"
|
||||
return (f"🟢 Current: {self.cur}{_unit}\n"
|
||||
f"Min: {self.min}{_unit} / "
|
||||
f"Max: {self.max}{_unit}")
|
||||
|
||||
@@ -7,8 +7,8 @@ VSVersionInfo(
|
||||
ffi=FixedFileInfo(
|
||||
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
|
||||
# Set not needed items to zero 0. Must always contain 4 elements.
|
||||
filevers=(1,1,1,0),
|
||||
prodvers=(1,1,1,0),
|
||||
filevers=(1,1,3,0),
|
||||
prodvers=(1,1,3,0),
|
||||
# Contains a bitmask that specifies the valid bits 'flags'r
|
||||
mask=0x3f,
|
||||
# Contains a bitmask that specifies the Boolean attributes of the file.
|
||||
@@ -32,12 +32,12 @@ VSVersionInfo(
|
||||
u'040904B0',
|
||||
[StringStruct(u'CompanyName', u'Fil Sapia'),
|
||||
StringStruct(u'FileDescription', u'LiquidGUI'),
|
||||
StringStruct(u'FileVersion', u'1.1.1.0'),
|
||||
StringStruct(u'FileVersion', u'1.1.3.0'),
|
||||
StringStruct(u'InternalName', u'LiquidGUI'),
|
||||
StringStruct(u'LegalCopyright', u'© Fil Sapia. All rights reserved.'),
|
||||
StringStruct(u'OriginalFilename', u'LiquidGUI.exe'),
|
||||
StringStruct(u'ProductName', u'LiquidGUI'),
|
||||
StringStruct(u'ProductVersion', u'1.1.1.0')])
|
||||
StringStruct(u'ProductVersion', u'1.1.3.0')])
|
||||
]),
|
||||
VarFileInfo([VarStruct(u'Translation', [0, 1200, 1033, 1252])])
|
||||
]
|
||||
|
||||
@@ -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 win32mica
|
||||
from PySide6.QtWidgets import QApplication, QMainWindow, QWidget, QVBoxLayout, QLabel, QProgressBar, QPushButton
|
||||
from PySide6.QtCore import Qt, QTimer, QThreadPool
|
||||
from PySide6.QtGui import QFont, QIcon
|
||||
# Internal Imports
|
||||
from LiquidCTL_Helper import LiquidCTL_Helper
|
||||
from MessageHandler import MessageHandler
|
||||
from styles.SubLabel import SubLabel
|
||||
from styles.SubLabelValue import SubLabelValue
|
||||
from PySide6.QtWidgets import (QApplication,
|
||||
QMainWindow,
|
||||
QWidget,
|
||||
QVBoxLayout,
|
||||
QProgressBar,
|
||||
QPushButton)
|
||||
from PySide6.QtCore import (Qt,
|
||||
QTimer,
|
||||
QThreadPool)
|
||||
from PySide6.QtGui import QIcon
|
||||
## Internal Imports #########################################
|
||||
import resources
|
||||
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):
|
||||
@@ -18,41 +32,38 @@ class MainWindow(QMainWindow):
|
||||
|
||||
def __init__(self, lctl):
|
||||
super(MainWindow, self).__init__()
|
||||
self.setWindowTitle("LiquidGUI (v.1.1.1.0)")
|
||||
self.setFixedSize(450, 450)
|
||||
self.setWindowTitle("LiquidGUI (v.1.2.0.0)")
|
||||
self.setFixedSize(450, 500)
|
||||
|
||||
self.lctl = lctl
|
||||
|
||||
# Widgets ##########################################
|
||||
self.lbl_device_name = QLabel(font=QFont("Calibri",
|
||||
18,
|
||||
weight=QFont.Weight.Bold),
|
||||
alignment=Qt.AlignmentFlag.AlignCenter)
|
||||
self.lbl_device_name = Labels.MainLabel()
|
||||
|
||||
self.lbl_temp = SubLabel(value="💧 Liquid Temperature:")
|
||||
self.lbl_temp = Labels.SubLabel(value="💧 Liquid Temperature:")
|
||||
self.min_max_cur_temp = common.MinMaxCurrent()
|
||||
self.prg_temp = QProgressBar(textVisible=False,
|
||||
minimum=0,
|
||||
maximum=50)
|
||||
self.lbl_value_prg_temp = SubLabelValue()
|
||||
self.lbl_value_prg_temp = Labels.SubLabelValue()
|
||||
|
||||
self.lbl_fanspeed = SubLabel(value="🍃 Fan Speed:")
|
||||
self.lbl_fanspeed = Labels.SubLabel(value="🍃 Fan Speed:")
|
||||
self.min_max_cur_fanspeed = common.MinMaxCurrent()
|
||||
self.prg_fanspeed = QProgressBar(textVisible=False,
|
||||
minimum=520,
|
||||
maximum=1700)
|
||||
self.lbl_value_prg_fanspeed = SubLabelValue()
|
||||
self.lbl_value_prg_fanspeed = Labels.SubLabelValue()
|
||||
|
||||
self.lbl_pumpspeed = SubLabel(value="⛽ Pump Speed:")
|
||||
self.lbl_pumpspeed = Labels.SubLabel(value="⛽ Pump Speed:")
|
||||
self.min_max_cur_pumpspeed = common.MinMaxCurrent()
|
||||
self.prg_pumpspeed = QProgressBar(textVisible=False,
|
||||
minimum=1900,
|
||||
maximum=2700)
|
||||
self.lbl_value_prg_pumpspeed = SubLabelValue()
|
||||
self.lbl_value_prg_pumpspeed = Labels.SubLabelValue()
|
||||
self.btn_reset_min_max = QPushButton("Reset Min/Max")
|
||||
self.btn_reset_min_max.clicked.connect(self.on_reset_min_max)
|
||||
|
||||
self.lbl_fwvers = SubLabelValue()
|
||||
self.lbl_fwvers = Labels.SubLabelValue()
|
||||
|
||||
# Layout ##########################################
|
||||
widget = QWidget(self)
|
||||
@@ -115,20 +126,28 @@ class MainWindow(QMainWindow):
|
||||
def main():
|
||||
""" Initialize application and setup window parameters. """
|
||||
app = QApplication(sys.argv)
|
||||
icon = QIcon(":/icons/LiquidGUI.ico")
|
||||
app.setWindowIcon(icon)
|
||||
|
||||
window = MainWindow(LiquidCTL_Helper())
|
||||
window.setWindowIcon(icon)
|
||||
window.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground)
|
||||
|
||||
if globals.os == "Windows":
|
||||
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
|
||||
if window.lctl.TestConnectionState():
|
||||
MessageHandler().ShowNoDevicesFoundError()
|
||||
sys.exit(1)
|
||||
else:
|
||||
win32mica.ApplyMica(window.winId(), win32mica.MICAMODE.DARK)
|
||||
|
||||
window.show()
|
||||
app.exec()
|
||||
|
||||
|
||||
+2703
-3
File diff suppressed because it is too large
Load Diff
@@ -2,5 +2,6 @@
|
||||
<RCC version="1.0">
|
||||
<qresource prefix="icons">
|
||||
<file alias="LiquidGUI.ico">resources/LiquidGUI.ico</file>
|
||||
<file alias="LiquidGUI.png">resources/LiquidGUI.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
@@ -0,0 +1,12 @@
|
||||
from setuptools import setup
|
||||
|
||||
setup(
|
||||
name='LiquidGUI',
|
||||
version='1.1.3.0',
|
||||
packages=[''],
|
||||
url='',
|
||||
license='',
|
||||
author='Fil Sapia',
|
||||
author_email='filippo333@gmail.com',
|
||||
description=''
|
||||
)
|
||||
@@ -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))
|
||||
|
||||
|
||||
|
||||
@@ -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("Calibri",
|
||||
14.5,
|
||||
weight=QFont.Weight.ExtraBold))
|
||||
class SubLabel(QLabel):
|
||||
""" Formatting for sub-labels. """
|
||||
|
||||
def __init__(self, value):
|
||||
super().__init__()
|
||||
self.setFont(QFont("Calibri", 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("Cascadia Code", 8))
|
||||
|
||||
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
from PySide6.QtWidgets import QLabel
|
||||
from PySide6.QtGui import QFont
|
||||
|
||||
|
||||
class SubLabel(QLabel):
|
||||
""" Formatting for sub-labels. """
|
||||
|
||||
def __init__(self, value):
|
||||
super().__init__()
|
||||
self.setFont(QFont("Calibri", 12, weight=QFont.Weight.Bold))
|
||||
self.setText(value)
|
||||
@@ -1,10 +0,0 @@
|
||||
from PySide6.QtWidgets import QLabel
|
||||
from PySide6.QtGui import QFont
|
||||
from PySide6.QtCore import Qt
|
||||
|
||||
class SubLabelValue(QLabel):
|
||||
""" Formatting for values. """
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setAlignment(Qt.AlignmentFlag.AlignRight)
|
||||
self.setFont(QFont("Cascadia Code", 8))
|
||||
Reference in New Issue
Block a user