{
    "tailapp": 2,
    "manifest": {
        "format": 2,
        "app_id": "keep-awake",
        "name": "Keep Awake",
        "version": 1,
        "schema": "tailapps/v0",
        "exported_at": 1795564598,
        "from": "gallery",
        "connections": [],
        "files": {
            "app.json": "b3a7c9ce8fe3f19da82524afb2ca749e816ab60aa7e1ce7b73ce203b732db86d"
        },
        "signature": "Ps4MwlAd42Sj1wDYn3ABq5SWx9KrZKulef2ScN5QabUnLtrAncRYmYKXxji435oC1pLHnHSUL4Qxhnzc2OjeDg==",
        "key_id": "gallery-1"
    },
    "app": {
        "schema": "tailapps/v0",
        "app": "keep-awake",
        "name": "Keep Awake",
        "description": "Keep this Mac (or the iPhone's screen) awake for a while or until you stop, with no script. The Mac lets go by itself when the time is up or TailApps quits.",
        "icon": "cup.and.saucer",
        "version": 1,
        "permissions": [
            "power.control"
        ],
        "state": {
            "mode": {
                "type": "text",
                "default": "off"
            },
            "until": {
                "type": "number",
                "default": 0
            },
            "display": {
                "type": "bool",
                "default": true
            }
        },
        "actions": {
            "awake_for": {
                "args": {
                    "minutes": "int:1-1440",
                    "seconds": "int:60-86400"
                },
                "steps": [
                    {
                        "awake.start": {
                            "display": "$display",
                            "minutes": "$args.minutes"
                        }
                    },
                    {
                        "set": {
                            "mode": "timed",
                            "until": "$now"
                        }
                    },
                    {
                        "increment": {
                            "until": "$args.seconds"
                        }
                    }
                ]
            },
            "awake_on": {
                "expose": true,
                "steps": [
                    {
                        "awake.start": {
                            "display": "$display"
                        }
                    },
                    {
                        "set": {
                            "mode": "on",
                            "until": 0
                        }
                    }
                ]
            },
            "awake_off": {
                "expose": true,
                "steps": [
                    {
                        "awake.stop": []
                    },
                    {
                        "set": {
                            "mode": "off",
                            "until": 0
                        }
                    }
                ]
            },
            "ended": {
                "steps": [
                    {
                        "set": {
                            "mode": "off",
                            "until": 0
                        }
                    }
                ]
            }
        },
        "cards": [
            {
                "id": "main",
                "layout": {
                    "column": [
                        {
                            "row": [
                                {
                                    "icon": "$mode | map:{off:'moon.zzz', else:'cup.and.saucer.fill'}",
                                    "tone": "$mode | tone:{off:'neutral', else:'good'}",
                                    "size": "l"
                                },
                                {
                                    "column": [
                                        {
                                            "text": "$mode | map:{off:'Sleeps as usual', else:'Staying awake'}",
                                            "emphasis": "strong"
                                        },
                                        {
                                            "timer": "$until",
                                            "mode": "until",
                                            "size": "s",
                                            "when": "$mode | map:{timed:true, else:false}",
                                            "on_end": "ended"
                                        },
                                        {
                                            "text": "Until you stop it or TailApps quits",
                                            "size": "s",
                                            "emphasis": "subtle",
                                            "when": "$mode | map:{on:true, else:false}"
                                        }
                                    ],
                                    "gap": "xs"
                                }
                            ],
                            "align": "center",
                            "gap": "m"
                        },
                        {
                            "grid": [
                                {
                                    "button": "30 min",
                                    "on": "awake_for",
                                    "args": {
                                        "minutes": 30,
                                        "seconds": 1800
                                    },
                                    "style": "secondary"
                                },
                                {
                                    "button": "1 hour",
                                    "on": "awake_for",
                                    "args": {
                                        "minutes": 60,
                                        "seconds": 3600
                                    },
                                    "style": "secondary"
                                },
                                {
                                    "button": "2 hours",
                                    "on": "awake_for",
                                    "args": {
                                        "minutes": 120,
                                        "seconds": 7200
                                    },
                                    "style": "secondary"
                                },
                                {
                                    "button": "Until I stop",
                                    "on": "awake_on",
                                    "style": "secondary"
                                }
                            ],
                            "columns": {
                                "default": 4,
                                "narrow": 2
                            },
                            "gap": "s"
                        },
                        {
                            "button": "Let it sleep",
                            "on": "awake_off",
                            "style": "destructive",
                            "grow": true,
                            "when": "$mode | map:{off:false, else:true}"
                        },
                        {
                            "field": "Keep the screen on too",
                            "type": "toggle",
                            "bind": "$display",
                            "platforms": [
                                "macos"
                            ]
                        }
                    ],
                    "gap": "m"
                }
            }
        ],
        "views": {
            "menubar": {
                "icon": "cup.and.saucer",
                "label": "{$until | until}",
                "label_icon": "$mode | map:{off:'cup.and.saucer', else:'cup.and.saucer.fill'}",
                "card": "main"
            },
            "floating": {
                "card": "main",
                "width": "default"
            }
        }
    },
    "app_json": "{\n  \"schema\": \"tailapps/v0\",\n  \"app\": \"keep-awake\",\n  \"name\": \"Keep Awake\",\n  \"description\": \"Keep this Mac (or the iPhone's screen) awake for a while or until you stop, with no script. The Mac lets go by itself when the time is up or TailApps quits.\",\n  \"icon\": \"cup.and.saucer\",\n  \"version\": 1,\n  \"permissions\": [\"power.control\"],\n  \"state\": {\n    \"mode\": { \"type\": \"text\", \"default\": \"off\" },\n    \"until\": { \"type\": \"number\", \"default\": 0 },\n    \"display\": { \"type\": \"bool\", \"default\": true }\n  },\n  \"actions\": {\n    \"awake_for\": {\n      \"args\": { \"minutes\": \"int:1-1440\", \"seconds\": \"int:60-86400\" },\n      \"steps\": [\n        { \"awake.start\": { \"display\": \"$display\", \"minutes\": \"$args.minutes\" } },\n        { \"set\": { \"mode\": \"timed\", \"until\": \"$now\" } },\n        { \"increment\": { \"until\": \"$args.seconds\" } }\n      ]\n    },\n    \"awake_on\": { \"expose\": true,\n      \"steps\": [\n        { \"awake.start\": { \"display\": \"$display\" } },\n        { \"set\": { \"mode\": \"on\", \"until\": 0 } }\n      ]\n    },\n    \"awake_off\": { \"expose\": true,\n      \"steps\": [\n        { \"awake.stop\": {} },\n        { \"set\": { \"mode\": \"off\", \"until\": 0 } }\n      ]\n    },\n    \"ended\": {\n      \"steps\": [\n        { \"set\": { \"mode\": \"off\", \"until\": 0 } }\n      ]\n    }\n  },\n  \"cards\": [\n    {\n      \"id\": \"main\",\n      \"layout\": {\n        \"column\": [\n          {\n            \"row\": [\n              { \"icon\": \"$mode | map:{off:'moon.zzz', else:'cup.and.saucer.fill'}\", \"tone\": \"$mode | tone:{off:'neutral', else:'good'}\", \"size\": \"l\" },\n              {\n                \"column\": [\n                  { \"text\": \"$mode | map:{off:'Sleeps as usual', else:'Staying awake'}\", \"emphasis\": \"strong\" },\n                  { \"timer\": \"$until\", \"mode\": \"until\", \"size\": \"s\", \"when\": \"$mode | map:{timed:true, else:false}\", \"on_end\": \"ended\" },\n                  { \"text\": \"Until you stop it or TailApps quits\", \"size\": \"s\", \"emphasis\": \"subtle\", \"when\": \"$mode | map:{on:true, else:false}\" }\n                ],\n                \"gap\": \"xs\"\n              }\n            ],\n            \"align\": \"center\",\n            \"gap\": \"m\"\n          },\n          {\n            \"grid\": [\n              { \"button\": \"30 min\", \"on\": \"awake_for\", \"args\": { \"minutes\": 30, \"seconds\": 1800 }, \"style\": \"secondary\" },\n              { \"button\": \"1 hour\", \"on\": \"awake_for\", \"args\": { \"minutes\": 60, \"seconds\": 3600 }, \"style\": \"secondary\" },\n              { \"button\": \"2 hours\", \"on\": \"awake_for\", \"args\": { \"minutes\": 120, \"seconds\": 7200 }, \"style\": \"secondary\" },\n              { \"button\": \"Until I stop\", \"on\": \"awake_on\", \"style\": \"secondary\" }\n            ],\n            \"columns\": { \"default\": 4, \"narrow\": 2 },\n            \"gap\": \"s\"\n          },\n          { \"button\": \"Let it sleep\", \"on\": \"awake_off\", \"style\": \"destructive\", \"grow\": true, \"when\": \"$mode | map:{off:false, else:true}\" },\n          { \"field\": \"Keep the screen on too\", \"type\": \"toggle\", \"bind\": \"$display\", \"platforms\": [\"macos\"] }\n        ],\n        \"gap\": \"m\"\n      }\n    }\n  ],\n  \"views\": {\n    \"menubar\": {\n      \"icon\": \"cup.and.saucer\",\n      \"label\": \"{$until | until}\",\n      \"label_icon\": \"$mode | map:{off:'cup.and.saucer', else:'cup.and.saucer.fill'}\",\n      \"card\": \"main\"\n    },\n    \"floating\": { \"card\": \"main\", \"width\": \"default\" }\n  }\n}\n",
    "files": []
}