diff --git a/.SRCINFO b/.SRCINFO index 5e0952d..a3ee6e5 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,6 +1,6 @@ pkgbase = coolerdash pkgdesc = Plug-in for CoolerControl that extends the LCD functionality with additional features - pkgver = 3.1.2 + pkgver = 3.1.3 pkgrel = 1 url = https://github.com/damachine/coolerdash install = coolerdash.install @@ -17,7 +17,6 @@ pkgbase = coolerdash provides = coolerdash-git conflicts = coolerdash-git replaces = coolerdash-git - backup = etc/coolercontrol/plugins/coolerdash/config.json - backup = etc/coolercontrol/plugins/coolerdash/credentials.json + backup = var/lib/coolercontrol/plugins/coolerdash/config.json pkgname = coolerdash diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index 3d35f76..3ea9cba 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -59,7 +59,7 @@ jobs: steps: - name: Checkout CoolerDash code - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Update package manager run: ${{ matrix.pre_install }} @@ -102,7 +102,7 @@ jobs: fi # Check plugin files - if [ -f "/tmp/install-test/etc/coolercontrol/plugins/coolerdash/config.json" ]; then + if [ -f "/tmp/install-test/var/lib/coolercontrol/plugins/coolerdash/config.json" ]; then echo "✅ Config file installed (plugin mode)" else echo "❌ Config file not found" @@ -110,7 +110,7 @@ jobs: fi # Check manifest.toml - if [ -f "/tmp/install-test/etc/coolercontrol/plugins/coolerdash/manifest.toml" ]; then + if [ -f "/tmp/install-test/var/lib/coolercontrol/plugins/coolerdash/manifest.toml" ]; then echo "✅ Plugin manifest installed" else echo "❌ Plugin manifest not found" @@ -118,7 +118,7 @@ jobs: fi # Check UI files - if [ -f "/tmp/install-test/etc/coolercontrol/plugins/coolerdash/ui/index.html" ]; then + if [ -f "/tmp/install-test/var/lib/coolercontrol/plugins/coolerdash/ui/index.html" ]; then echo "✅ Plugin UI file installed" else echo "❌ Plugin UI file not found" @@ -126,7 +126,7 @@ jobs: fi # Check CC-Plugin Lib JS is NOT installed (served by CoolerControl) - if [ -f "/tmp/install-test/etc/coolercontrol/plugins/coolerdash/ui/cc-plugin-lib.js" ]; then + if [ -f "/tmp/install-test/var/lib/coolercontrol/plugins/coolerdash/ui/cc-plugin-lib.js" ]; then echo "❌ Plugin Lib JS should NOT be installed (served by CoolerControl)" exit 1 else @@ -176,7 +176,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Setup Arch Linux run: | @@ -202,7 +202,7 @@ jobs: fi # Check plugin config - if [ -f "/tmp/install-test/etc/coolercontrol/plugins/coolerdash/config.json" ]; then + if [ -f "/tmp/install-test/var/lib/coolercontrol/plugins/coolerdash/config.json" ]; then echo "✅ Config file installed" else echo "❌ Config file not found" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6704742..79eed52 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,7 +25,7 @@ jobs: commit_sha: ${{ steps.commit.outputs.sha }} steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 token: ${{ secrets.GITHUB_TOKEN }} @@ -178,7 +178,7 @@ jobs: git - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: ref: master fetch-depth: 0 @@ -259,7 +259,7 @@ jobs: if: github.ref == 'refs/heads/master' steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 token: ${{ secrets.GITHUB_TOKEN }} @@ -466,7 +466,7 @@ jobs: if: github.ref == 'refs/heads/master' steps: - name: Checkout main repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 diff --git a/.gitignore b/.gitignore index 90e6945..cc0d70d 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ coolerdash-bin/ *.old *.db *.files +docs/ src/ pkg/ bin/ diff --git a/Makefile b/Makefile index 6548330..c0c8c95 100644 --- a/Makefile +++ b/Makefile @@ -60,8 +60,8 @@ INSTALL ?= install INSTALL_PROGRAM ?= $(INSTALL) INSTALL_DATA ?= $(INSTALL) -m 644 -# Plugin directory (derived) -PLUGINDIR = $(sysconfdir)/coolercontrol/plugins/coolerdash +# Plugin directory (canonical path per CoolerControl cc-plugins spec) +PLUGINDIR = /var/lib/coolercontrol/plugins/coolerdash # Colors for terminal output RED = \033[0;31m @@ -239,7 +239,7 @@ check: $(OBJDIR) ./$(OBJDIR)/test_scaling @printf "$(GREEN)All tests passed$(RESET)\n" -# Install binary to /usr/libexec, plugin data to /etc/coolercontrol/plugins/coolerdash/ +# Install binary to /usr/libexec, plugin data to /var/lib/coolercontrol/plugins/coolerdash/ install: check-deps $(TARGET) @printf "\n" @printf "$(WHITE)=== COOLERDASH INSTALLATION ===$(RESET)\n" @@ -322,6 +322,28 @@ install: check-deps $(TARGET) printf " $(BLUE)->$(RESET) No legacy files found (clean install)\n"; \ fi; \ printf "\n"; \ + if [ -f /etc/coolercontrol/plugins/coolerdash/config.json ] && \ + [ ! -f "$(PLUGINDIR)/config.json" ]; then \ + $(SUDO) mkdir -p "$(PLUGINDIR)"; \ + $(SUDO) cp /etc/coolercontrol/plugins/coolerdash/config.json \ + "$(PLUGINDIR)/config.json"; \ + $(SUDO) chmod 600 "$(PLUGINDIR)/config.json"; \ + printf " $(GREEN)Migrated:$(RESET) config.json to $(PLUGINDIR)/\n"; \ + fi; \ + if [ -f /etc/coolercontrol/plugins/coolerdash/credentials.json ] && \ + [ ! -f "$(PLUGINDIR)/credentials.json" ]; then \ + $(SUDO) mkdir -p "$(PLUGINDIR)"; \ + $(SUDO) cp /etc/coolercontrol/plugins/coolerdash/credentials.json \ + "$(PLUGINDIR)/credentials.json"; \ + $(SUDO) chmod 600 "$(PLUGINDIR)/credentials.json"; \ + printf " $(GREEN)Migrated:$(RESET) credentials.json to $(PLUGINDIR)/\n"; \ + fi; \ + rm -f /etc/coolercontrol/plugins/coolerdash/manifest.toml; \ + rm -rf /etc/coolercontrol/plugins/coolerdash/ui; \ + rm -f /etc/coolercontrol/plugins/coolerdash/shutdown.png; \ + rm -f /etc/coolercontrol/plugins/coolerdash/README.md; \ + rm -f /etc/coolercontrol/plugins/coolerdash/CHANGELOG.md; \ + rm -f /etc/coolercontrol/plugins/coolerdash/VERSION; \ COOLERDASH_COUNT=$$(pgrep -x coolerdash 2>/dev/null | wc -l); \ if [ "$$COOLERDASH_COUNT" -gt 0 ]; then \ printf "$(CYAN)Terminating running coolerdash process(es)...$(RESET)\n"; \ @@ -484,6 +506,8 @@ uninstall: fi; \ fi @$(SUDO) rm -rf "$(DESTDIR)$(PLUGINDIR)" + # Legacy path cleanup for users upgrading from older versions + @$(SUDO) rm -rf "$(DESTDIR)/etc/coolercontrol/plugins/coolerdash" @$(SUDO) rm -rf "$(DESTDIR)$(libexecdir)/coolerdash" @$(SUDO) rm -rf "$(DESTDIR)$(datarootdir)/licenses/coolerdash" @$(SUDO) rm -f "$(DESTDIR)$(mandir)/man1/coolerdash.1" diff --git a/PKGBUILD b/PKGBUILD index e521e89..9827d7d 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -15,8 +15,7 @@ license=('MIT') depends=('cairo' 'jansson' 'libcurl-gnutls' 'ttf-roboto') makedepends=('gcc' 'make' 'pkg-config' 'git') optdepends=() -backup=('etc/coolercontrol/plugins/coolerdash/config.json' - 'etc/coolercontrol/plugins/coolerdash/credentials.json') +backup=('var/lib/coolercontrol/plugins/coolerdash/config.json') install=coolerdash.install source=() sha256sums=() @@ -43,14 +42,14 @@ build() { make # Copy files to srcdir for packaging (fakeroot cannot access startdir) - mkdir -p "${srcdir}/bin" "${srcdir}/images" "${srcdir}/man" "${srcdir}/etc/coolercontrol/plugins/coolerdash/ui" "${srcdir}/etc/applications" "${srcdir}/etc/icons" + mkdir -p "${srcdir}/bin" "${srcdir}/images" "${srcdir}/man" "${srcdir}/var/lib/coolercontrol/plugins/coolerdash/ui" "${srcdir}/etc/applications" "${srcdir}/etc/icons" cp -a bin/coolerdash "${srcdir}/bin/coolerdash" cp -a README.md CHANGELOG.md VERSION LICENSE "${srcdir}/" - cp -a etc/coolercontrol/plugins/coolerdash/config.json "${srcdir}/etc/coolercontrol/plugins/coolerdash/" - cp -a etc/coolercontrol/plugins/coolerdash/ui/index.html "${srcdir}/etc/coolercontrol/plugins/coolerdash/ui/" + cp -a etc/coolercontrol/plugins/coolerdash/config.json "${srcdir}/var/lib/coolercontrol/plugins/coolerdash/" + cp -a etc/coolercontrol/plugins/coolerdash/ui/index.html "${srcdir}/var/lib/coolercontrol/plugins/coolerdash/ui/" cp -a images/shutdown.png "${srcdir}/images/" cp -a man/coolerdash.1 "${srcdir}/man/" - cp -a etc/coolercontrol/plugins/coolerdash/manifest.toml "${srcdir}/etc/coolercontrol/plugins/coolerdash/" + cp -a etc/coolercontrol/plugins/coolerdash/manifest.toml "${srcdir}/var/lib/coolercontrol/plugins/coolerdash/" cp -a etc/applications/coolerdash.desktop "${srcdir}/etc/applications/" cp -a etc/icons/coolerdash.svg "${srcdir}/etc/icons/" } @@ -69,21 +68,22 @@ check() { } package() { - # Binary to /usr/libexec, plugin data stays in /etc/coolercontrol/plugins/ - install -dm755 "${pkgdir}/etc/coolercontrol/plugins/coolerdash" + # Binary to /usr/libexec, plugin data to /var/lib/coolercontrol/plugins/ + install -dm711 "${pkgdir}/var/lib/coolercontrol" + install -dm755 "${pkgdir}/var/lib/coolercontrol/plugins/coolerdash" install -Dm755 "${srcdir}/bin/coolerdash" "${pkgdir}/usr/libexec/coolerdash/coolerdash" - install -Dm644 "${srcdir}/README.md" "${pkgdir}/etc/coolercontrol/plugins/coolerdash/README.md" - install -Dm644 "${srcdir}/VERSION" "${pkgdir}/etc/coolercontrol/plugins/coolerdash/VERSION" - install -Dm644 "${srcdir}/CHANGELOG.md" "${pkgdir}/etc/coolercontrol/plugins/coolerdash/CHANGELOG.md" - install -Dm600 "${srcdir}/etc/coolercontrol/plugins/coolerdash/config.json" "${pkgdir}/etc/coolercontrol/plugins/coolerdash/config.json" + install -Dm644 "${srcdir}/README.md" "${pkgdir}/var/lib/coolercontrol/plugins/coolerdash/README.md" + install -Dm644 "${srcdir}/VERSION" "${pkgdir}/var/lib/coolercontrol/plugins/coolerdash/VERSION" + install -Dm644 "${srcdir}/CHANGELOG.md" "${pkgdir}/var/lib/coolercontrol/plugins/coolerdash/CHANGELOG.md" + install -Dm600 "${srcdir}/var/lib/coolercontrol/plugins/coolerdash/config.json" "${pkgdir}/var/lib/coolercontrol/plugins/coolerdash/config.json" - install -dm755 "${pkgdir}/etc/coolercontrol/plugins/coolerdash/ui" - install -m644 "${srcdir}/etc/coolercontrol/plugins/coolerdash/ui/index.html" "${pkgdir}/etc/coolercontrol/plugins/coolerdash/ui/index.html" - install -Dm644 "${srcdir}/images/shutdown.png" "${pkgdir}/etc/coolercontrol/plugins/coolerdash/shutdown.png" - install -Dm644 "${srcdir}/etc/coolercontrol/plugins/coolerdash/manifest.toml" "${pkgdir}/etc/coolercontrol/plugins/coolerdash/manifest.toml" + install -dm755 "${pkgdir}/var/lib/coolercontrol/plugins/coolerdash/ui" + install -m644 "${srcdir}/var/lib/coolercontrol/plugins/coolerdash/ui/index.html" "${pkgdir}/var/lib/coolercontrol/plugins/coolerdash/ui/index.html" + install -Dm644 "${srcdir}/images/shutdown.png" "${pkgdir}/var/lib/coolercontrol/plugins/coolerdash/shutdown.png" + install -Dm644 "${srcdir}/var/lib/coolercontrol/plugins/coolerdash/manifest.toml" "${pkgdir}/var/lib/coolercontrol/plugins/coolerdash/manifest.toml" - sed -i "s/{{VERSION}}/${pkgver}/g" "${pkgdir}/etc/coolercontrol/plugins/coolerdash/manifest.toml" - sed -i "s/{{VERSION}}/${pkgver}/g" "${pkgdir}/etc/coolercontrol/plugins/coolerdash/ui/index.html" + sed -i "s/{{VERSION}}/${pkgver}/g" "${pkgdir}/var/lib/coolercontrol/plugins/coolerdash/manifest.toml" + sed -i "s/{{VERSION}}/${pkgver}/g" "${pkgdir}/var/lib/coolercontrol/plugins/coolerdash/ui/index.html" install -Dm644 "${srcdir}/man/coolerdash.1" "${pkgdir}/usr/share/man/man1/coolerdash.1" install -Dm644 "${srcdir}/etc/applications/coolerdash.desktop" "${pkgdir}/usr/share/applications/coolerdash.desktop" diff --git a/VERSION b/VERSION index ef538c2..ff365e0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.1.2 +3.1.3 diff --git a/aur/PKGBUILD b/aur/PKGBUILD index d4c3176..1489068 100644 --- a/aur/PKGBUILD +++ b/aur/PKGBUILD @@ -12,8 +12,7 @@ url="https://github.com/damachine/coolerdash" license=('MIT') depends=('cairo' 'coolercontrol' 'jansson' 'libcurl-gnutls' 'ttf-roboto') makedepends=('gcc' 'make' 'pkg-config' 'git') -backup=('etc/coolercontrol/plugins/coolerdash/config.json' - 'etc/coolercontrol/plugins/coolerdash/credentials.json') +backup=('var/lib/coolercontrol/plugins/coolerdash/config.json') install=coolerdash.install _commit= source=("coolerdash-git::git+https://github.com/damachine/coolerdash.git#commit=${_commit}") @@ -56,21 +55,22 @@ check() { } package() { - # Binary to /usr/libexec, plugin data stays in /etc/coolercontrol/plugins/ - install -dm755 "${pkgdir}/etc/coolercontrol/plugins/coolerdash" + # Binary to /usr/libexec, plugin data to /var/lib/coolercontrol/plugins/ + install -dm711 "${pkgdir}/var/lib/coolercontrol" + install -dm755 "${pkgdir}/var/lib/coolercontrol/plugins/coolerdash" install -Dm755 "${srcdir}/${pkgname}/bin/coolerdash" "${pkgdir}/usr/libexec/coolerdash/coolerdash" - install -m644 "${srcdir}/${pkgname}/README.md" "${pkgdir}/etc/coolercontrol/plugins/coolerdash/README.md" - install -m644 "${srcdir}/${pkgname}/VERSION" "${pkgdir}/etc/coolercontrol/plugins/coolerdash/VERSION" - install -m644 "${srcdir}/${pkgname}/CHANGELOG.md" "${pkgdir}/etc/coolercontrol/plugins/coolerdash/CHANGELOG.md" - install -m600 "${srcdir}/${pkgname}/etc/coolercontrol/plugins/coolerdash/config.json" "${pkgdir}/etc/coolercontrol/plugins/coolerdash/config.json" + install -m644 "${srcdir}/${pkgname}/README.md" "${pkgdir}/var/lib/coolercontrol/plugins/coolerdash/README.md" + install -m644 "${srcdir}/${pkgname}/VERSION" "${pkgdir}/var/lib/coolercontrol/plugins/coolerdash/VERSION" + install -m644 "${srcdir}/${pkgname}/CHANGELOG.md" "${pkgdir}/var/lib/coolercontrol/plugins/coolerdash/CHANGELOG.md" + install -m600 "${srcdir}/${pkgname}/etc/coolercontrol/plugins/coolerdash/config.json" "${pkgdir}/var/lib/coolercontrol/plugins/coolerdash/config.json" - install -dm755 "${pkgdir}/etc/coolercontrol/plugins/coolerdash/ui" - install -m644 "${srcdir}/${pkgname}/etc/coolercontrol/plugins/coolerdash/ui/index.html" "${pkgdir}/etc/coolercontrol/plugins/coolerdash/ui/index.html" - install -m644 "${srcdir}/${pkgname}/images/shutdown.png" "${pkgdir}/etc/coolercontrol/plugins/coolerdash/shutdown.png" - install -m644 "${srcdir}/${pkgname}/etc/coolercontrol/plugins/coolerdash/manifest.toml" "${pkgdir}/etc/coolercontrol/plugins/coolerdash/manifest.toml" + install -dm755 "${pkgdir}/var/lib/coolercontrol/plugins/coolerdash/ui" + install -m644 "${srcdir}/${pkgname}/etc/coolercontrol/plugins/coolerdash/ui/index.html" "${pkgdir}/var/lib/coolercontrol/plugins/coolerdash/ui/index.html" + install -m644 "${srcdir}/${pkgname}/images/shutdown.png" "${pkgdir}/var/lib/coolercontrol/plugins/coolerdash/shutdown.png" + install -m644 "${srcdir}/${pkgname}/etc/coolercontrol/plugins/coolerdash/manifest.toml" "${pkgdir}/var/lib/coolercontrol/plugins/coolerdash/manifest.toml" - sed -i "s/{{VERSION}}/${pkgver}/g" "${pkgdir}/etc/coolercontrol/plugins/coolerdash/manifest.toml" - sed -i "s/{{VERSION}}/${pkgver}/g" "${pkgdir}/etc/coolercontrol/plugins/coolerdash/ui/index.html" + sed -i "s/{{VERSION}}/${pkgver}/g" "${pkgdir}/var/lib/coolercontrol/plugins/coolerdash/manifest.toml" + sed -i "s/{{VERSION}}/${pkgver}/g" "${pkgdir}/var/lib/coolercontrol/plugins/coolerdash/ui/index.html" install -Dm644 "${srcdir}/${pkgname}/man/coolerdash.1" "${pkgdir}/usr/share/man/man1/coolerdash.1" install -Dm644 "${srcdir}/${pkgname}/etc/applications/coolerdash.desktop" "${pkgdir}/usr/share/applications/coolerdash.desktop" diff --git a/aur/coolerdash.install b/aur/coolerdash.install index b6c708d..e730175 100644 --- a/aur/coolerdash.install +++ b/aur/coolerdash.install @@ -1,16 +1,8 @@ -# Created by: damachin3 (damachine3 at proton dot me) -# Website: https://github.com/damachine/coolerdash - -# Pacman install hooks - pre_install() { - # Stop legacy service if systemctl list-unit-files coolerdash.service | grep -q coolerdash; then systemctl stop coolerdash.service systemctl disable coolerdash.service fi - - # Remove legacy files rm -f /etc/systemd/system/coolerdash.service rm -f /etc/systemd/system/coolerdash-helperd.service rm -f /etc/systemd/system/multi-user.target.wants/coolerdash-helperd.service @@ -26,35 +18,73 @@ pre_install() { rm -f /usr/share/applications/coolerdash-settings.desktop rm -f /bin/coolerdash rm -f /usr/bin/coolerdash - - # Remove legacy user if id -u coolerdash &>/dev/null; then userdel -rf coolerdash fi + if [ -f /etc/coolercontrol/plugins/coolerdash/config.json ] && \ + [ ! -f /var/lib/coolercontrol/plugins/coolerdash/config.json ]; then + mkdir -p /var/lib/coolercontrol/plugins/coolerdash + cp /etc/coolercontrol/plugins/coolerdash/config.json \ + /var/lib/coolercontrol/plugins/coolerdash/config.json + chmod 600 /var/lib/coolercontrol/plugins/coolerdash/config.json + fi + if [ -f /etc/coolercontrol/plugins/coolerdash/credentials.json ] && \ + [ ! -f /var/lib/coolercontrol/plugins/coolerdash/credentials.json ]; then + mkdir -p /var/lib/coolercontrol/plugins/coolerdash + cp /etc/coolercontrol/plugins/coolerdash/credentials.json \ + /var/lib/coolercontrol/plugins/coolerdash/credentials.json + chmod 600 /var/lib/coolercontrol/plugins/coolerdash/credentials.json + fi + rm -f /etc/coolercontrol/plugins/coolerdash/manifest.toml + rm -rf /etc/coolercontrol/plugins/coolerdash/ui + rm -f /etc/coolercontrol/plugins/coolerdash/shutdown.png + rm -f /etc/coolercontrol/plugins/coolerdash/README.md + rm -f /etc/coolercontrol/plugins/coolerdash/CHANGELOG.md + rm -f /etc/coolercontrol/plugins/coolerdash/VERSION +} + +pre_upgrade() { + if [ -f /etc/coolercontrol/plugins/coolerdash/config.json ] && \ + [ ! -f /var/lib/coolercontrol/plugins/coolerdash/config.json ]; then + mkdir -p /var/lib/coolercontrol/plugins/coolerdash + cp /etc/coolercontrol/plugins/coolerdash/config.json \ + /var/lib/coolercontrol/plugins/coolerdash/config.json + chmod 600 /var/lib/coolercontrol/plugins/coolerdash/config.json + fi + if [ -f /etc/coolercontrol/plugins/coolerdash/credentials.json ] && \ + [ ! -f /var/lib/coolercontrol/plugins/coolerdash/credentials.json ]; then + mkdir -p /var/lib/coolercontrol/plugins/coolerdash + cp /etc/coolercontrol/plugins/coolerdash/credentials.json \ + /var/lib/coolercontrol/plugins/coolerdash/credentials.json + chmod 600 /var/lib/coolercontrol/plugins/coolerdash/credentials.json + fi + rm -f /etc/coolercontrol/plugins/coolerdash/manifest.toml + rm -rf /etc/coolercontrol/plugins/coolerdash/ui + rm -f /etc/coolercontrol/plugins/coolerdash/shutdown.png + rm -f /etc/coolercontrol/plugins/coolerdash/README.md + rm -f /etc/coolercontrol/plugins/coolerdash/CHANGELOG.md + rm -f /etc/coolercontrol/plugins/coolerdash/VERSION } post_install() { - # Remove legacy files rm -f /etc/systemd/system/multi-user.target.wants/coolerdash-helperd.service rm -f /etc/systemd/system/coolerdash-helperd.service rm -f /usr/lib/systemd/system/coolerdash-helperd.service rm -rf /etc/systemd/system/cc-plugin-coolerdash.service.d rm -f /usr/lib/udev/rules.d/99-coolerdash.rules - - # Ensure correct permissions on config.json - chmod 600 /etc/coolercontrol/plugins/coolerdash/config.json 2>/dev/null || true - chmod 600 /etc/coolercontrol/plugins/coolerdash/credentials.json 2>/dev/null || true - + if [ ! -f /var/lib/coolercontrol/plugins/coolerdash/credentials.json ]; then + mkdir -p /var/lib/coolercontrol/plugins/coolerdash + printf '{\n "access_token": ""\n}\n' > /var/lib/coolercontrol/plugins/coolerdash/credentials.json + fi + chmod 600 /var/lib/coolercontrol/plugins/coolerdash/config.json 2>/dev/null || true + chmod 600 /var/lib/coolercontrol/plugins/coolerdash/credentials.json 2>/dev/null || true systemctl daemon-reload - - # Restart plugin service directly if it already exists (reinstall case) + systemctl reset-failed cc-plugin-coolerdash.service >/dev/null 2>&1 || true if systemctl list-unit-files cc-plugin-coolerdash.service | grep -q cc-plugin-coolerdash; then systemctl restart cc-plugin-coolerdash.service || echo "Note: Plugin restart failed." - else - # Fresh install: restart CoolerControl so it discovers and starts the plugin service - if systemctl list-unit-files coolercontrold.service | grep -q coolercontrold; then - systemctl restart coolercontrold.service || echo "Note: CoolerControl restart failed." - fi + fi + if systemctl list-unit-files coolercontrold.service | grep -q coolercontrold; then + systemctl restart coolercontrold.service || echo "Note: CoolerControl restart failed." fi echo "================================================================" @@ -65,52 +95,47 @@ post_install() { } post_upgrade() { - # Remove legacy files rm -f /etc/systemd/system/multi-user.target.wants/coolerdash-helperd.service rm -f /etc/systemd/system/coolerdash-helperd.service rm -f /usr/lib/systemd/system/coolerdash-helperd.service rm -rf /etc/systemd/system/cc-plugin-coolerdash.service.d rm -f /usr/lib/udev/rules.d/99-coolerdash.rules - - # Ensure correct permissions on config.json - chmod 600 /etc/coolercontrol/plugins/coolerdash/config.json 2>/dev/null || true - chmod 600 /etc/coolercontrol/plugins/coolerdash/credentials.json 2>/dev/null || true - + if [ ! -f /var/lib/coolercontrol/plugins/coolerdash/credentials.json ]; then + mkdir -p /var/lib/coolercontrol/plugins/coolerdash + printf '{\n "access_token": ""\n}\n' > /var/lib/coolercontrol/plugins/coolerdash/credentials.json + fi + chmod 600 /var/lib/coolercontrol/plugins/coolerdash/config.json 2>/dev/null || true + chmod 600 /var/lib/coolercontrol/plugins/coolerdash/credentials.json 2>/dev/null || true systemctl daemon-reload - - # Restart plugin + systemctl reset-failed cc-plugin-coolerdash.service >/dev/null 2>&1 || true if systemctl list-unit-files cc-plugin-coolerdash.service | grep -q cc-plugin-coolerdash; then systemctl restart cc-plugin-coolerdash.service || echo "Note: Plugin restart failed." fi + if systemctl list-unit-files coolercontrold.service | grep -q coolercontrold; then + systemctl restart coolercontrold.service || echo "Note: CoolerControl restart failed." + fi echo "================================================================" echo "CoolerDash upgraded successfully." echo "Note: config.json is preserved. If a new template was shipped," - echo " compare it with /etc/coolercontrol/plugins/coolerdash/config.json.pacnew" + echo " compare it with /var/lib/coolercontrol/plugins/coolerdash/config.json.pacnew" echo "Note: credentials.json is never overwritten by updates." echo "================================================================" } pre_remove() { - # Stop legacy service if systemctl list-unit-files coolerdash.service | grep -q coolerdash; then systemctl stop coolerdash.service systemctl disable coolerdash.service fi - - # Stop plugin if systemctl list-unit-files cc-plugin-coolerdash.service | grep -q cc-plugin-coolerdash; then systemctl stop cc-plugin-coolerdash.service systemctl disable cc-plugin-coolerdash.service fi - - # Stop helperd if systemctl list-unit-files coolerdash-helperd.service | grep -q coolerdash-helperd; then systemctl stop --no-block coolerdash-helperd.service systemctl disable coolerdash-helperd.service fi - - # Remove legacy files rm -f /etc/systemd/system/coolerdash-helperd.service rm -f /etc/systemd/system/coolerdash.service rm -f /etc/systemd/system/multi-user.target.wants/coolerdash-helperd.service @@ -124,15 +149,10 @@ pre_remove() { rm -f /usr/bin/coolerdash rm -rf /opt/coolerdash rm -rf /etc/coolerdash - - # Remove legacy user if id -u coolerdash &>/dev/null; then userdel -rf coolerdash fi - systemctl daemon-reload - - # Restart CoolerControl if systemctl list-unit-files coolercontrold.service | grep -q coolercontrold; then systemctl restart coolercontrold.service || echo "Note: CoolerControl restart failed." fi diff --git a/coolerdash.install b/coolerdash.install index b6c708d..e730175 100644 --- a/coolerdash.install +++ b/coolerdash.install @@ -1,16 +1,8 @@ -# Created by: damachin3 (damachine3 at proton dot me) -# Website: https://github.com/damachine/coolerdash - -# Pacman install hooks - pre_install() { - # Stop legacy service if systemctl list-unit-files coolerdash.service | grep -q coolerdash; then systemctl stop coolerdash.service systemctl disable coolerdash.service fi - - # Remove legacy files rm -f /etc/systemd/system/coolerdash.service rm -f /etc/systemd/system/coolerdash-helperd.service rm -f /etc/systemd/system/multi-user.target.wants/coolerdash-helperd.service @@ -26,35 +18,73 @@ pre_install() { rm -f /usr/share/applications/coolerdash-settings.desktop rm -f /bin/coolerdash rm -f /usr/bin/coolerdash - - # Remove legacy user if id -u coolerdash &>/dev/null; then userdel -rf coolerdash fi + if [ -f /etc/coolercontrol/plugins/coolerdash/config.json ] && \ + [ ! -f /var/lib/coolercontrol/plugins/coolerdash/config.json ]; then + mkdir -p /var/lib/coolercontrol/plugins/coolerdash + cp /etc/coolercontrol/plugins/coolerdash/config.json \ + /var/lib/coolercontrol/plugins/coolerdash/config.json + chmod 600 /var/lib/coolercontrol/plugins/coolerdash/config.json + fi + if [ -f /etc/coolercontrol/plugins/coolerdash/credentials.json ] && \ + [ ! -f /var/lib/coolercontrol/plugins/coolerdash/credentials.json ]; then + mkdir -p /var/lib/coolercontrol/plugins/coolerdash + cp /etc/coolercontrol/plugins/coolerdash/credentials.json \ + /var/lib/coolercontrol/plugins/coolerdash/credentials.json + chmod 600 /var/lib/coolercontrol/plugins/coolerdash/credentials.json + fi + rm -f /etc/coolercontrol/plugins/coolerdash/manifest.toml + rm -rf /etc/coolercontrol/plugins/coolerdash/ui + rm -f /etc/coolercontrol/plugins/coolerdash/shutdown.png + rm -f /etc/coolercontrol/plugins/coolerdash/README.md + rm -f /etc/coolercontrol/plugins/coolerdash/CHANGELOG.md + rm -f /etc/coolercontrol/plugins/coolerdash/VERSION +} + +pre_upgrade() { + if [ -f /etc/coolercontrol/plugins/coolerdash/config.json ] && \ + [ ! -f /var/lib/coolercontrol/plugins/coolerdash/config.json ]; then + mkdir -p /var/lib/coolercontrol/plugins/coolerdash + cp /etc/coolercontrol/plugins/coolerdash/config.json \ + /var/lib/coolercontrol/plugins/coolerdash/config.json + chmod 600 /var/lib/coolercontrol/plugins/coolerdash/config.json + fi + if [ -f /etc/coolercontrol/plugins/coolerdash/credentials.json ] && \ + [ ! -f /var/lib/coolercontrol/plugins/coolerdash/credentials.json ]; then + mkdir -p /var/lib/coolercontrol/plugins/coolerdash + cp /etc/coolercontrol/plugins/coolerdash/credentials.json \ + /var/lib/coolercontrol/plugins/coolerdash/credentials.json + chmod 600 /var/lib/coolercontrol/plugins/coolerdash/credentials.json + fi + rm -f /etc/coolercontrol/plugins/coolerdash/manifest.toml + rm -rf /etc/coolercontrol/plugins/coolerdash/ui + rm -f /etc/coolercontrol/plugins/coolerdash/shutdown.png + rm -f /etc/coolercontrol/plugins/coolerdash/README.md + rm -f /etc/coolercontrol/plugins/coolerdash/CHANGELOG.md + rm -f /etc/coolercontrol/plugins/coolerdash/VERSION } post_install() { - # Remove legacy files rm -f /etc/systemd/system/multi-user.target.wants/coolerdash-helperd.service rm -f /etc/systemd/system/coolerdash-helperd.service rm -f /usr/lib/systemd/system/coolerdash-helperd.service rm -rf /etc/systemd/system/cc-plugin-coolerdash.service.d rm -f /usr/lib/udev/rules.d/99-coolerdash.rules - - # Ensure correct permissions on config.json - chmod 600 /etc/coolercontrol/plugins/coolerdash/config.json 2>/dev/null || true - chmod 600 /etc/coolercontrol/plugins/coolerdash/credentials.json 2>/dev/null || true - + if [ ! -f /var/lib/coolercontrol/plugins/coolerdash/credentials.json ]; then + mkdir -p /var/lib/coolercontrol/plugins/coolerdash + printf '{\n "access_token": ""\n}\n' > /var/lib/coolercontrol/plugins/coolerdash/credentials.json + fi + chmod 600 /var/lib/coolercontrol/plugins/coolerdash/config.json 2>/dev/null || true + chmod 600 /var/lib/coolercontrol/plugins/coolerdash/credentials.json 2>/dev/null || true systemctl daemon-reload - - # Restart plugin service directly if it already exists (reinstall case) + systemctl reset-failed cc-plugin-coolerdash.service >/dev/null 2>&1 || true if systemctl list-unit-files cc-plugin-coolerdash.service | grep -q cc-plugin-coolerdash; then systemctl restart cc-plugin-coolerdash.service || echo "Note: Plugin restart failed." - else - # Fresh install: restart CoolerControl so it discovers and starts the plugin service - if systemctl list-unit-files coolercontrold.service | grep -q coolercontrold; then - systemctl restart coolercontrold.service || echo "Note: CoolerControl restart failed." - fi + fi + if systemctl list-unit-files coolercontrold.service | grep -q coolercontrold; then + systemctl restart coolercontrold.service || echo "Note: CoolerControl restart failed." fi echo "================================================================" @@ -65,52 +95,47 @@ post_install() { } post_upgrade() { - # Remove legacy files rm -f /etc/systemd/system/multi-user.target.wants/coolerdash-helperd.service rm -f /etc/systemd/system/coolerdash-helperd.service rm -f /usr/lib/systemd/system/coolerdash-helperd.service rm -rf /etc/systemd/system/cc-plugin-coolerdash.service.d rm -f /usr/lib/udev/rules.d/99-coolerdash.rules - - # Ensure correct permissions on config.json - chmod 600 /etc/coolercontrol/plugins/coolerdash/config.json 2>/dev/null || true - chmod 600 /etc/coolercontrol/plugins/coolerdash/credentials.json 2>/dev/null || true - + if [ ! -f /var/lib/coolercontrol/plugins/coolerdash/credentials.json ]; then + mkdir -p /var/lib/coolercontrol/plugins/coolerdash + printf '{\n "access_token": ""\n}\n' > /var/lib/coolercontrol/plugins/coolerdash/credentials.json + fi + chmod 600 /var/lib/coolercontrol/plugins/coolerdash/config.json 2>/dev/null || true + chmod 600 /var/lib/coolercontrol/plugins/coolerdash/credentials.json 2>/dev/null || true systemctl daemon-reload - - # Restart plugin + systemctl reset-failed cc-plugin-coolerdash.service >/dev/null 2>&1 || true if systemctl list-unit-files cc-plugin-coolerdash.service | grep -q cc-plugin-coolerdash; then systemctl restart cc-plugin-coolerdash.service || echo "Note: Plugin restart failed." fi + if systemctl list-unit-files coolercontrold.service | grep -q coolercontrold; then + systemctl restart coolercontrold.service || echo "Note: CoolerControl restart failed." + fi echo "================================================================" echo "CoolerDash upgraded successfully." echo "Note: config.json is preserved. If a new template was shipped," - echo " compare it with /etc/coolercontrol/plugins/coolerdash/config.json.pacnew" + echo " compare it with /var/lib/coolercontrol/plugins/coolerdash/config.json.pacnew" echo "Note: credentials.json is never overwritten by updates." echo "================================================================" } pre_remove() { - # Stop legacy service if systemctl list-unit-files coolerdash.service | grep -q coolerdash; then systemctl stop coolerdash.service systemctl disable coolerdash.service fi - - # Stop plugin if systemctl list-unit-files cc-plugin-coolerdash.service | grep -q cc-plugin-coolerdash; then systemctl stop cc-plugin-coolerdash.service systemctl disable cc-plugin-coolerdash.service fi - - # Stop helperd if systemctl list-unit-files coolerdash-helperd.service | grep -q coolerdash-helperd; then systemctl stop --no-block coolerdash-helperd.service systemctl disable coolerdash-helperd.service fi - - # Remove legacy files rm -f /etc/systemd/system/coolerdash-helperd.service rm -f /etc/systemd/system/coolerdash.service rm -f /etc/systemd/system/multi-user.target.wants/coolerdash-helperd.service @@ -124,15 +149,10 @@ pre_remove() { rm -f /usr/bin/coolerdash rm -rf /opt/coolerdash rm -rf /etc/coolerdash - - # Remove legacy user if id -u coolerdash &>/dev/null; then userdel -rf coolerdash fi - systemctl daemon-reload - - # Restart CoolerControl if systemctl list-unit-files coolercontrold.service | grep -q coolercontrold; then systemctl restart coolercontrold.service || echo "Note: CoolerControl restart failed." fi diff --git a/etc/coolercontrol/plugins/coolerdash/config.json b/etc/coolercontrol/plugins/coolerdash/config.json index 24defa5..36e08f4 100644 --- a/etc/coolercontrol/plugins/coolerdash/config.json +++ b/etc/coolercontrol/plugins/coolerdash/config.json @@ -12,10 +12,10 @@ }, "paths": { - "images": "/etc/coolercontrol/plugins/coolerdash", - "image_coolerdash": "/etc/coolercontrol/plugins/coolerdash/coolerdash.png", + "images": "/var/lib/coolercontrol/plugins/coolerdash", + "image_coolerdash": "/var/lib/coolercontrol/plugins/coolerdash/coolerdash.png", "image_background": "", - "image_shutdown": "/etc/coolercontrol/plugins/coolerdash/shutdown.png" + "image_shutdown": "/var/lib/coolercontrol/plugins/coolerdash/shutdown.png" }, "display": { diff --git a/etc/coolercontrol/plugins/coolerdash/credentials.json b/etc/coolercontrol/plugins/coolerdash/credentials.json new file mode 100644 index 0000000..e69de29 diff --git a/etc/coolercontrol/plugins/coolerdash/ui/index.html b/etc/coolercontrol/plugins/coolerdash/ui/index.html index 35e0d88..abf7d6b 100644 --- a/etc/coolercontrol/plugins/coolerdash/ui/index.html +++ b/etc/coolercontrol/plugins/coolerdash/ui/index.html @@ -9,19 +9,21 @@ * { margin: 0; padding: 0; box-sizing: border-box; } :root { - --bg-primary: rgb(26, 26, 46); - --bg-secondary: rgb(22, 33, 62); - --bg-card: rgb(30, 35, 55); - --bg-input: rgb(20, 28, 48); - --border: rgb(45, 66, 99); - --border-light: rgb(55, 76, 109); - --text: rgb(234, 234, 234); - --text-dim: rgb(140, 145, 165); - --text-muted: rgb(100, 105, 125); - --accent: rgb(233, 69, 96); - --accent-hover: rgb(255, 89, 116); - --accent-glow: rgba(233, 69, 96, 0.15); - --success: rgb(34, 197, 94); + /* CoolerControl theme CSS variables. + These fallback values maintain the original dark theme in standalone/dev mode. + When runPluginScript() injects the CC parent stylesheet, CC's :root definitions + override these values, making the entire UI automatically adapt to the active theme. */ + --bg-one: 26 26 46; + --bg-two: 30 35 55; + --text-color: 234 234 234; + --text-color-secondary: 140 145 165; + --border-one: 45 66 99; + --accent: 233 69 96; + --surface-hover: 38 48 78; + --success: 34 197 94; + --error: 233 69 96; + --warning: 255 140 0; + /* Structural — not theme-dependent */ --radius: 10px; --radius-sm: 6px; --shadow: 0 4px 20px rgba(0, 0, 0, 0.25); @@ -30,8 +32,8 @@ body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif; - background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%); - color: var(--text); + background: linear-gradient(135deg, rgb(var(--bg-two)) 0%, rgb(var(--bg-one)) 100%); + color: rgb(var(--text-color)); line-height: 1.6; padding: 24px; min-height: 100vh; @@ -44,12 +46,12 @@ /* Header */ .header { - background: var(--bg-card); + background: rgb(var(--bg-two)); border-radius: var(--radius); padding: 28px 32px; margin-bottom: 20px; box-shadow: var(--shadow); - border: 1px solid var(--border); + border: 1px solid rgb(var(--border-one)); } .header h1 { @@ -59,21 +61,21 @@ display: flex; align-items: center; gap: 12px; - background: linear-gradient(135deg, var(--text) 0%, var(--text-dim) 100%); + background: linear-gradient(135deg, rgb(var(--text-color)) 0%, rgb(var(--text-color-secondary)) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; } .header p { - color: var(--text-dim); + color: rgb(var(--text-color-secondary)); font-size: 14px; } /* Device Tab */ .device-info-card { - background: var(--bg-input); - border: 1px solid var(--border); + background: rgb(var(--bg-one)); + border: 1px solid rgb(var(--border-one)); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 16px; @@ -84,7 +86,7 @@ justify-content: space-between; align-items: center; padding: 10px 0; - border-bottom: 1px solid rgba(45, 66, 99, 0.4); + border-bottom: 1px solid rgb(var(--border-one) / 0.4); } .device-info-row:last-child { @@ -93,14 +95,14 @@ .device-info-label { font-size: 13px; - color: var(--text-dim); + color: rgb(var(--text-color-secondary)); font-weight: 500; } .device-info-value { font-size: 14px; font-weight: 600; - color: var(--text); + color: rgb(var(--text-color)); } .device-info-value.mono { @@ -118,18 +120,18 @@ } .device-status.connected { - background: rgba(34, 197, 94, 0.12); - color: var(--success); + background: rgb(var(--success) / 0.12); + color: rgb(var(--success)); } .device-status.disconnected { - background: rgba(255, 140, 0, 0.12); - color: #ff8c00; + background: rgb(var(--warning) / 0.12); + color: rgb(var(--warning)); } .device-status.error { - background: rgba(233, 69, 96, 0.12); - color: var(--accent); + background: rgb(var(--error) / 0.12); + color: rgb(var(--error)); } .device-status-dot { @@ -145,7 +147,7 @@ .info-item-label { font-size: 11px; - color: var(--text-muted); + color: rgb(var(--text-color-secondary)); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 4px; @@ -153,16 +155,17 @@ .info-item-value { font-size: 14px; - color: var(--text); + color: rgb(var(--text-color)); } .info-item-value a { - color: var(--accent); + color: rgb(var(--accent)); text-decoration: none; } .info-item-value a:hover { - color: var(--accent-hover); + color: rgb(var(--accent)); + opacity: 0.8; text-decoration: underline; } @@ -171,13 +174,13 @@ display: flex; gap: 6px; margin-bottom: 20px; - background: var(--bg-card); + background: rgb(var(--bg-two)); padding: 10px; border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow-x: auto; flex-wrap: wrap; - border: 1px solid var(--border); + border: 1px solid rgb(var(--border-one)); } .tab { @@ -187,7 +190,7 @@ background: transparent; border: none; border-radius: var(--radius-sm); - color: var(--text-dim); + color: rgb(var(--text-color-secondary)); cursor: pointer; font-size: 13px; font-weight: 500; @@ -196,25 +199,25 @@ } .tab:hover { - background: var(--accent-glow); - color: var(--text); + background: rgb(var(--surface-hover)); + color: rgb(var(--text-color)); } .tab.active { - background: var(--accent); + background: rgb(var(--accent)); color: white; - box-shadow: 0 2px 8px rgba(233, 69, 96, 0.4); + box-shadow: 0 2px 8px rgb(var(--accent) / 0.4); } /* Panel */ .panel { display: none; - background: var(--bg-card); + background: rgb(var(--bg-two)); border-radius: var(--radius); padding: 28px 32px; box-shadow: var(--shadow); animation: fadeIn 0.3s ease; - border: 1px solid var(--border); + border: 1px solid rgb(var(--border-one)); } .panel.active { @@ -231,8 +234,8 @@ margin: 32px 0 20px; font-size: 13px; font-weight: 600; - color: var(--accent); - border-bottom: 1px solid var(--border); + color: rgb(var(--accent)); + border-bottom: 1px solid rgb(var(--border-one)); padding-bottom: 10px; text-transform: uppercase; letter-spacing: 1px; @@ -257,36 +260,37 @@ font-weight: 500; margin-bottom: 8px; font-size: 13px; - color: var(--text); + color: rgb(var(--text-color)); } .form-hint { display: block; font-size: 11px; - color: var(--text-muted); + color: rgb(var(--text-color-secondary)); margin-bottom: 8px; } .form-control { width: 100%; padding: 11px 14px; - background: var(--bg-input); - border: 1px solid var(--border); + background: rgb(var(--bg-one)); + border: 1px solid rgb(var(--border-one)); border-radius: var(--radius-sm); - color: var(--text); + color: rgb(var(--text-color)); font-size: 14px; transition: all 0.2s ease; } .form-control:hover { - border-color: var(--border-light); + border-color: rgb(var(--border-one)); + opacity: 0.9; } .form-control:focus { outline: none; - border-color: var(--accent); - box-shadow: 0 0 0 3px var(--accent-glow); - background: var(--bg-secondary); + border-color: rgb(var(--accent)); + box-shadow: 0 0 0 3px rgb(var(--accent) / 0.15); + background: rgb(var(--bg-two)); } .form-control[type="number"] { @@ -335,21 +339,21 @@ flex: 1; height: 6px; appearance: none; - background: var(--bg-input); + background: rgb(var(--bg-one)); border-radius: 3px; outline: none; -webkit-appearance: none; - border: 1px solid var(--border); + border: 1px solid rgb(var(--border-one)); } .range-input::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; - background: var(--accent); + background: rgb(var(--accent)); border-radius: 50%; cursor: pointer; - box-shadow: 0 2px 6px rgba(233, 69, 96, 0.4); + box-shadow: 0 2px 6px rgb(var(--accent) / 0.4); transition: transform 0.15s ease; } @@ -361,7 +365,7 @@ min-width: 55px; text-align: right; font-weight: 600; - color: var(--accent); + color: rgb(var(--accent)); font-size: 14px; font-variant-numeric: tabular-nums; } @@ -377,20 +381,21 @@ width: 52px; height: 42px; border-radius: var(--radius-sm); - border: 2px solid var(--border); + border: 2px solid rgb(var(--border-one)); cursor: pointer; transition: all 0.2s ease; } .color-swatch:hover { transform: scale(1.05); - border-color: var(--border-light); + border-color: rgb(var(--border-one)); + opacity: 0.85; } .color-rgb { font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace; font-size: 12px; - color: var(--text-muted); + color: rgb(var(--text-color-secondary)); letter-spacing: 0.3px; } @@ -400,7 +405,7 @@ gap: 14px; margin-top: 28px; padding-top: 28px; - border-top: 1px solid var(--border); + border-top: 1px solid rgb(var(--border-one)); } .btn { @@ -419,31 +424,33 @@ } .btn-primary { - background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%); + background: rgb(var(--accent)); color: white; - box-shadow: 0 4px 14px rgba(233, 69, 96, 0.35); + box-shadow: 0 4px 14px rgb(var(--accent) / 0.35); } .btn-primary:hover { transform: translateY(-2px); - box-shadow: 0 6px 20px rgba(233, 69, 96, 0.45); + box-shadow: 0 6px 20px rgb(var(--accent) / 0.45); + opacity: 0.9; } .btn-secondary { - background: var(--bg-input); - color: var(--text); - border: 1px solid var(--border); + background: rgb(var(--bg-one)); + color: rgb(var(--text-color)); + border: 1px solid rgb(var(--border-one)); } .btn-secondary:hover { - background: var(--bg-secondary); - border-color: var(--border-light); + background: rgb(var(--bg-two)); + border-color: rgb(var(--border-one)); + opacity: 0.9; } /* Alert */ .alert { - background: var(--accent-glow); - border-left: 4px solid var(--accent); + background: rgb(var(--accent) / 0.12); + border-left: 4px solid rgb(var(--accent)); padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 24px; @@ -453,19 +460,19 @@ .alert strong { display: block; margin-bottom: 6px; - color: var(--text); + color: rgb(var(--text-color)); } .alert-warning { - background: rgba(255, 140, 0, 0.12); - border-left-color: #ff8c00; + background: rgb(var(--warning) / 0.12); + border-left-color: rgb(var(--warning)); } /* Scrollbar */ ::-webkit-scrollbar { width: 8px; height: 8px; } - ::-webkit-scrollbar-track { background: var(--bg-primary); border-radius: 4px; } - ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; } - ::-webkit-scrollbar-thumb:hover { background: var(--accent); } + ::-webkit-scrollbar-track { background: rgb(var(--bg-one)); border-radius: 4px; } + ::-webkit-scrollbar-thumb { background: rgb(var(--border-one)); border-radius: 4px; } + ::-webkit-scrollbar-thumb:hover { background: rgb(var(--accent)); } /* Sensor Config Sections */ .sensor-config-section { @@ -479,7 +486,7 @@ /* Collapsible details (used in Sensors + Layout tabs) */ .sensor-details, .collapsible-details { - border: 1px solid var(--border); + border: 1px solid rgb(var(--border-one)); border-radius: 8px; overflow: hidden; } @@ -487,11 +494,11 @@ .sensor-details summary, .collapsible-details summary { padding: 12px 16px; - background: var(--bg-secondary); + background: rgb(var(--bg-two)); cursor: pointer; font-weight: 600; font-size: 15px; - color: var(--text-primary); + color: rgb(var(--text-color)); display: flex; align-items: center; gap: 8px; @@ -509,7 +516,7 @@ content: '\25B6'; font-size: 10px; transition: transform 0.2s; - color: var(--text-dim); + color: rgb(var(--text-color-secondary)); } .sensor-details[open] summary::before, @@ -519,12 +526,12 @@ .sensor-details[open] summary, .collapsible-details[open] summary { - border-bottom: 1px solid var(--border); + border-bottom: 1px solid rgb(var(--border-one)); } .sensor-details summary:hover, .collapsible-details summary:hover { - background: var(--bg-primary); + background: rgb(var(--surface-hover)); } .sensor-details-content, @@ -536,12 +543,12 @@ .collapsible-details .sub-section-title { font-size: 13px; font-weight: 600; - color: var(--accent); + color: rgb(var(--accent)); text-transform: uppercase; letter-spacing: 0.5px; margin: 16px 0 8px 0; padding-bottom: 4px; - border-bottom: 1px solid rgba(255,107,129,0.15); + border-bottom: 1px solid rgb(var(--accent) / 0.15); } .sensor-details .sub-section-title:first-child, @@ -556,7 +563,7 @@
Customize your LCD temperature dashboard • Changes require plugin restart
-+
💡 Tip: After an update, click Reset to apply new default values. Feedback & bug reports are welcome — see the Info tab for links.
+
Discovering sensors from CoolerControl API…
+
Note: Clicking Save will automatically apply the configuration and restart the plugin.
No sensors found. Make sure CoolerControl is running and reachable.
'; + container.innerHTML = 'No sensors found. Make sure CoolerControl is running and reachable.
'; return; } @@ -2284,7 +2304,7 @@