addid fan profile swithcing, not functional

This commit is contained in:
venus
2026-08-23 21:14:35 -05:00
parent 5695563d26
commit f4c54aa047

View File

@@ -41,7 +41,17 @@ local function fanState()
local result = handle:read("*a") local result = handle:read("*a")
handle:close() 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 end
function C.switchFanSate() function C.switchFanSate()
@@ -49,12 +59,15 @@ function C.switchFanSate()
if fanState() == "unknown" then if fanState() == "unknown" then
hl.exec_cmd('notify-send "fan profile unknown"') hl.exec_cmd('notify-send "fan profile unknown"')
return return
elseif fanState() == "lazy" then elseif fanState() == "laziest" then
hl.exec_cmd("fw-fanctl set performance") hl.exec_cmd("fw-fanctl set medium")
hl.exec_cmd('notify-send "fan profile set to performance"') 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 else
hl.exec_cmd("fw-fanctl set lazy") hl.exec_cmd("fw-fanctl set laziest")
hl.exec_cmd('notify-send "fan profile set to lazy"') hl.exec_cmd('notify-send "fan profile set to laziest"')
end end
end end