Feature 57 (config and provisioning): modules declare config and provisions, their files rendered from templates; synced with main (issues of feature 57, 874)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"module": "clipmenu",
|
||||
"version": "1",
|
||||
"moved": true,
|
||||
"capabilities": [
|
||||
"package-manager"
|
||||
],
|
||||
@@ -22,18 +23,38 @@
|
||||
"clipmenu_clear",
|
||||
"clipmenu_delete"
|
||||
],
|
||||
"environment": {
|
||||
"variables": {
|
||||
"CM_SELECTIONS": "clipboard",
|
||||
"CM_MAX_CLIPS": "500",
|
||||
"CM_HISTLENGTH": "15"
|
||||
}
|
||||
},
|
||||
"shell": [
|
||||
"items": [
|
||||
{
|
||||
"for": "xinitrc",
|
||||
"slot": "normal",
|
||||
"code": "# The clipboard's history (module clipmenu, novox/hq ADR 0208): clipmenud collects every copy from\n# here on, once per session. It keeps the history in the account's runtime directory, so a reboot\n# forgets it, and with it every password that was ever copied.\n# Through the module's xsel, which reads only a selection offering text (see the README).\nPATH=\"/usr/local/lib/mesh-clipmenu:$PATH\" clipmenud &\n"
|
||||
"collection": "environment",
|
||||
"name": "cm-selections",
|
||||
"attributes": {
|
||||
"kind": "variable",
|
||||
"name": "CM_SELECTIONS"
|
||||
},
|
||||
"template": "files/env-cm-selections"
|
||||
},
|
||||
{
|
||||
"collection": "environment",
|
||||
"name": "cm-max-clips",
|
||||
"attributes": {
|
||||
"kind": "variable",
|
||||
"name": "CM_MAX_CLIPS"
|
||||
},
|
||||
"template": "files/env-cm-max-clips"
|
||||
},
|
||||
{
|
||||
"collection": "environment",
|
||||
"name": "cm-histlength",
|
||||
"attributes": {
|
||||
"kind": "variable",
|
||||
"name": "CM_HISTLENGTH"
|
||||
},
|
||||
"template": "files/env-cm-histlength"
|
||||
},
|
||||
{
|
||||
"collection": "contribution:node-display-session:config",
|
||||
"name": "display-session",
|
||||
"template": "files/i3/50-clipmenu.conf"
|
||||
}
|
||||
],
|
||||
"resources": [
|
||||
@@ -53,7 +74,48 @@
|
||||
"type": "file",
|
||||
"path": "/usr/local/lib/mesh-clipmenu/xsel",
|
||||
"mode": "0755",
|
||||
"content": "#!/bin/sh\n# xsel as clipmenud sees it, written by the mesh (module clipmenu). Replaced at every push.\n#\n# clipmenud records text, and reads a selection with `timeout 1 xsel -o`. A selection holding an\n# image (a screenshot copied as image/png) is sent in pieces; one second is too short for megabytes,\n# timeout kills xsel half way, and the program owning the image waits for ever for a reader that is\n# gone. From then on nothing can ask the clipboard anything: pastes hang, and an Electron app that\n# asks on its main thread freezes. So a read goes ahead only when the selection offers text.\ncase \" $* \" in\n*\" -o \"* | *\" --output \"*)\n\tselection=clipboard\n\tcase \" $* \" in\n\t*\" --primary \"* | *\" -p \"*) selection=primary ;;\n\t*\" --secondary \"* | *\" -s \"*) selection=secondary ;;\n\tesac\n\ttargets=$(timeout 1 xclip -selection \"$selection\" -t TARGETS -o 2>/dev/null) || exit 1\n\tprintf '%s\\n' \"$targets\" | grep -qxE 'UTF8_STRING|STRING|TEXT|text/plain(;charset=utf-8)?' || exit 1\n\t;;\nesac\nexec /usr/bin/xsel \"$@\"\n"
|
||||
"template": "files/bin/xsel"
|
||||
},
|
||||
{
|
||||
"id": "user-units-dir",
|
||||
"type": "directory",
|
||||
"path": "${machine:account-home}/.config/systemd/user",
|
||||
"owner": "${machine:account}",
|
||||
"mode": "0755"
|
||||
},
|
||||
{
|
||||
"id": "daemon-dropins",
|
||||
"type": "directory",
|
||||
"path": "${machine:account-home}/.config/systemd/user/clipmenud.service.d",
|
||||
"owner": "${machine:account}",
|
||||
"mode": "0755"
|
||||
},
|
||||
{
|
||||
"id": "daemon-dropin",
|
||||
"type": "file",
|
||||
"path": "${machine:account-home}/.config/systemd/user/clipmenud.service.d/mesh.conf",
|
||||
"owner": "${machine:account}",
|
||||
"mode": "0644",
|
||||
"template": "files/systemd/clipmenud-mesh.conf"
|
||||
},
|
||||
{
|
||||
"id": "launcher",
|
||||
"type": "file",
|
||||
"path": "/usr/local/lib/mesh-clipmenu/clipmenud-session",
|
||||
"mode": "0755",
|
||||
"template": "files/bin/clipmenud-session"
|
||||
},
|
||||
{
|
||||
"id": "daemon",
|
||||
"type": "service",
|
||||
"unit": "clipmenud.service",
|
||||
"scope": "user",
|
||||
"user": "${machine:account}",
|
||||
"state": "running",
|
||||
"boot": "enabled",
|
||||
"health": {
|
||||
"kind": "unit"
|
||||
}
|
||||
}
|
||||
],
|
||||
"build": {
|
||||
@@ -68,14 +130,12 @@
|
||||
"loads": [
|
||||
"clipmenu-tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "files",
|
||||
"kind": "archive",
|
||||
"from": "files"
|
||||
}
|
||||
]
|
||||
},
|
||||
"contributions": [
|
||||
{
|
||||
"seat": "node-display-session",
|
||||
"kind": "config",
|
||||
"content": "# The clipboard's history key (module clipmenu, novox/hq ADR 0208). Owned by the mesh: replaced at\n# every push. clipmenu shows the history through `dmenu`, the node's dmenu-compatible command, which\n# the holder of node-launcher answers (rofi on the workstations); the chosen entry is put back on the\n# clipboard.\nbindsym $mod+period exec --no-startup-id clipmenu -p Clipboard\n"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user