Refactoring

This commit is contained in:
2026-09-02 14:30:16 +01:00
parent 20b2a45e60
commit cefbbbc575
8 changed files with 112 additions and 128 deletions
-23
View File
@@ -22,26 +22,3 @@ hl.monitor {
hl.monitor { output = '', mode = 'preferred', position = 'auto', scale = 1 }
local function is_lid_closed()
local file = io.open('/proc/acpi/button/lid/LID0/state', 'r')
if not file then
file = io.open('/proc/acpi/button/lid/LID/state', 'r')
end
if file then
local state = file:read '*a'
file:close()
return string.find(state, 'closed') ~= nil
end
return false
end
function toggleLaptopMonitor()
hl.monitor {
output = 'desc:BOE NE160QDM-NZ6',
disabled = not is_lid_closed(),
}
end