{
  "name": "Desk mode",
  "version": 1,
  "nodes": [
    {
      "localID": 0,
      "typeID": "trigger.device_event",
      "customName": "Display connected",
      "isDisabled": false,
      "x": 60.0,
      "y": 110.0,
      "config": {
        "event": "display_connected",
        "customArgs": {}
      }
    },
    {
      "localID": 1,
      "typeID": "trigger.device_event",
      "customName": "Display disconnected",
      "isDisabled": false,
      "x": 60.0,
      "y": 330.0,
      "config": {
        "event": "display_disconnected",
        "customArgs": {}
      }
    },
    {
      "localID": 2,
      "typeID": "condition.compare",
      "customName": "Plugged in?",
      "isDisabled": false,
      "x": 380.0,
      "y": 220.0,
      "config": {
        "rules": [
          {
            "field": "event",
            "operator": "ends_with",
            "value": "_connected",
            "negate": false
          }
        ],
        "logic": "and",
        "caseInsensitive": false
      }
    },
    {
      "localID": 3,
      "typeID": "action.keep_awake",
      "customName": "Keep Mac Awake",
      "isDisabled": false,
      "x": 700.0,
      "y": 110.0,
      "config": {
        "scope": "screenOn",
        "timeoutMinutes": 0
      }
    },
    {
      "localID": 4,
      "typeID": "action.open_file",
      "customName": "Open Mail",
      "isDisabled": false,
      "x": 1020.0,
      "y": 110.0,
      "config": {
        "filePath": "/System/Applications/Mail.app"
      }
    },
    {
      "localID": 5,
      "typeID": "action.apple_music",
      "customName": "Apple Music",
      "isDisabled": false,
      "x": 1340.0,
      "y": 110.0,
      "config": {
        "action": "search_play",
        "searchQuery": "Focus",
        "searchType": "playlist",
        "shuffle": true,
        "startAt": ""
      }
    },
    {
      "localID": 6,
      "typeID": "action.notification",
      "customName": "Desk mode on",
      "isDisabled": false,
      "x": 1660.0,
      "y": 110.0,
      "config": {
        "title": "Desk mode on",
        "body": "{{displayCount}} displays. Staying awake, playing {{trackName}}.",
        "actionURL": "",
        "forceDisplay": false
      }
    },
    {
      "localID": 7,
      "typeID": "action.allow_sleep",
      "customName": "Allow Sleep",
      "isDisabled": false,
      "x": 700.0,
      "y": 330.0,
      "config": {}
    },
    {
      "localID": 8,
      "typeID": "action.script",
      "customName": "Pause Music",
      "isDisabled": false,
      "x": 1020.0,
      "y": 330.0,
      "config": {
        "shell": "/bin/bash",
        "script": "# Pause only if Music is already open; telling a closed Music to pause would launch it.\nif pgrep -xq Music; then\n  osascript -e 'tell application \"Music\" to pause'\n  echo \"Music paused.\"\nelse\n  echo \"Music was not playing.\"\nfi",
        "outputSchema": ""
      }
    },
    {
      "localID": 9,
      "typeID": "action.notification",
      "customName": "Desk mode off",
      "isDisabled": false,
      "x": 1340.0,
      "y": 330.0,
      "config": {
        "title": "Desk mode off",
        "body": "{{output}} Sleep is back to normal.",
        "actionURL": "",
        "forceDisplay": false
      }
    },
    {
      "localID": 10,
      "typeID": "note",
      "customName": "Plug or unplug",
      "isDisabled": false,
      "x": 20.0,
      "y": 50.0,
      "config": {
        "backdrop": true,
        "color": "#64B5F6",
        "text": "Plug or unplug",
        "_width": 620.0,
        "_height": 400.0
      }
    },
    {
      "localID": 11,
      "typeID": "note",
      "customName": "At the desk",
      "isDisabled": false,
      "x": 660.0,
      "y": 50.0,
      "config": {
        "backdrop": true,
        "color": "#81C784",
        "text": "At the desk",
        "_width": 1260.0,
        "_height": 180.0
      }
    },
    {
      "localID": 12,
      "typeID": "note",
      "customName": "Away",
      "isDisabled": false,
      "x": 660.0,
      "y": 270.0,
      "config": {
        "backdrop": true,
        "color": "#F5A623",
        "text": "Away",
        "_width": 940.0,
        "_height": 180.0
      }
    }
  ],
  "connections": [
    {
      "sourceLocalID": 0,
      "sourcePortID": "outlet_output",
      "targetLocalID": 2,
      "targetPortID": "inlet_input"
    },
    {
      "sourceLocalID": 1,
      "sourcePortID": "outlet_output",
      "targetLocalID": 2,
      "targetPortID": "inlet_input"
    },
    {
      "sourceLocalID": 2,
      "sourcePortID": "outlet_yes",
      "targetLocalID": 3,
      "targetPortID": "inlet_input"
    },
    {
      "sourceLocalID": 3,
      "sourcePortID": "outlet_output",
      "targetLocalID": 4,
      "targetPortID": "inlet_input"
    },
    {
      "sourceLocalID": 4,
      "sourcePortID": "outlet_output",
      "targetLocalID": 5,
      "targetPortID": "inlet_input"
    },
    {
      "sourceLocalID": 5,
      "sourcePortID": "outlet_output",
      "targetLocalID": 6,
      "targetPortID": "inlet_input"
    },
    {
      "sourceLocalID": 2,
      "sourcePortID": "outlet_no",
      "targetLocalID": 7,
      "targetPortID": "inlet_input"
    },
    {
      "sourceLocalID": 7,
      "sourcePortID": "outlet_output",
      "targetLocalID": 8,
      "targetPortID": "inlet_input"
    },
    {
      "sourceLocalID": 8,
      "sourcePortID": "outlet_output",
      "targetLocalID": 9,
      "targetPortID": "inlet_input"
    }
  ],
  "background": {
    "type": "image",
    "ref": {
      "type": "bundled",
      "id": "graphite"
    },
    "fit": "cover"
  }
}
