Skip to content

Commit

Permalink
Merge pull request #1124 from mrpalide/feature/improve-systray
Browse files Browse the repository at this point in the history
VPN Control Buttons in Systray
  • Loading branch information
ersonp committed Apr 11, 2022
2 parents fb0bf3a + 82c773b commit 0750b34
Show file tree
Hide file tree
Showing 22 changed files with 333 additions and 116 deletions.
26 changes: 13 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -164,19 +164,19 @@ host-apps-windows:
powershell 'Get-ChildItem .\cmd\apps | % { ${OPTS} go build ${BUILD_OPTS} -o ./apps $$_.FullName }'

host-apps-systray: ## Build app
${OPTS} go build ${BUILD_OPTS} -o ./apps/skychat ./cmd/apps/skychat
${OPTS} go build ${BUILD_OPTS} -o ./apps/skysocks ./cmd/apps/skysocks
${OPTS} go build ${BUILD_OPTS} -o ./apps/skysocks-client ./cmd/apps/skysocks-client
${OPTS} go build ${BUILD_OPTS} -tags systray -o ./apps/vpn-server ./cmd/apps/vpn-server
${OPTS} go build ${BUILD_OPTS} -tags systray -o ./apps/vpn-client ./cmd/apps/vpn-client
${OPTS} go build ${BUILD_OPTS} -o ./apps/ ./cmd/apps/skychat
${OPTS} go build ${BUILD_OPTS} -o ./apps/ ./cmd/apps/skysocks
${OPTS} go build ${BUILD_OPTS} -o ./apps/ ./cmd/apps/skysocks-client
${OPTS} go build ${BUILD_OPTS} -tags systray -o ./apps/ ./cmd/apps/vpn-server
${OPTS} go build ${BUILD_OPTS} -tags systray -o ./apps/ ./cmd/apps/vpn-client

host-apps-systray-windows:
powershell -Command new-item .\apps -itemtype directory -force
powershell 'go build ${BUILD_OPTS} -o .\apps\skychat .\cmd\apps\skychat'
powershell 'go build ${BUILD_OPTS} -o .\apps\skysocks .\cmd\apps\skysocks'
powershell 'go build ${BUILD_OPTS} -o .\apps\skysocks-client .\cmd\apps\skysocks-client'
powershell 'go build ${BUILD_OPTS} -tags systray -o .\apps\vpn-server .\cmd\apps\vpn-server'
powershell 'go build ${BUILD_OPTS} -tags systray -o .\apps\vpn-client .\cmd\apps\vpn-client'
powershell 'go build ${BUILD_OPTS} -o .\apps\skychat.exe .\cmd\apps\skychat'
powershell 'go build ${BUILD_OPTS} -o .\apps\skysocks.exe .\cmd\apps\skysocks'
powershell 'go build ${BUILD_OPTS} -o .\apps\skysocks-client.exe .\cmd\apps\skysocks-client'
powershell 'go build ${BUILD_OPTS} -tags systray -o .\apps\vpn-server.exe .\cmd\apps\vpn-server'
powershell 'go build ${BUILD_OPTS} -tags systray -o .\apps\vpn-client.exe .\cmd\apps\vpn-client'

# Static Apps
host-apps-static: ## Build app
Expand All @@ -200,9 +200,9 @@ bin-systray-windows: ## Build `skywire-visor` and `skywire-cli` with systray sup
powershell 'Get-ChildItem .\cmd | % { ${OPTS} go build ${BUILD_OPTS} -tags systray -o ./ $$_.FullName }'

bin-systray: ## Build `skywire-visor`, `skywire-cli`
${OPTS} go build ${BUILD_OPTS} -tags systray -o ./skywire-visor ./cmd/skywire-visor
${OPTS} go build ${BUILD_OPTS} -tags systray -o ./skywire-cli ./cmd/skywire-cli
${OPTS} go build ${BUILD_OPTS} -o ./setup-node ./cmd/setup-node
${OPTS} go build ${BUILD_OPTS} -tags systray -o ./ ./cmd/skywire-visor
${OPTS} go build ${BUILD_OPTS} -tags systray -o ./ ./cmd/skywire-cli
${OPTS} go build ${BUILD_OPTS} -o ./ ./cmd/setup-node

