1
0
Fork
You've already forked viro
0
Loads your environment so you don't have to.
Rust 90%
Shell 10%
2025年12月12日 21:32:49 -05:00
nod/usr/share v1.0.0 2024年01月25日 12:19:59 -05:00
pkg Unforce unwind tables, fix on latest nightly 2025年12月12日 21:32:49 -05:00
src Tentative 3.0.0; remove formatting from binary to make it simpler 2025年11月25日 00:34:22 -05:00
systemd/usr v1.0.0 2024年01月25日 12:19:59 -05:00
.editorconfig v1.0.4 2024年01月25日 12:31:03 -05:00
.gitignore v1.0.0 2024年01月25日 12:19:59 -05:00
Cargo.lock Update dependencies, prepare 2.2.0 2025年11月24日 15:43:13 -05:00
Cargo.toml Update dependencies, prepare 2.2.0 2025年11月24日 15:43:13 -05:00
CHANGELOG.md Tentative 3.0.0; remove formatting from binary to make it simpler 2025年11月25日 00:34:22 -05:00
LICENSE.md v1.0.0 2024年01月25日 12:19:59 -05:00
README.md Rearrange readme 2025年06月09日 14:24:57 -04:00
rustfmt.toml 2.0.0 2025年02月13日 20:36:40 -05:00
viro-profile Fix append_path quotes, add to fish runner 2025年08月14日 04:49:24 -04:00

viro

Loads your environment so you don't have to.

Offers a data structure for serializing and deserializing environment variables, to allow for easy loading of /etc/profile scripts in non-POSIX shells like fish. The viro binary is only available for unix-based systems at the moment; see the "Roadmap" section of this README for details.

Installation

First, build viro for your system and install it in /usr/bin, alongside the viro-profile script.

Depending on whether you want to use systemd or no d, merge the /usr provided in either systemd/usr or nod/usr with your own. If you use Arch Linux, a version of the systemd files is offered as a PKGBUILD in the pkg directory.

Usage

Because bash does not have a standardized config directory, you will need to source the scripts in /usr/share/bash/bashrc.d in order to make this work. If you chose to use systemd, you must also enable the profile.service for your user.

Roadmap

The viro crate has been fully ported to using OsStrings instead of byte sequences, meaning that it in theory should be portable to Windows. However, after doing this, I decided that I'm not going to simp for Microsoft, and did not actually implement a Windows version.

The main issue is that it should be outputting "wide character" strings in all cases on Windows, but Rust specifically takes steps to ensure that stdio transforms UTF-8 output into what Windows expects, and doesn't actually convert all WTF-8 OsStrings into wide characters. So, special code would have to be written using the Windows API to properly account for this.

Additionally, there are currently no attempts to escape \x3D (equals sign) and \x00 (NUL) bytes when outputting variables, and this simply alters the output. A future version of this crate will want to offer these, but I have no plans to implement this at the moment.

License

Available via the Anti-Capitalist Software License for individuals, non-profit organisations, and worker-owned businesses.