XR for Universal Blue and Fedora Atomic Desktops
vr fedora-atomic linux
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

cli: switch to modcli and move into dedicated dir

+25 -115
+3
.gitmodules
··· 1 + [submodule "cli/modcli"] 2 + path = cli/modcli 3 + url = https://tangled.org/matrixfurry.com/modcli
+22
cli/install.nu
··· 1 + #!/usr/bin/env nu 2 + # SPDX-License-Identifier: AGPL-3.0-only 3 + # Copyright (c) 2025 Shiloh Fen <shiloh@shilohfen.com> 4 + 5 + use std log 6 + use ./modcli 7 + 8 + const mod_src = path self ./atomic-xr | path expand 9 + 10 + def main [ 11 + prefix: string = "~/.local" 12 + --install-module (-m) 13 + --force (-f) # Overwrite existing files 14 + --uninstall (-u) # Uninstall 15 + ] { 16 + if $uninstall { 17 + modcli uninstall "atomic-xr" $prefix --bin-name "axr" --remove-module=$install_module 18 + } else { 19 + modcli install $mod_src $prefix --force=$force --install-module=$install_module --bin-name "axr" 20 + log info "AtomicXR CLI has been installed, use `axr -l` for a list of commands." 21 + } 22 + }
-39
install.nu
··· 1 - #!/usr/bin/env nu 2 - # SPDX-License-Identifier: AGPL-3.0-only 3 - # Copyright (c) 2025 Shiloh Fen <shiloh@shilohfen.com> 4 - 5 - use std log 6 - 7 - const self: path = path self . 8 - let nu_lib_dir = $NU_LIB_DIRS | first 9 - 10 - def main [ 11 - prefix: string = "~/.local" 12 - --install-library (-l) 13 - --force (-f) # Overwrite existing files 14 - ] { 15 - let prefix = $prefix | path expand 16 - log debug $"Install prefix: ($prefix)" 17 - let lib_dir = $prefix | path join "share" "atomic-xr" "lib" 18 - let axr = open ($self | path join 'src' 'axr.nu.in') --raw 19 - | str replace -a "/@AXR_LIB@/" $"use ($lib_dir)/atomic-xr" 20 - let bin = $prefix | path join "bin" "axr" 21 - 22 - if $force { 23 - rm -rf ($lib_dir | path join "atomic-xr") 24 - rm -f $bin 25 - } 26 - 27 - mkdir $lib_dir 28 - cp -r ($self | path join 'src' 'atomic-xr') $lib_dir 29 - if $install_library { 30 - if $force {rm -f ($nu_lib_dir | path join "atomic-xr")} 31 - ln -s ($lib_dir | path join "atomic-xr") $nu_lib_dir 32 - } 33 - 34 - mkdir ($bin | path dirname) 35 - $axr | save $bin 36 - chmod +x $bin 37 - 38 - log info "AtomicXR CLI has been installed, use `axr -l` for a list of commands." 39 - }
-12
install.sh
··· 1 - #!/usr/bin/bash 2 - # SPDX-License-Identifier: AGPL-3.0-only 3 - # Copyright (c) 2025 Shiloh Fen <shiloh@shilohfen.com> 4 - 5 - if ! nu -v $>/dev/null; then 6 - brew install nushell \ 7 - || echo -e "\e[35mFailed to install Nushell using Homebrew. Please install Nushell or Homebrew, then re-run this script.\e[0m" 8 - fi 9 - 10 - if nu -v $>/dev/null; then 11 - nu ./install.nu 12 - fi
src/atomic-xr/_debug.nu cli/atomic-xr/_debug.nu
src/atomic-xr/_migrate.nu cli/atomic-xr/_migrate.nu
src/atomic-xr/bin/oscavmgr-launch.sh cli/atomic-xr/bin/oscavmgr-launch.sh
src/atomic-xr/envision.nu cli/atomic-xr/envision.nu
src/atomic-xr/flatpak.nu cli/atomic-xr/flatpak.nu
src/atomic-xr/homebrew.nu cli/atomic-xr/homebrew.nu
src/atomic-xr/mod.nu cli/atomic-xr/mod.nu
src/atomic-xr/oscavmgr.nu cli/atomic-xr/oscavmgr.nu
src/atomic-xr/patches/envision/0001-Add-build-mode-to-desktop-entry.patch cli/atomic-xr/patches/envision/0001-Add-build-mode-to-desktop-entry.patch
src/atomic-xr/patches/envision/0002-Replace-plugin-manifests.patch cli/atomic-xr/patches/envision/0002-Replace-plugin-manifests.patch
src/atomic-xr/patches/envision/0003-Modify-plugin-download-error-message.patch cli/atomic-xr/patches/envision/0003-Modify-plugin-download-error-message.patch
src/atomic-xr/patches/envision/0004-Add-plugin-to-config-when-enabled.patch cli/atomic-xr/patches/envision/0004-Add-plugin-to-config-when-enabled.patch
src/atomic-xr/runtime.nu cli/atomic-xr/runtime.nu
src/atomic-xr/steamvr-lh.nu cli/atomic-xr/steamvr-lh.nu
src/atomic-xr/wayvr.nu cli/atomic-xr/wayvr.nu
-64
src/axr.nu.in
··· 1 - #!/usr/bin/env nu 2 - # SPDX-License-Identifier: AGPL-3.0-only 3 - # Copyright (c) 2025 Shiloh Fen <shiloh@shilohfen.com> 4 - 5 - use std log 6 - /@AXR_LIB@/ 7 - 8 - def main --wrapped [ 9 - # TODO: --choose (-c) # Interactively choose a function 10 - --help (-h) 11 - --list (-l) # List avaliable commands 12 - --interactive (-i) # Enter interactive shell with the module loaded 13 - ...function 14 - ] { 15 - let function = $function | str join ' ' 16 - if $interactive { 17 - exec nu -e "/@AXR_LIB@/; print $'(ansi yellow)AtomicXR module loaded.(ansi reset)'" 18 - } else if $help or $list or ($function | is-empty) { 19 - print-functions 20 - } else { 21 - # Make sure the function is valid to avoid unhelpful error messages 22 - # This regex checks if $function starts with anything in get-functions 23 - if $function like $"^\(?:(get-functions | str join '|')\)" { 24 - nu -c $"/@AXR_LIB@/; atomic-xr ($function)" 25 - } else { 26 - log error $"Invalid function: `($function)`" 27 - print-functions 28 - } 29 - } 30 - } 31 - 32 - def get-functions [] { 33 - scope modules 34 - | where name == atomic-xr 35 - | get 0.commands.name 36 - } 37 - 38 - def print-functions [] { 39 - get-functions 40 - | where not ($it starts-with "_") 41 - | each {|function| 42 - let help = help atomic-xr $function | lines 43 - 44 - let short_description = $help 45 - | first 46 - | if $in == $"(ansi green)Usage(ansi reset):" { 47 - null 48 - } else { 49 - $in 50 - } 51 - 52 - # let usage = $help 53 - # | get ( 54 - # ($help | enumerate | where item == $"(ansi green)Usage(ansi reset):").0.index + 1 55 - # ) 56 - # | str trim 57 - 58 - { 59 - command: $"(ansi cyan)($function)(ansi reset)" 60 - description: $"(ansi lp)($short_description)(ansi reset)" 61 - } 62 - } 63 - | table --index false --theme rounded 64 - }