DavidBeale / systray-portable

A portable version of go systray, using stdin/stdout to communicate with other language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

systray-portable

A portable version of go systray, using stdin/stdout to communicate with other language.

A fork from https://github.com/felixhao28/systray-portable, which in turn forked from https://github.com/zaaack/systray-portable.

Protocol

Each line is a json string.

tray binary =>
=> ready {"type": "ready"}

<= init menu

{
  "icon": "<base64 string of image>",
  "title": "Title",
  "tooltip": "Tooltip",
  "items":[{
    "title": "aa",
    "tooltip":"bb",
    "checked": true,
    "enabled": true,
    "hidden": false,
    "__id": 0
  }, {
    "title": "<SEPARATOR>",
    "tooltip":"",
    "checked": true,
    "enabled": true,
    "hidden": false,
    "__id": 1
  }, {
    "title": "aa2",
    "tooltip":"bb",
    "checked": false,
    "enabled": true,
    "hidden": false,
    "__id": 2
  }]}

=> clicked

{
  "type":"clicked",
  "__id":0
}

<= update-item / update-menu / update-item-and-menu

{
  "type": "update-item",
  "item": {"title":"aa3","tooltip":"bb","enabled":true,"checked":true,"__id":0},
}

<= exit gracefully

{
  "type": "exit"
}

Binary

go build -ldflags "-s -w" tray.go (-s -w strips symbol table and debug info, optional)

About

A portable version of go systray, using stdin/stdout to communicate with other language

License:MIT License


Languages

Language:Go 91.9%Language:JavaScript 8.1%