# Static Bin
bin-static: ## Build `skywire-visor`, `skywire-cli`
Expand Down
1 change: 0 additions & 1 deletion apps

This file was deleted.

4 changes: 0 additions & 4 deletions cmd/skywire-visor/commands/nosystray.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ import (
"github.com/skycoin/skycoin/src/util/logging"
)

func extraFlags() {

}

func runApp() {
runVisor()
}
Expand Down
2 changes: 0 additions & 2 deletions cmd/skywire-visor/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ func init() {
for _, j := range hiddenflags {
rootCmd.Flags().MarkHidden(j) //nolint
}

extraFlags()
}

var rootCmd = &cobra.Command{
Expand Down
9 changes: 0 additions & 9 deletions cmd/skywire-visor/commands/systray.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@ import (
"github.com/skycoin/skywire/internal/gui"
)

var (
runSysTrayApp bool
)

func extraFlags() {
rootCmd.Flags().BoolVar(&runSysTrayApp, "systray", false, "Run system tray app")
}

func runApp(args ...string) {
l := logging.NewMasterLogger()
sysTrayIcon, err := gui.ReadSysTrayIcon()
Expand All @@ -33,7 +25,6 @@ func runApp(args ...string) {
}()

conf := initConfig(l, confPath)

systray.Run(gui.GetOnGUIReady(sysTrayIcon, conf), gui.OnGUIQuit)

}
Expand Down
3 changes: 2 additions & 1 deletion docs/systray-builds.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ To build `skywire-visor` with systray feature enabled, you have to had these ins
- Debian / Ubuntu and its derivations

```bash
$ sudo apt install libgtk-3-dev libappindicator3-dev
$ sudo apt-get install gcc libgtk-3-dev libayatana-appindicator3-dev libappindicator3-dev
```

- Fedora / RHEL and its derivations
Expand All @@ -23,6 +23,7 @@ $ sudo dnf install gtk3-devel libappindicator-gtk3-devel
```bash
$ sudo pacman -S libappindicator-gtk3 gtk3
```
also need install `libayatana-appindicator`. You can install it by [AUR](https://aur.archlinux.org/packages/libayatana-appindicator).

Other distros might require the installation of said library in their own respective name.

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/getlantern/golog v0.0.0-20201105130739-9586b8bde3a9 // indirect
github.com/getlantern/hidden v0.0.0-20201229170000-e66e7f878730 // indirect
github.com/getlantern/ops v0.0.0-20200403153110-8476b16edcd6 // indirect
github.com/getlantern/systray v1.1.0
github.com/getlantern/systray v1.2.1
github.com/google/go-github v17.0.0+incompatible
github.com/google/uuid v1.1.2
github.com/gorilla/securecookie v1.1.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ github.com/getlantern/hidden v0.0.0-20201229170000-e66e7f878730/go.mod h1:6mmzY2
github.com/getlantern/ops v0.0.0-20190325191751-d70cb0d6f85f/go.mod h1:D5ao98qkA6pxftxoqzibIBBrLSUli+kYnJqrgBf9cIA=
github.com/getlantern/ops v0.0.0-20200403153110-8476b16edcd6 h1:QthAQCekS1YOeYWSvoHI6ZatlG4B+GBDLxV/2ZkBsTA=
github.com/getlantern/ops v0.0.0-20200403153110-8476b16edcd6/go.mod h1:D5ao98qkA6pxftxoqzibIBBrLSUli+kYnJqrgBf9cIA=
github.com/getlantern/systray v1.1.0 h1:U0wCEqseLi2ok1fE6b88gJklzriavPJixZysZPkZd/Y=
github.com/getlantern/systray v1.1.0/go.mod h1:AecygODWIsBquJCJFop8MEQcJbWFfw/1yWbVabNgpCM=
github.com/getlantern/systray v1.2.1 h1:udsC2k98v2hN359VTFShuQW6GGprRprw6kD6539JikI=
github.com/getlantern/systray v1.2.1/go.mod h1:AecygODWIsBquJCJFop8MEQcJbWFfw/1yWbVabNgpCM=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
github.com/go-chi/chi/v5 v5.0.7/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
Expand Down
Loading

0 comments on commit 0750b34

Please sign in to comment.