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")
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