diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-03-25 04:42:30 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-03-25 04:42:30 +0900 |
| commit | ec5e91b8c97f02707a70a789ba4af84d51394ea5 (patch) | |
| tree | 45f05e1315063936741ddafde8b5f95338315b54 /internal/app/seal.go | |
| parent | ee51320abfeafabecd42659a88af9dfd44308a3a (diff) | |
system: optimise string formatting
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/app/seal.go')
| -rw-r--r-- | internal/app/seal.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/app/seal.go b/internal/app/seal.go index a25897dc..549de160 100644 --- a/internal/app/seal.go +++ b/internal/app/seal.go @@ -224,7 +224,7 @@ func (seal *outcome) finalise(ctx context.Context, sys sys.State, config *fst.Co conf.Cover = append(conf.Cover, nscd) } // bind GPU stuff - if config.Confinement.Enablements.Has(system.EX11) || config.Confinement.Enablements.Has(system.EWayland) { + if config.Confinement.Enablements&(system.EX11|system.EWayland) != 0 { conf.Filesystem = append(conf.Filesystem, &fst.FilesystemConfig{Src: "/dev/dri", Device: true}) } // opportunistically bind kvm @@ -338,7 +338,7 @@ func (seal *outcome) finalise(ctx context.Context, sys sys.State, config *fst.Co seal.env[term] = t } - if config.Confinement.Enablements.Has(system.EWayland) { + if config.Confinement.Enablements&system.EWayland != 0 { // outer wayland socket (usually `/run/user/%d/wayland-%d`) var socketPath string if name, ok := sys.LookupEnv(wl.WaylandDisplay); !ok { @@ -371,7 +371,7 @@ func (seal *outcome) finalise(ctx context.Context, sys sys.State, config *fst.Co } } - if config.Confinement.Enablements.Has(system.EX11) { + if config.Confinement.Enablements&system.EX11 != 0 { if d, ok := sys.LookupEnv(display); !ok { return fmsg.WrapError(ErrXDisplay, "DISPLAY is not set") @@ -386,7 +386,7 @@ func (seal *outcome) finalise(ctx context.Context, sys sys.State, config *fst.Co PulseAudio server and authentication */ - if config.Confinement.Enablements.Has(system.EPulse) { + if config.Confinement.Enablements&system.EPulse != 0 { // PulseAudio runtime directory (usually `/run/user/%d/pulse`) pulseRuntimeDir := path.Join(sc.RuntimePath, "pulse") // PulseAudio socket (usually `/run/user/%d/pulse/native`) @@ -439,7 +439,7 @@ func (seal *outcome) finalise(ctx context.Context, sys sys.State, config *fst.Co D-Bus proxy */ - if config.Confinement.Enablements.Has(system.EDBus) { + if config.Confinement.Enablements&system.EDBus != 0 { // ensure dbus session bus defaults if config.Confinement.SessionBus == nil { config.Confinement.SessionBus = dbus.NewConfig(config.ID, true, true) |
