modular session management daemon
Something went wrong. Try again.
2.0 kB · 99 lines
Lua
at master
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100-- Devices tagged for access by active local sessionsdevice { access = "rw", match = function(dev) local tags = dev:property("CURRENT_TAGS") or "" return tags:find(":uaccess:", 1, true) ~= nil end,}
-- Sound devicesdevice { access = "rw", match = function(dev) return dev.subsystem == "sound" end,}-- Webcams, frame grabber, TV cardsdevice { access = "rw", match = function(dev) return dev.subsystem == "video4linux" or dev.subsystem == "dvb" or dev.subsystem == "media" or dev.sysname == "udmabuf" end,}
-- DRI video devicesdevice { access = "rw", match = function(dev) return dev.subsystem == "drm" and dev.sysname:match("^card.*$") ~= nil end,}
-- DRI render nodes, DRI accel nodes, AMD KFD nodes, KVMdevice { access = "rw", match = function(dev) return ( dev.subsystem == "drm" and dev.sysname:match("^renderD.*$") ~= nil ) or ( dev.subsystem == "accel" and dev.sysname:match("^accel.*$") ~= nil ) or ( dev.subsystem == "kfd" and dev.sysname == "kfd" ) or ( dev.subsystem == "misc" and dev.sysname == "kvm" ) end,}
-- rfkill / radio killswitchesdevice { access = "rw", match = function(dev) return dev.sysname == "rfkill" and dev.subsystem == "misc" end,}
-- Optical drivesdevice { access = "rw", match = function(dev) if dev.subsystem ~= "scsi_generic" then return false end
local scsi = dev:parent("scsi") if not scsi then return false end
local ty = scsi:attr("type") return ty == "4" or ty == "5" end,}
-- FIDO security keysdevice { access = "rw", match = function(dev) if dev.subsystem ~= "hidraw" then return false end for _, parent in ipairs(dev:parents()) do local product = parent:property("PRODUCT") if product ~= nil and product:match("^1050/") ~= nil then return true end end return false end,}