{
  "version": 2,
  "name": "System",
  "description": "Dark mode, sleep, keep-awake, battery, disk space and maintenance commands. Items marked with a lock ask for your password.",
  "categories": [
    {
      "id": "system",
      "name": "System",
      "sortOrder": 0,
      "iconSymbolName": "gearshape",
      "showAtTopLevel": false,
      "items": [
        {
          "id": "system-toggle-dark-mode",
          "title": "Toggle Dark Mode",
          "isEnabled": true,
          "command": {
            "type": "AppleScript",
            "value": "tell application \"System Events\" to tell appearance preferences to set dark mode to not dark mode",
            "runInBackground": true,
            "showNotification": false,
            "copyToClipboard": false,
            "openInTerminal": false
          },
          "confirmBeforeRunning": false,
          "isSeparator": false,
          "iconSymbolName": "circle.lefthalf.filled"
        },
        {
          "id": "system-sleep-display",
          "title": "Sleep Display",
          "isEnabled": true,
          "command": {
            "type": "Shell Command",
            "value": "pmset displaysleepnow",
            "runInBackground": true,
            "showNotification": false,
            "copyToClipboard": false,
            "openInTerminal": false
          },
          "confirmBeforeRunning": false,
          "isSeparator": false,
          "iconSymbolName": "display"
        },
        {
          "id": "system-start-screensaver",
          "title": "Start Screen Saver",
          "isEnabled": true,
          "command": {
            "type": "Shell Command",
            "value": "open -a ScreenSaverEngine",
            "runInBackground": true,
            "showNotification": false,
            "copyToClipboard": false,
            "openInTerminal": false
          },
          "confirmBeforeRunning": false,
          "isSeparator": false,
          "iconSymbolName": "lock.display"
        },
        {
          "id": "system-keep-awake",
          "title": "Keep Awake for 1 Hour",
          "isEnabled": true,
          "command": {
            "type": "Shell Command",
            "value": "pkill -x caffeinate; (nohup caffeinate -dit 3600 >/dev/null 2>&1 &); echo 'Mac will stay awake for 1 hour'",
            "runInBackground": true,
            "showNotification": true,
            "copyToClipboard": false,
            "openInTerminal": false
          },
          "confirmBeforeRunning": false,
          "isSeparator": false,
          "iconSymbolName": "cup.and.saucer"
        },
        {
          "id": "system-stop-keep-awake",
          "title": "Stop Keeping Awake",
          "isEnabled": true,
          "command": {
            "type": "Shell Command",
            "value": "pkill -x caffeinate && echo 'Normal sleep restored' || echo 'Keep Awake was not running'",
            "runInBackground": true,
            "showNotification": true,
            "copyToClipboard": false,
            "openInTerminal": false
          },
          "confirmBeforeRunning": false,
          "isSeparator": false,
          "iconSymbolName": "moon.zzz"
        },
        {
          "id": "system-sep-1",
          "title": "",
          "isEnabled": true,
          "isSeparator": true,
          "command": {
            "type": "Shell Command",
            "value": "",
            "runInBackground": true,
            "showNotification": false,
            "copyToClipboard": false,
            "openInTerminal": false
          },
          "confirmBeforeRunning": false
        },
        {
          "id": "system-battery",
          "title": "Battery Level",
          "isEnabled": true,
          "command": {
            "type": "Shell Command",
            "value": "pmset -g batt | grep -o '[0-9]*%' | head -1 | grep . || echo 'No battery'",
            "runInBackground": true,
            "showNotification": true,
            "copyToClipboard": false,
            "openInTerminal": false
          },
          "confirmBeforeRunning": false,
          "isSeparator": false,
          "iconSymbolName": "battery.75"
        },
        {
          "id": "system-free-disk",
          "title": "Free Disk Space",
          "isEnabled": true,
          "command": {
            "type": "Shell Command",
            "value": "df -h / | awk 'NR==2 {print $4 \" free of \" $2}'",
            "runInBackground": true,
            "showNotification": true,
            "copyToClipboard": false,
            "openInTerminal": false
          },
          "confirmBeforeRunning": false,
          "isSeparator": false,
          "iconSymbolName": "internaldrive"
        },
        {
          "id": "system-uptime",
          "title": "Uptime",
          "isEnabled": true,
          "command": {
            "type": "Shell Command",
            "value": "uptime | sed -E 's/.* up +//; s/, +[0-9]+ users?.*//'",
            "runInBackground": true,
            "showNotification": true,
            "copyToClipboard": false,
            "openInTerminal": false
          },
          "confirmBeforeRunning": false,
          "isSeparator": false,
          "iconSymbolName": "clock"
        },
        {
          "id": "system-macos-version",
          "title": "Show/Copy macOS Version",
          "isEnabled": true,
          "command": {
            "type": "Shell Command",
            "value": "echo \"macOS $(sw_vers -productVersion) ($(sw_vers -buildVersion))\"",
            "runInBackground": true,
            "showNotification": true,
            "copyToClipboard": true,
            "openInTerminal": false
          },
          "confirmBeforeRunning": false,
          "isSeparator": false,
          "iconSymbolName": "apple.logo"
        },
        {
          "id": "system-sep-2",
          "title": "",
          "isEnabled": true,
          "isSeparator": true,
          "command": {
            "type": "Shell Command",
            "value": "",
            "runInBackground": true,
            "showNotification": false,
            "copyToClipboard": false,
            "openInTerminal": false
          },
          "confirmBeforeRunning": false
        },
        {
          "id": "system-empty-trash",
          "title": "Empty Trash",
          "isEnabled": true,
          "command": {
            "type": "AppleScript",
            "value": "tell application \"Finder\" to empty trash",
            "runInBackground": true,
            "showNotification": false,
            "copyToClipboard": false,
            "openInTerminal": false
          },
          "confirmBeforeRunning": true,
          "isSeparator": false,
          "iconSymbolName": "trash"
        },
        {
          "id": "system-purge-memory",
          "title": "Purge Memory",
          "isEnabled": true,
          "command": {
            "type": "AppleScript",
            "value": "do shell script \"purge\" with administrator privileges",
            "runInBackground": true,
            "showNotification": true,
            "copyToClipboard": false,
            "openInTerminal": false
          },
          "confirmBeforeRunning": false,
          "isSeparator": false,
          "iconSymbolName": "memorychip"
        },
        {
          "id": "system-rebuild-spotlight",
          "title": "Rebuild Spotlight Index",
          "isEnabled": true,
          "command": {
            "type": "AppleScript",
            "value": "do shell script \"mdutil -E /\" with administrator privileges",
            "runInBackground": true,
            "showNotification": true,
            "copyToClipboard": false,
            "openInTerminal": false
          },
          "confirmBeforeRunning": true,
          "isSeparator": false,
          "iconSymbolName": "magnifyingglass"
        }
      ]
    }
  ]
}
