From 38b9cfa8b9751fe49f2ee06f4da5415c009c8ac7 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Thu, 21 Apr 2022 21:27:38 -0400 Subject: [PATCH] Update README with equivalent CLI info --- README.md | 26 ++++++++++++++++++++++++++ main_view.html | 9 ++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 50a0ee3..d99fba4 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,32 @@ Steam Deck power tweaks for power users. This is generated from the template plugin for the [SteamOS Plugin Loader](https://github.com/SteamDeckHomebrew/PluginLoader). +## Cool, whatever + +Yeah, that's fair. +In case you still want some of the functionality, without the nice GUI, here's some equivalent commands. +These should all be run as superuser, i.e. run `sudo su` and then run these commands in that. + +### Enable & Disable CPU threads + +Enable: `echo 1 > /sys/devices/system/cpu/cpu{cpu_number}/online` where `{cpu_number}` is a number from 1 to 7 (inclusive). + +Disable: `echo 0 > /sys/devices/system/cpu/cpu{cpu_number}/online` where `{cpu_number}` is a number from 1 to 7 (inclusive). + +NOTE: You cannot enable or disable cpu0, hence why there are only 7 in the range for 8 cpu threads. + +### Enable & Disable CPU boost + +Enable: `echo 1 > /sys/devices/system/cpu/cpufreq/boost` enables boost across all threads. + +Disable: `echo 1 > /sys/devices/system/cpu/cpufreq/boost` disables boost across all threads. + +### Set CPU frequency + +Use `cpupower` (usage: `cpupower --help`). +This isn't strictly how PowerTools does it, but it's a multi-step process which can involve changing the CPU governor. +All that can be done automatically by `cpupower frequency-set --freq {frequency}` where `{frequency}` is `1.7G`, `2.4G` or `2.8G`. + ## License This is licensed under GNU GPLv3. diff --git a/main_view.html b/main_view.html index f1b70c2..9c60be0 100644 --- a/main_view.html +++ b/main_view.html @@ -75,7 +75,14 @@ async function toggleCPUSMT() { let toggle = document.getElementById("smtToggle"); let isActive = getToggleState(toggle); - await setCPUs(await getCPUs(), !isActive); + let currentCPUs = await getCPUs(); + if (currentCPUs == 4 && !isActive) { + // if all cores are running, enable all the threads as well + await setCPUs(8, !isActive); + } else { + await setCPUs(currentCPUs, !isActive); + } + setToggleState(toggle, !isActive); selectNotch("cpuThreadsNotch", await getCPUs() - 1, 8); }