-- Example sessiond-seat configuration. -- -- The configuration is an executable Lua script. Device callbacks receive a -- device with the fields: subsystem, sysname, and syspath. local seats = sessiond.seats -- seat0 exists automatically and is the default unless changed below. local seat0 = seats:get("seat0") -- Match the first graphics card. seat0:attach(function(dev) return dev.subsystem == "drm" and dev.sysname == "card0" end) -- Example of matching one exact sysfs path: -- seat0:attach(function(dev) -- return dev.syspath == "/sys/devices/example/device" -- end) local seat1 = seats:create("seat1") -- Session matchers can assign sessions independently of device matchers. -- The first matcher that returns true wins. seat1:session(function(session) return session.class == "user" and session.active == "active" end) -- Match the second graphics card and its input devices. seat1:attach(function(dev) return dev.subsystem == "drm" and dev.sysname == "card1" end) seat1:attach(function(dev) return dev.subsystem == "input" and dev.syspath:match("/usb%d+/.*/input") ~= nil end) -- Any configured seat can become the default seat. -- seat1:default()