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.

fix error when Envision config file doesn't exist

fixes #18

Shiloh Fen fec1cf37 fe7291fc

+15 -6
+1
src/atomic-xr/common.nu
··· 7 7 8 8 export const data_path: path = "~/.local/share/atomic-xr" | path expand 9 9 export const config_path: path = "~/.config/atomic-xr.toml" | path expand 10 + export const envision_config_path: path = "~/.config/envision/envision.json" | path expand 10 11 11 12 export def container-exec [ 12 13 block: closure
+7 -2
src/atomic-xr/generators/envision-plugin.nu
··· 2 2 # Copyright (c) 2025 Shiloh Fen <shiloh@shilohfen.com> 3 3 4 4 use std log 5 + use ../common.nu * 5 6 6 7 # Can't use "generate" because it will cause odd interaction with the `generate` builtin 7 8 export def "gen" [ ··· 28 29 let full_description = $full_description | default $description 29 30 let enabled = $plugins 30 31 | default ( 31 - open ~/.config/envision/envision.json 32 - | get plugins 32 + try { 33 + open $envision_config_path 34 + | get plugins 35 + } catch { 36 + [] 37 + } 33 38 ) 34 39 | transpose id data 35 40 | where id == $appid
+7 -4
src/atomic-xr/sysconfig.nu
··· 2 2 # Copyright (c) 2025 Shiloh Fen <shiloh@shilohfen.com> 3 3 4 4 use generators/envision-plugin.nu 5 - 6 - const envision_config_path = "~/.config/envision/envision.json" | path expand 5 + use common.nu * 7 6 8 7 def enable-flatpak-permissions [appid: string] { 9 8 flatpak override --user --filesystem="xdg-data/envision:ro" --filesystem="xdg-run/monado_comp_ipc" --filesystem="/var/lib/flatpak/app/io.github.wivrn.wivrn:ro" --filesystem="xdg-run/wivrn" --filesystem="xdg-config/openxr:ro" --filesystem="xdg-config/openvr:ro" $appid ··· 68 67 } 69 68 70 69 export def "enable envision-plugins" [] { 71 - cp -f ~/.config/envision/envision.json ~/.config/envision/envision.json.bak 70 + if ($envision_config_path | path exists) { 71 + cp -f $envision_config_path $"($envision_config_path).bak" 72 + } 72 73 let envision_config = try {open $envision_config_path} catch { 73 74 # TODO: Create default config file instead 74 75 log warning "You'll need to open Envision at least once before plugins can be registered." ··· 109 110 } 110 111 111 112 export def "disable envision-plugins" [] { 112 - cp -f ~/.config/envision/envision.json ~/.config/envision/envision.json.bak 113 + if ($envision_config_path | path exists) { 114 + cp -f $envision_config_path $"($envision_config_path).bak" 115 + } 113 116 let envision_config = try {open $envision_config_path} catch { 114 117 log debug "Could not open Envision config, not attempting to remove plugins." 115 118 return