diff --git a/README.md b/README.md index 860460e..5418747 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,14 @@ Steam Deck power tweaks for power users. This is generated from the template plugin for the [SteamOS Plugin Loader](https://github.com/SteamDeckHomebrew/PluginLoader). You will need that installed for this plugin to work. +## What does it do? + +- Enable & disable CPU threads & SMT +- Set CPU max frequency and toggle boost +- Set some GPU power parameters (fastPPT & slowPPT) +- Set the fan RPM (unsupported on SteamOS beta) +- Display supplementary battery info + ## Cool, but that's too much work Fair enough. diff --git a/extras/ui.png b/extras/ui.png index 42dc575..d319477 100644 Binary files a/extras/ui.png and b/extras/ui.png differ diff --git a/main.py b/main.py index 3c84787..a7d6b9d 100644 --- a/main.py +++ b/main.py @@ -1,7 +1,8 @@ import time #import subprocess +import os -VERSION = "0.3.0" +VERSION = "0.4.0" class Plugin: CPU_COUNT = 8 @@ -9,6 +10,7 @@ class Plugin: FAN_SPEEDS = [0, 1000, 2000, 3000, 4000, 5000, 6000] auto_fan = True + smt = None async def get_version(self) -> str: return VERSION @@ -17,6 +19,7 @@ class Plugin: # call from main_view.html with setCPUs(count, smt) async def set_cpus(self, count, smt=True) -> int: + self.smt = smt # print("Setting CPUs") if smt: count = min(int(count), self.CPU_COUNT) @@ -43,10 +46,15 @@ class Plugin: return online_count async def get_smt(self) -> bool: - for cpu in range(1, self.CPU_COUNT, 2): - if (not status_cpu(cpu)) and status_cpu(cpu+1): - return False - return True + if self.smt is None: + for cpu in range(1, self.CPU_COUNT, 2): + if (not status_cpu(cpu)) and status_cpu(cpu+1): + self.smt = False + return False + self.smt = True + return True + else: + return self.smt async def set_boost(self, enabled: bool) -> bool: write_to_sys("/sys/devices/system/cpu/cpufreq/boost", int(enabled)) @@ -124,6 +132,9 @@ class Plugin: return i return len(self.FAN_SPEEDS)-1 # any higher value is considered as highest manual setting + async def fantastic_installed(self) -> bool: + return os.path.exists("/home/deck/homebrew/plugins/Fantastic") + # Battery stuff async def get_charge_now(self) -> int: diff --git a/main_view.html b/main_view.html index 229e06f..d4259c4 100644 --- a/main_view.html +++ b/main_view.html @@ -54,6 +54,10 @@ return call_plugin_method("get_fan_tick", {}); } + function getFantastic() { + return call_plugin_method("fantastic_installed", {}); + } + function getChargeNow() { return call_plugin_method("get_charge_now", {}); } @@ -75,7 +79,15 @@ selectNotch("cpuThreadsNotch", await getCPUs() - 1, 8); selectNotch("frequencyNotch", await getMaxBoost(), 3); await onReadyGPU(); - selectNotch("fanNotch", await getFanTick(), 8); + let isFantasticInstalled = await getFantastic(); + if (isFantasticInstalled) { + // Don't fight with Fantastic + let fanRoot = document.getElementById("fanRoot"); + fanRoot.style.visibility = "hidden"; + fanRoot.style.height = "0px"; + } else { + selectNotch("fanNotch", await getFanTick(), 8); + } await updateBatteryStats(); // this is unimportant; always do it last await updateVersion(); @@ -235,7 +247,7 @@ - @@ -427,7 +442,7 @@ -
+
Fan RPM
@@ -475,6 +490,9 @@
+
+ WARNING: This can cause component overheating. +