Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
1.2 kB · 43 lines
Lua
at master
1234567891011121314151617181920212223242526272829303132333435363738394041424344-- 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") ~= nilend)
-- Any configured seat can become the default seat.-- seat1:default()