From f4c54aa047c69d956f5787af9bc02a63f9c84f35 Mon Sep 17 00:00:00 2001 From: venus Date: Sun, 23 Aug 2026 21:14:35 -0500 Subject: [PATCH] addid fan profile swithcing, not functional --- custom-functions.lua | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/custom-functions.lua b/custom-functions.lua index 98650cb..dc488f1 100644 --- a/custom-functions.lua +++ b/custom-functions.lua @@ -41,7 +41,17 @@ local function fanState() local result = handle:read("*a") handle:close() - return "lazy" + if result:find("laziest") then + return "laziest" + end + if result:find("medium") then + return "medium" + end + if result:find("deaf") then + return "deaf" + end + + return "unknown" end function C.switchFanSate() @@ -49,12 +59,15 @@ function C.switchFanSate() if fanState() == "unknown" then hl.exec_cmd('notify-send "fan profile unknown"') return - elseif fanState() == "lazy" then - hl.exec_cmd("fw-fanctl set performance") - hl.exec_cmd('notify-send "fan profile set to performance"') + elseif fanState() == "laziest" then + hl.exec_cmd("fw-fanctl set medium") + hl.exec_cmd('notify-send "fan profile set to medium"') + elseif fanState() == "medium" then + hl.exec_cmd("fw-fanctl set deaf") + hl.exec_cmd('notify-send "fan profile set to deaf"') else - hl.exec_cmd("fw-fanctl set lazy") - hl.exec_cmd('notify-send "fan profile set to lazy"') + hl.exec_cmd("fw-fanctl set laziest") + hl.exec_cmd('notify-send "fan profile set to laziest"') end end