2024-07-09 15:39:40 +09:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"flag"
|
2024-09-04 01:20:12 +09:00
|
|
|
|
2024-09-08 02:24:01 +09:00
|
|
|
"git.ophivana.moe/cat/fortify/internal/app"
|
2024-07-09 15:39:40 +09:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2024-09-09 03:16:54 +09:00
|
|
|
userName string
|
|
|
|
dbusConfig string
|
|
|
|
dbusID string
|
|
|
|
mpris bool
|
2024-09-08 02:24:01 +09:00
|
|
|
|
|
|
|
mustWayland bool
|
|
|
|
mustX bool
|
|
|
|
mustDBus bool
|
|
|
|
mustPulse bool
|
|
|
|
|
2024-09-04 01:20:12 +09:00
|
|
|
flagVerbose bool
|
2024-09-08 02:24:01 +09:00
|
|
|
printVersion bool
|
2024-07-09 15:39:40 +09:00
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
2024-09-09 03:16:54 +09:00
|
|
|
flag.StringVar(&userName, "u", "chronos", "Passwd name of user to run as")
|
|
|
|
flag.StringVar(&dbusConfig, "dbus-config", "builtin", "Path to D-Bus proxy config file, or \"builtin\" for defaults")
|
|
|
|
flag.StringVar(&dbusID, "dbus-id", "", "D-Bus ID of application, leave empty to disable own paths, has no effect if custom config is available")
|
|
|
|
flag.BoolVar(&mpris, "mpris", false, "Allow owning MPRIS D-Bus path, has no effect if custom config is available")
|
2024-09-08 02:24:01 +09:00
|
|
|
|
|
|
|
flag.BoolVar(&mustWayland, "wayland", false, "Share Wayland socket")
|
|
|
|
flag.BoolVar(&mustX, "X", false, "Share X11 socket and allow connection")
|
|
|
|
flag.BoolVar(&mustDBus, "dbus", false, "Proxy D-Bus connection")
|
|
|
|
flag.BoolVar(&mustPulse, "pulse", false, "Share PulseAudio socket and cookie")
|
|
|
|
|
|
|
|
flag.BoolVar(&app.LaunchOptions[app.LaunchMethodSudo], "sudo", false, "Use 'sudo' to switch user")
|
|
|
|
flag.BoolVar(&app.LaunchOptions[app.LaunchMethodMachineCtl], "machinectl", true, "Use 'machinectl' to switch user")
|
|
|
|
|
2024-09-04 01:20:12 +09:00
|
|
|
flag.BoolVar(&flagVerbose, "v", false, "Verbose output")
|
2024-07-09 15:39:40 +09:00
|
|
|
flag.BoolVar(&printVersion, "V", false, "Print version")
|
|
|
|
}
|