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.

Improve Envision plugin integration

+114 -89
+84
src/atomic-xr/generators/envision-plugin.nu
··· 1 + use std log 2 + 3 + # Can't use "generate" because it will cause odd interaction with the `generate` builtin 4 + export def "gen" [ 5 + id: string 6 + name: string 7 + exec_path: path 8 + ...args 9 + --description (-d): string 10 + --author (-a): string 11 + --icon-url (-i): string 12 + --version (-v): string 13 + --full-description (-f): string 14 + --homepage-url (-h): string 15 + --screenshots (-s): list<string> = [] 16 + --dependencies (-p): list<string> = [] # End with . for absolute id 17 + --conflicts (-c): list<string> = [] # End with . for absolute id 18 + --plugins: record # Plugin list to use instead of opening the config file 19 + ]: nothing -> record { 20 + let appid = get-appid $id 21 + 22 + log debug $"Generating Envision plugin: ($id)" 23 + 24 + let description = $description | default $"($name) managed by AtomicXR" 25 + let full_description = $full_description | default $description 26 + let enabled = $plugins 27 + | default ( 28 + open ~/.config/envision/envision.json 29 + | get plugins 30 + ) 31 + | transpose id data 32 + | where id == $appid 33 + | if ($in | length) == 0 { 34 + false 35 + } else { 36 + $in 37 + | get 0.data.enabled 38 + } 39 + 40 + let dependencies = get-appids ...$dependencies 41 + let conflicts = get-appids ...$conflicts 42 + 43 + {$appid: { 44 + plugin: { 45 + appid: $appid 46 + name: $"AtomicXR: ($name)" 47 + author: $author 48 + icon_url: $icon_url 49 + version: $version 50 + short_description: $description 51 + description: $full_description 52 + homepage_url: $homepage_url 53 + screenshots: $screenshots 54 + exec_url: null 55 + exec_path: $exec_path 56 + args: $args 57 + env_args: null 58 + dependencies: $dependencies 59 + conflicts: $conflicts 60 + plugin_type: "Executable" 61 + } 62 + enabled: $enabled 63 + }} 64 + } 65 + 66 + # Generate absolute ids from relative 67 + export def "get-appid" [ 68 + id: string 69 + ] { 70 + if $id ends-with "." { 71 + $id | str substring 0..-2 72 + } else { 73 + $"cc.dwagon.atomic-xr.($id)" 74 + } 75 + } 76 + 77 + export def "get-appids" [ 78 + ...ids: string 79 + ] { 80 + $ids 81 + | each {|e| 82 + get-appid $e 83 + } 84 + }
+30 -89
src/atomic-xr/sysconfig.nu
··· 1 + use generators/envision-plugin.nu 2 + 1 3 const envision_config_path = "~/.config/envision/envision.json" | path expand 2 4 3 5 def enable-flatpak-permissions [appid: string] { ··· 66 68 cp -f ~/.config/envision/envision.json ~/.config/envision/envision.json.bak 67 69 let envision_config = open $envision_config_path 68 70 let plugins = $envision_config.plugins 69 - | merge { 70 - "cc.dwagon.atomic-xr.wlx-overlay-s": { 71 - plugin: { 72 - appid: "cc.dwagon.atomic-xr.wlx-overlay-s" 73 - name: "AtomicXR: WlxOverlay-S" 74 - author: null 75 - icon_url: "https://github.com/galister/wlx-overlay-s/raw/main/wlx-overlay-s.svg" 76 - version: null 77 - short_description: "WlxOverlay-S managed by AtomicXR" 78 - description: null 79 - homepage_url: "https://codeberg.org/shiloh/atomic-xr" 80 - screenshots: [ 81 - "https://github.com/galister/wlx-overlay-s/raw/guide/wlx-s.png" 82 - ] 83 - exec_url: null 84 - exec_path: $"($env.HOME)/.local/bin/wlx-overlay-s" 85 - args: ["--openxr"] 86 - env_args: null 87 - dependencies: null 88 - conflicts: null 89 - plugin_type: "Executable" 90 - } 91 - enabled: false 92 - } 93 - "cc.dwagon.atomic-xr.motoc": { 94 - plugin: { 95 - appid: "cc.dwagon.atomic-xr.motoc" 96 - name: "AtomicXR: Motoc" 97 - author: null 98 - icon_url: null 99 - version: null 100 - short_description: "Monado Tracking Origin Calibrator managed by AtomicXR" 101 - description: null 102 - homepage_url: "https://codeberg.org/shiloh/atomic-xr" 103 - screenshots: [] 104 - exec_url: null 105 - exec_path: $"($env.HOME)/.local/bin/motoc" 106 - args: ["continue"] 107 - env_args: null 108 - dependencies: null 109 - conflicts: null 110 - plugin_type: "Executable" 111 - } 112 - enabled: false 113 - } 114 - "cc.dwagon.atomic-xr.oscavmgr.project-babble": { 115 - plugin: { 116 - appid: "cc.dwagon.atomic-xr.oscavmgr.project-babble" 117 - name: "AtomicXR: oscavmgr (Project Babble)" 118 - author: null 119 - icon_url: null 120 - version: null 121 - short_description: "OSC Avatar Manager (Project Babble) managed by AtomicXR" 122 - description: null 123 - homepage_url: "https://codeberg.org/shiloh/atomic-xr" 124 - screenshots: [] 125 - exec_url: null 126 - exec_path: $"($env.HOME)/.local/bin/oscavmgr-launch" 127 - args: ["babble"] 128 - env_args: null 129 - dependencies: null 130 - conflicts: null 131 - plugin_type: "Executable" 132 - } 133 - enabled: false 134 - } 135 - "cc.dwagon.atomic-xr.oscavmgr.wivrn": { 136 - plugin: { 137 - appid: "cc.dwagon.atomic-xr.oscavmgr.wivrn" 138 - name: "AtomicXR: oscavmgr (WiVRn)" 139 - author: null 140 - icon_url: null 141 - version: null 142 - short_description: "OSC Avatar Manager (WiVRn) managed by AtomicXR" 143 - description: null 144 - homepage_url: "https://codeberg.org/shiloh/atomic-xr" 145 - screenshots: [] 146 - exec_url: null 147 - exec_path: $"($env.HOME)/.local/bin/oscavmgr-launch" 148 - args: ["wivrn"] 149 - env_args: null 150 - dependencies: null 151 - conflicts: null 152 - plugin_type: "Executable" 153 - } 154 - enabled: false 155 - } 156 - } 71 + | merge ( 72 + envision-plugin gen wlx-overlay-s "WlxOverlay-S" ~/.local/bin/wlx-overlay-s "--openxr" 73 + --plugins $envision_config.plugins 74 + --screenshots ["https://github.com/galister/wlx-overlay-s/raw/guide/wlx-s.png"] 75 + --icon-url "https://github.com/galister/wlx-overlay-s/raw/main/wlx-overlay-s.svg" 76 + --homepage-url "https://github.com/galister/wlx-overlay-s" 77 + ) 78 + | merge ( 79 + envision-plugin gen motoc "Motoc" ~/.local/bin/motoc continue 80 + --plugins $envision_config.plugins 81 + --homepage-url "https://github.com/galister/motoc" 82 + --description "Monado Tracking Origin Calibrator managed by AtomicXR" 83 + ) 84 + | merge ( 85 + envision-plugin gen oscavmgr.project-babble "oscavmgr (Project Babble)" ~/.local/bin/oscavmgr-launch babble 86 + --plugins $envision_config.plugins 87 + --homepage-url "https://github.com/galister/oscavmgr" 88 + --description "OSC Avatar Manager (Project Babble) managed by AtomicXR" 89 + --conflicts ["oscavmgr.wivrn"] 90 + ) 91 + | merge ( 92 + envision-plugin gen oscavmgr.wivrn "oscavmgr (WiVRn)" ~/.local/bin/oscavmgr-launch wivrn 93 + --plugins $envision_config.plugins 94 + --homepage-url "https://github.com/galister/oscavmgr" 95 + --description "OSC Avatar Manager (WiVRn) managed by AtomicXR" 96 + --conflicts ["oscavmgr.project-babble"] 97 + ) 157 98 158 99 $envision_config 159 100 | merge {plugins: $plugins} ··· 164 105 cp -f ~/.config/envision/envision.json ~/.config/envision/envision.json.bak 165 106 let envision_config = open $envision_config_path 166 107 let plugins = $envision_config.plugins 167 - | reject -i "cc.dwagon.atomic-xr.wlx-overlay-s" "cc.dwagon.atomic-xr.motoc" "cc.dwagon.atomic-xr.oscavmgr.project-babble" "cc.dwagon.atomic-xr.oscavmgr.wivrn" 108 + | reject -i ...(get-appids "wlx-overlay-s" "motoc" "oscavmgr.project-babble" "oscavmgr.wivrn") 168 109 169 110 $envision_config 170 111 | merge {plugins: $plugins}