Closed wheaney closed 3 months ago
We should also be moving the driver's bin and config files to their proper directories. Keep in mind you'd need to update the setup scripts to copy the existing config file if the user already has one.
Also note that the setup scripts call uninstall for the previous version already, so if you just update setup to do install properly going forward, you don't need to clean up the old bin files. Only the config file needs special treatment to be preserved.
We should also update the README docs to reference new bin and config file locations.
~/.xreal_driver_log
should be moved somewhere better as well.
I'm updating all the file locations now soon. Here's my plan:
Just a note: all my recommendations above are based on eventually moving to a user-systemd service (instead of system/root like it is now).
Additional recommendations from a convo on the Discord:
If stuff is reading and writing to the user-directory then the systemd unit should probably be a user-unit in ${XDG_CONFIG_HOME}/systemd/user too. Likewise IPC and lock bits would go into ${XDG_RUNTIME_DIR}/xr_driver Rather than ~/.local/share/xr_driver/logs logs are considered state so would go to ${XDG_STATE_HOME}/xr_driver/logs
We should also move the license file currently located at /var/lib/xr_driver/device_license
.
Also reiterating a point above: we'll want the driver setup script to move some of these files so they're preserved. Specifically the config and log files, but the license could be moved as well (it'll just be re-downloaded to the new location if we don't do this, but if somehow they ran the setup offline, it would be better to proactively move for them so they don't lose functionality if they aren't able to download).
I plan to tackle this soon. Here's the current plan, slightly modified from the last, also incorporating the latest comments and a more comprehensive list including all Breezy stuff.
File type | XDG directory | Fallback | Current location |
---|---|---|---|
Logs & license | *$XDG_STATE_HOME/xr_driver/(logs/|license.json)** | ~/.local/state/xr_driver/(logs/*|license.json) | ~/.xreal_driver_log /var/lib/xr_driver/device_license |
Driver binary & scripts | $XDG_BIN_HOME/xr_driver(_setup|_uninstall|_cli|_verify) | ~/.local/bin/xr_driver(_setup|_uninstall|_cli|_verify) | ~/bin/xrealAirLinuxDriver ~/bin/xrealdriver(config|uninstall) ~/.local/bin/xr_driver/verify_installation |
Driver config | $XDG_CONFIG_HOME/xr_driver/config.ini | ~/.config/xr_driver/config.ini | ~/.xreal_driver_config |
systemd unit | $XDG_CONFIG_HOME/systemd/user/xr-driver.service | ~/.config/systemd/user/xr-driver.service | /etc/systemd/system/xreal-air-driver.service |
Lock file | $XDG_RUNTIME_DIR/xr_driver/lock.pid | /tmp/xr_driver/lock.pid | ~/.xreal_driver_lock |
IMU data IPC | $XDG_RUNTIME_DIR/xr_driver/shaderruntime* | /tmp/xr_driver/shaderruntime* | /tmp/shaderruntime* |
State/control IPC | n/a | n/a | /dev/shm/xrdriver(state|control) unchanged, uses shared memory location |
Driver manifest | $XDG_DATA_HOME/xr_driver/manifest | ~/.local/share/xr_driver/manifest | ~/.local/bin/xr_driver/manifest |
File type | XDG directory | Fallback | Current location |
---|---|---|---|
Breezy scripts | $XDG_BIN_HOME/breezyvulkan(setup|uninstall|verify) | ~/.local/bin/breezyvulkan(setup|uninstall|verify) | ~/bin/breezyvulkan(setup|uninstall) ~/.local/bin/breezy_vulkan/verify_installation |
Breezy manifest | $XDG_DATA_HOME/breezy_vulkan/manifest | ~/.local/share/breezy_vulkan/manifest | ~/.local/bin/breezy_vulkan/manifest |
vkBasalt binaries | n/a | n/a | ~/.local/lib(32) no XDG spec for this one |
vkBasalt & reshade config | $XDG_CONFIG_HOME/(vkBasalt/*|reshade/*) | ~/.config/(vkBasalt/*|reshade/*) | ~/.config/(vkBasalt/*|reshade/*) |
Vulkan implicit layer config | $XDG_DATA_HOME/vulkan/implicit_layer.d/vkBasalt*.json | ~/.local/share/vulkan/implicit_layer.d/vkBasalt*.json | ~/.local/share/vulkan/implicit_layer.d/vkBasalt*.json |
XRLinuxDriver portion almost complete in https://github.com/wheaney/XRLinuxDriver/compare/xdg_reorg
This is mostly done, it's incorporated all the way through Breezy Vulkan build, setup, uninstall. Breezy GNOME and decky plugin still need updates, mainly via changes to the shared XRDriverIPC module.
I've pushed updates to Breezy GNOME and the decky plugin that pull in all the latest XDG reorg changes. The only thing that's left is updated the driver and breezy PKGBUILD files so AUR can build off these changes.
AUR has been updated to accommodate the XDG changes. Finally closing this!
Per the Vulkan Linux Layer Discovery documentation, before the setup script copies our vkBasalt config and lib files to ~/.config and ~/.local, we should be checking whether
$XDG_CONFIG_HOME
or$XDG_DATA_HOME
environment variables are set and use them if they are.