[
  {
    "description" : "Extract archives in common formats.",
    "enabled" : true,
    "name" : "Decompressor",
    "settings" : {
      "action" : "Send text",
      "script" : true,
      "text" : "(captures) => {\n  const commands = {\n    \"tar.bz2\" : \"tar -xvjf\",\n    \"tar.gz\"  : \"tar -xvzf\",\n    \"tar.xz\"  : \"tar -xvJf\",\n    \"bz2\"     : \"bzip2 -d\",\n    \"ex\"      : \"uncompress\",\n    \"exe\"     : \"cabextract\",\n    \"gz\"      : \"gzip -d\",\n    \"lzma\"    : \"lzma -d\",\n    \"rar\"     : \"unrar x\",\n    \"tar\"     : \"tar -xvf\",\n    \"tbz2\"    : \"tar -xvjf\",\n    \"tgz\"     : \"tar -xvzf\",\n    \"xz\"      : \"xz -d\",\n    \"zip\"     : \"unzip\",\n    \"z\"       : \"uncompress\",\n    \"7z\"      : \"7z x\"\n  };\n  const command = commands[captures.suffix.toLowerCase()];\n  return command ? `${command} ${captures.match} ` : '';\n}",
      "text.lineColor" : "terminal.ansiBrightBlack",
      "text.lineStyle" : "DecorationSolid",
      "text.matchRegex" : true,
      "text.pattern" : "(?x)\\b[\\w\\-]++[^ \\\\/:*\\?\"<>\\|\\r\\n]*?\\.(?<suffix>\n  tar\\.gz\n| tar\\.bz2\n| tar\\.xz\n| zip\n| rar\n| tar\n| tbz2\n| tgz\n| bz2\n| gz\n| Z\n| 7z\n| xz\n| ex\n| exe\n| lzma\n)\\b"
    },
    "targetSystems" : [ "*" ],
    "type" : "Custom link",
    "uuid" : "c331c7a4-3ebb-4126-a1f7-3359669fb6f2"
  },
  {
    "description" : "Quickly open the hyperlink.",
    "enabled" : true,
    "name" : "Hyperlink",
    "settings" : {
      "action" : "Open hyperlink",
      "text" : "${match}",
      "text.lineColor" : "terminal.ansiBrightBlack",
      "text.lineStyle" : "DecorationSolid",
      "text.matchRegex" : true,
      "text.pattern" : "(?ix)\\b(\n  ( # url\n    (https?|mail|ftps?|file|scp|sftp)://\n    [-a-zA-Z0-9+&@#/%?=_~|!:,.;]*[-a-zA-Z0-9+&@#/%=_~|]\n  ) \n| \n  ( # mail\n    ([0-9a-z_.-]++)@([0-9a-z_.-]+)\\.([a-zA-Z]++)\n  )\n)(?=\\b|\\s|$)"
    },
    "targetSystems" : [ "*" ],
    "type" : "Custom link",
    "uuid" : "fef904b9-b03d-44dc-bc2c-1c4a9bc7104b"
  },
  {
    "description" : "Ping or tracert the IP address.",
    "enabled" : true,
    "name" : "Ip Address",
    "settings" : {
      "actions" : [
        {
          "action" : "Separator",
          "label" : "Send Text"
        },
        {
          "action" : "Send text",
          "label" : "&Ping\\t${match}",
          "text" : "ping ${match}\\n"
        },
        {
          "action" : "Send text",
          "label" : "&Traceroute\\t${match}",
          "text" : "traceroute ${match}\\n"
        },
        {
          "action" : "Separator",
          "label" : "Run Command"
        },
        {
          "action" : "Run command",
          "label" : "&Ping\\t${match}",
          "linux.arguments" : "${match}",
          "linux.command" : "ping",
          "macos.arguments" : "${match}",
          "macos.command" : "ping",
          "windows.arguments" : "${match}",
          "windows.command" : "ping"
        },
        {
          "action" : "Run command",
          "label" : "&Traceroute\\t${match}",
          "linux.arguments" : "${match}",
          "linux.command" : "mtr",
          "macos.arguments" : "${match}",
          "macos.command" : "traceroute",
          "windows.arguments" : "${match}",
          "windows.command" : "tracert"
        }
      ],
      "text.lineColor" : "terminal.ansiBrightBlack",
      "text.lineStyle" : "DecorationSolid",
      "text.matchRegex" : true,
      "text.pattern" : "(?x)(?i)(?<X>[a-f0-9]{1,4}){0}\\b(\n  (([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.){3}([01]?\\d\\d?|2[0-4]\\d|25[0-5])\n| ::(\\g<X>:){0,6}\\g<X>\n| (\\g<X>:){1,1}(:\\g<X>){1,6}\n| (\\g<X>:){1,2}(:\\g<X>){1,5}\n| (\\g<X>:){1,3}(:\\g<X>){1,4}\n| (\\g<X>:){1,4}(:\\g<X>){1,3}\n| (\\g<X>:){1,5}(:\\g<X>){1,2}\n| (\\g<X>:){1,6}(:\\g<X>){1,1}\n| (\\g<X>:){1,7}:\n| (\\g<X>:){7,7}( \\g<X>){1,1}\n)\\b"
    },
    "targetSystems" : [ "*" ],
    "type" : "Custom menu",
    "uuid" : "eb2bb041-cd4f-42ea-809b-22fd563aec57"
  },
  {
    "description" : "Convert numbers to decimal, octal or local time format.",
    "enabled" : true,
    "name" : "Number Convertor",
    "settings" : {
      "script" : true,
      "text" : "(captures) => {\n  if (captures.match.charAt(0) == '0') {\n    const decimal = parseInt(captures.match, 16);\n    const octal = decimal.toString(8);\n    return `Decimal:\\t${decimal}\\nOctal:\\t${octal}`;\n  } else {\n    const timestamp = captures.match.padEnd(13, '0').slice(0, 13);\n    return new Date(parseInt(timestamp)).toISOString();\n  }\n}",
      "text.lineColor" : "terminal.ansiBrightBlack",
      "text.lineStyle" : "DecorationSolid",
      "text.matchRegex" : true,
      "text.pattern" : "\\b(?=[012])(0[xX][0-9a-fA-F]+|(1\\d{9}|2[01]\\d{8})(\\d{3})?)\\b"
    },
    "targetSystems" : [ "*" ],
    "type" : "Show tooltip",
    "uuid" : "47c38ace-db32-4432-a1fb-9608eb747dc5"
  }
]
