diff options
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/hakurei/command.go | 10 | ||||
| -rw-r--r-- | cmd/hakurei/print.go | 2 | ||||
| -rw-r--r-- | cmd/hakurei/print_test.go | 18 | ||||
| -rw-r--r-- | cmd/hpkg/app.go | 3 | ||||
| -rw-r--r-- | cmd/hpkg/build.nix | 7 | ||||
| -rw-r--r-- | cmd/hpkg/test/test.py | 2 |
6 files changed, 30 insertions, 12 deletions
diff --git a/cmd/hakurei/command.go b/cmd/hakurei/command.go index d1d67307..2eee5def 100644 --- a/cmd/hakurei/command.go +++ b/cmd/hakurei/command.go @@ -124,18 +124,20 @@ func buildCommand(out io.Writer) command.Command { config.Data = a } + var e system.Enablement if wayland { - config.Enablements |= system.EWayland + e |= system.EWayland } if x11 { - config.Enablements |= system.EX11 + e |= system.EX11 } if dBus { - config.Enablements |= system.EDBus + e |= system.EDBus } if pulse { - config.Enablements |= system.EPulse + e |= system.EPulse } + config.Enablements = hst.NewEnablements(e) // parse D-Bus config file from flags if applicable if dBus { diff --git a/cmd/hakurei/print.go b/cmd/hakurei/print.go index ff3ce645..78c34bec 100644 --- a/cmd/hakurei/print.go +++ b/cmd/hakurei/print.go @@ -78,7 +78,7 @@ func printShowInstance( } else { t.Printf(" Identity:\t%d\n", config.Identity) } - t.Printf(" Enablements:\t%s\n", config.Enablements.String()) + t.Printf(" Enablements:\t%s\n", config.Enablements.Unwrap().String()) if len(config.Groups) > 0 { t.Printf(" Groups:\t%s\n", strings.Join(config.Groups, ", ")) } diff --git a/cmd/hakurei/print_test.go b/cmd/hakurei/print_test.go index 0935de27..c2f97ec1 100644 --- a/cmd/hakurei/print_test.go +++ b/cmd/hakurei/print_test.go @@ -195,7 +195,11 @@ App "--enable-features=UseOzonePlatform", "--ozone-platform=wayland" ], - "enablements": 13, + "enablements": { + "wayland": true, + "dbus": true, + "pulse": true + }, "session_bus": { "see": null, "talk": [ @@ -339,7 +343,11 @@ App "--enable-features=UseOzonePlatform", "--ozone-platform=wayland" ], - "enablements": 13, + "enablements": { + "wayland": true, + "dbus": true, + "pulse": true + }, "session_bus": { "see": null, "talk": [ @@ -537,7 +545,11 @@ func Test_printPs(t *testing.T) { "--enable-features=UseOzonePlatform", "--ozone-platform=wayland" ], - "enablements": 13, + "enablements": { + "wayland": true, + "dbus": true, + "pulse": true + }, "session_bus": { "see": null, "talk": [ diff --git a/cmd/hpkg/app.go b/cmd/hpkg/app.go index 131f839d..4493dad7 100644 --- a/cmd/hpkg/app.go +++ b/cmd/hpkg/app.go @@ -8,7 +8,6 @@ import ( "hakurei.app/container" "hakurei.app/container/seccomp" "hakurei.app/hst" - "hakurei.app/system" "hakurei.app/system/dbus" ) @@ -41,7 +40,7 @@ type appInfo struct { // passed through to [hst.Config] SessionBus *dbus.Config `json:"session_bus,omitempty"` // passed through to [hst.Config] - Enablements system.Enablement `json:"enablements"` + Enablements *hst.Enablements `json:"enablements,omitempty"` // passed through to [hst.Config] Multiarch bool `json:"multiarch,omitempty"` diff --git a/cmd/hpkg/build.nix b/cmd/hpkg/build.nix index 13f3144f..3733f420 100644 --- a/cmd/hpkg/build.nix +++ b/cmd/hpkg/build.nix @@ -171,7 +171,12 @@ let broadcast = { }; }); - enablements = (if allow_wayland then 1 else 0) + (if allow_x11 then 2 else 0) + (if allow_dbus then 4 else 0) + (if allow_pulse then 8 else 0); + enablements = { + wayland = allow_wayland; + x11 = allow_x11; + dbus = allow_dbus; + pulse = allow_pulse; + }; mesa = if gpu then mesaWrappers else null; nix_gl = if gpu then nixGL else null; diff --git a/cmd/hpkg/test/test.py b/cmd/hpkg/test/test.py index c9944354..5a199acc 100644 --- a/cmd/hpkg/test/test.py +++ b/cmd/hpkg/test/test.py @@ -92,7 +92,7 @@ wait_for_window("hakurei@machine-foot") machine.send_chars("clear; wayland-info && touch /tmp/success-client\n") machine.wait_for_file("/tmp/hakurei.1000/tmpdir/2/success-client") collect_state_ui("app_wayland") -check_state("foot", 13) +check_state("foot", {"wayland": True, "dbus": True, "pulse": True}) # Verify acl on XDG_RUNTIME_DIR: print(machine.succeed("getfacl --absolute-names --omit-header --numeric /run/user/1000 | grep 1000002")) machine.send_chars("exit\n") |
