Files
adrianbonpin 14624d78fe Prevent display sleep by default
`caffeinate -i` blocks system idle sleep but lets the display blank, so the
screen still slept and the extension looked broken. The "Also Prevent Display
Sleep" preference that fixes this defaulted to off.

Flip it to on, and guard it with a manifest test that reads package.json and
asserts the shipped defaults map to `-i -d`. Verified on macOS: `caffeinate -i`
yields PreventUserIdleDisplaySleep 0, `caffeinate -i -d` yields 1.
2026-09-20 21:17:14 +08:00

71 lines
2.2 KiB
JSON

{
"$schema": "https://raw.githubusercontent.com/vicinaehq/vicinae/refs/heads/main/extra/schemas/extension.json",
"name": "caffeinate",
"title": "Caffeinate",
"description": "Keep your computer awake. Start, stop, and time-limit sleep prevention without touching a terminal.",
"icon": "caffeinate.png",
"author": "adrianbonpin",
"categories": [
"System"
],
"license": "MIT",
"commands": [
{
"name": "toggle",
"title": "Toggle Caffeination",
"description": "Start or stop keeping your computer awake, depending on the current state.",
"mode": "no-view"
},
{
"name": "status",
"title": "Caffeination Status",
"description": "See whether sleep is currently being prevented, and for how much longer. Start or stop it from here.",
"mode": "view"
}
],
"preferences": [
{
"name": "preventDisplaySleep",
"title": "Prevent Display Sleep",
"description": "Keep the screen on. On by default, because a blank screen is the usual reason caffeination looks like it is not working. Turn it off to let the display sleep while the system stays awake (saves battery).",
"type": "checkbox",
"label": "Prevent display sleep",
"required": false,
"default": true
},
{
"name": "preventSystemSleep",
"title": "Also Prevent System Sleep",
"description": "Prevents full system sleep. Note: on macOS this assertion only takes effect while on AC power.",
"type": "checkbox",
"label": "Prevent system sleep",
"required": false,
"default": false
}
],
"dependencies": {
"@vicinae/api": "^0.29.0"
},
"devDependencies": {
"@eslint/js": "^9.36.0",
"@types/node": "22.13.10",
"@types/react": "19.1.17",
"eslint": "^9.22.0",
"eslint-config-prettier": "^10.1.8",
"globals": "^16.4.0",
"prettier": "^3.5.3",
"react": "19.1.1",
"typescript": "^5.8.2",
"typescript-eslint": "^8.45.0",
"vitest": "^4.1.5"
},
"scripts": {
"dev": "vici develop",
"build": "vici build",
"lint": "vici lint",
"lint:code": "eslint .",
"typecheck": "tsc --noEmit",
"test": "vitest run",
"test:watch": "vitest"
}
}