Files
mesh-catalog/modules/triggerhappy/module.json
T
jochen afce6b03f4 triggerhappy: the machine's hotkeys as a module holding node-hotkeys (hq ADR 0212)
The laptop's model module owned triggerhappy's trigger file and service, although the daemon is a
general piece others have keys for. triggerhappy now owns the daemon, reads only the mesh's file,
runs every trigger as the account, and the model module contributes its vendor keys.
2026-10-04 16:50:57 +02:00

74 lines
2.3 KiB
JSON

{
"module": "triggerhappy",
"version": "1",
"capabilities": [
"service-manager"
],
"claims": [
{
"name": "node-hotkeys",
"scope": "node"
}
],
"tools": [
"triggerhappy_keys",
"triggerhappy_devices",
"triggerhappy_dump",
"triggerhappy_check"
],
"resources": [
{
"id": "drop-ins",
"type": "directory",
"path": "/etc/systemd/system/triggerhappy.service.d",
"mode": "0755"
},
{
"id": "as-account",
"type": "file",
"path": "/etc/systemd/system/triggerhappy.service.d/mesh.conf",
"mode": "0644",
"content": "# Written by the mesh (module triggerhappy, novox/hq ADR 0212). Replaced on every push.\n#\n# The daemon opens the input devices as root, then drops to the operator's account with its groups,\n# so every trigger runs as the account: it reaches the account's session bus and display, with no su\n# and no hard-coded user. Only the mesh's trigger file is read.\n[Service]\nExecStart=\nExecStart=/usr/bin/thd --triggers /etc/triggerhappy/triggers.d/mesh.conf --socket /run/thd.socket --user ${machine:account} --deviceglob /dev/input/event*\n"
},
{
"id": "triggers-dir",
"type": "directory",
"path": "/etc/triggerhappy/triggers.d",
"mode": "0755"
},
{
"id": "triggers",
"type": "file",
"path": "/etc/triggerhappy/triggers.d/mesh.conf",
"mode": "0644",
"content": "# The machine's hotkeys, written by the mesh (module triggerhappy, novox/hq ADR 0212). Replaced on\n# every push: a key is added by the module it belongs to, as a contribution to node-hotkeys.\n# A line is: the key, its state (1 pressed, 2 held, 0 released), the command.\n${contribution:node-hotkeys:trigger}"
},
{
"id": "service",
"type": "service",
"unit": "triggerhappy.service",
"state": "running",
"boot": "enabled",
"restart-on": [
"as-account",
"triggers"
]
}
],
"build": {
"artifacts": [
{
"name": "tools",
"kind": "bundle",
"language": "go",
"system": "arch",
"from": "cmd/triggerhappy-tools",
"binary": "triggerhappy-tools",
"loads": [
"triggerhappy-tools"
]
}
]
}
}