diff --git a/src/atomic-xr/envision.nu b/src/atomic-xr/envision.nu index 4147906..2ea395f 100644 --- a/src/atomic-xr/envision.nu +++ b/src/atomic-xr/envision.nu @@ -19,6 +19,19 @@ export def uninstall [] { log info "Successfully uninstalled Envision" } +def ensure-host-packages [ + ...packages: string +] { + $packages + | each {|package| + if (rpm -q $package | complete | get exit_code) != 0 { + rpm-ostree install $package + # TODO: Notification actions + notify-send -u critical $"`($package)` installed" "Please reboot or use `rpm-ostree ex apply-live` before attempting to launch Envision." + } + } +} + export def upgrade [] { distrobox upgrade envision @@ -34,11 +47,7 @@ export def upgrade [] { } git switch --detach (git tag -l --sort=v:refname | lines | last) - if (rpm -q openxr-libs openvr-api | complete | get exit_code) != 0 { - rpm-ostree install openxr-libs openvr-api - # TODO: Notification actions - notify-send -u critical "Package(s) Installed" "Please reboot or use `rpm-ostree ex apply-live` before attempting to launch Envision." - } + ensure-host-packages openxr-libs openvr-api [ "Actions=BuildMode;"