systrayhelper

command module
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2018 License: MIT Imports: 10 Imported by: 0

README

systrayhelper Build Status

A portable version of go systray, using json objects over stdio to communicate with other languages.

Note(cryptix): this is the cleanup fork of forked-systrayhelper sorry for the mess..

Installation

Install Go and run go get -v github.com/ssbc/systrayhelper. The binary will be in $PATH/go/bin by default.

Or clone this repo and build it:

git clone https://github.com/ssbc/systrayhelper
cd systrayhelper
go build
./systrayhelper --test

Linux: As noted on the getlantern/systray repo, you need to install these two packages: libgtk-3-dev and libappindicator3-dev

On windows and darwin it should built just fine.

Testing

The testsuite in the test/ folder uses xvfb to run the i3 window manager and use xdotool to run interactive tests against the helper. If it interferes with your X setup, you can also try this, which is what runs on travis:

xvfb-run -s '-screen 0 800x600x16' dbus-run-session go test -v ./...

Protocol

tray binary =>
=> ready {"type": "ready"}
<= init menu

{
  "icon": "<base64 string of image>",
  "title": "Title",
  "tooltip": "Tooltips",
  "items":[{
    "title": "aa",
    "tooltip":"bb",
    "checked": true,
    "enabled": true
  }, {
    "title": "aa2",
    "tooltip":"bb",
    "checked": false,
    "enabled": true
  }]}

=> clicked

{
  "type":"clicked",
  "item":{"title":"aa","tooltip":"bb","enabled":true,"checked":true},
  "menu":{"icon":"","title":"","tooltip":"","items":null},
  "seq_id":0
}

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

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

Repo Init

Had to start somewhere, so I took 99b200... from the previous repo.

$ git clone https://github.com/ssbc/forked-systray small
$ cd small && git reset --hard 99b2002b2e34f6381a04f365907f2e9dcd8837ea
HEAD is now at 99b2002 changed name to forked-systray
$ archive=../systrayhelper-new.tar
$ tar cf $archive * && xz $archive
$ ls -sh $archive.xz && sbot blobs.add < $archive.xz
8.5K ../systrayhelper-new.tar.xz
&YmiqTDdWgNzdAczEo+DNHKb1X1X4hyHNrWc7rFgIW84=.sha256

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL