Files
tailscale/cmd/tailscale/cli/configure_linux.go
T
Will Norris 2d85f37f39 client/systray: support several different color themes
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 <[email protected]>
2026-04-27 18:54:14 -07:00

52 lines
1.3 KiB
Go

// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause
//go:build linux && !ts_omit_systray
package cli
import (
"context"
"flag"
"fmt"
"github.com/peterbourgon/ff/v3/ffcli"
"tailscale.com/client/systray"
)
func init() {
maybeSystrayCmd = systrayConfigCmd
}
var configSystrayArgs struct {
initSystem string
installStartup bool
}
func systrayConfigCmd() *ffcli.Command {
return &ffcli.Command{
Name: "systray",
ShortUsage: "tailscale configure systray [options]",
ShortHelp: "[ALPHA] Manage the systray client for Linux",
LongHelp: "[ALPHA] The systray set of commands provides a way to configure the systray application on Linux.",
Exec: configureSystray,
FlagSet: (func() *flag.FlagSet {
fs := newFlagSet("systray")
fs.StringVar(&configSystrayArgs.initSystem, "enable-startup", "",
"Install startup script for init system. Currently supported systems are [systemd, freedesktop].")
return fs
})(),
}
}
func configureSystray(_ context.Context, _ []string) error {
if configSystrayArgs.initSystem != "" {
if err := systray.InstallStartupScript(configSystrayArgs.initSystem); err != nil {
fmt.Printf("%s\n\n", err.Error())
return flag.ErrHelp
}
return nil
}
return flag.ErrHelp
}