2d85f37f39
Currently we only have a dark theme icon with white and grey dots over a black background. For some desktops, a logo with black and grey dots over a white background might be preferable. And for desktops where the bar is *almost* black or white, but not quite, an option to render the logo with dots only and no background can look really nice. Add a new -theme flag to the systray command with the default staying the same as it is today. Updates #18303 Change-Id: Ia101a4a3005adb9118051b3416f5a64a4a45987d Signed-off-by: Will Norris <will@tailscale.com>
38 lines
872 B
Go
38 lines
872 B
Go
// Copyright (c) Tailscale Inc & contributors
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
//go:build linux && !ts_omit_systray
|
|
|
|
package cli
|
|
|
|
import (
|
|
"context"
|
|
"flag"
|
|
|
|
"github.com/peterbourgon/ff/v3/ffcli"
|
|
"tailscale.com/client/systray"
|
|
)
|
|
|
|
var systrayCmd = &ffcli.Command{
|
|
Name: "systray",
|
|
ShortUsage: "tailscale systray",
|
|
ShortHelp: "Run a systray application to manage Tailscale",
|
|
LongHelp: "Run a systray application to manage Tailscale.",
|
|
FlagSet: (func() *flag.FlagSet {
|
|
fs := newFlagSet("systray")
|
|
fs.StringVar(&systrayArgs.theme, "theme", "dark", "color theme for Tailscale icon: dark, dark:nobg, light, light:nobg")
|
|
return fs
|
|
})(),
|
|
Exec: runSystray,
|
|
}
|
|
|
|
var systrayArgs struct {
|
|
theme string
|
|
}
|
|
|
|
func runSystray(ctx context.Context, _ []string) error {
|
|
systray.SetTheme(systrayArgs.theme)
|
|
new(systray.Menu).Run(&localClient)
|
|
return nil
|
|
}
|