superatomic/xshe

Xshe – Cross-Shell Environment Vars

Create a file like this once and use it everywhere, for every shell!

Xshe – Cross-Shell Environment Vars

Xshe allows for setting Shell Environment Variables across multiple shells with a single TOML configuration file.

Instead of writing multiple similar files for each shell you use, you can instead create one file and use it for every shell with xshe!

All you have to do is add a single line to all of your shells' startup scripts, and xshe will set your environment variable across all of them.

To use xshe, you write lines in a xshe.toml file like this (in TOML format):

Create a file like this once and use it everywhere, for every shell! xshe can convert this into the format for every supported shell.

Usage and Documentation

View Xshe's documentation online at xshe.superatomic.dev or read the offline documentation in the docs/ directory.

Quick install

  • With Cargo →
  • With Homebrew →
  • With Eget →
  • As a File Download →
  • Build from Source →

License

Licensed under either of

  • Apache License, Version 2.0 (LICENSE-APACHE or www.apache.org/licenses/LICENSE-2.0)
  • MIT license (LICENSE-MIT or opensource.org/licenses/MIT)

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


Issues

Collection of the latest Issues

superatomic

superatomic

bug
Comment Icon0

The autocompletion which was added in #50 is not the most optimal and does not perfectly reflect the actual accepted arguments and options that xshe accepts.

This issue may be resolved in two ways:

  • Writing dedicated autocompletion scripts for each shell instead of generating them with clap_complete
  • Improve clap_complete to better reflect the actual expected arguments
superatomic

superatomic

enhancement
Comment Icon0

The environment variable $XSHE_FILE should be able to set where xshe checks for its configuration file if none of the flags -p, -t, or -f are set.

Right now, the program checks locations in this order:

  • $XDG_CONFIG_HOME/xshe.toml, if $XDG_CONFIG_HOME is set.
  • ~/.config/xshe.toml.

The desired behavior is add the following check before the other 2:

  • $XSHE_FILE, if $XSHE_FILE is set.
superatomic

superatomic

refactor
Comment Icon0

This is a general issue. Do not close this until all code that should be tested is fully tested.

Over the releases leading up to version 1.0.0, test cases should be added. The end goal is to have tests for 100% of all cases.

New pull requests that introduce features should also introduce tests for those features. Code that has already been added should have separate tests added specifically for them.

Tracking:

  • #65
  • #63
superatomic

superatomic

enhancement
Comment Icon0

Add support for the Dash shell.

dash uses the same form for environment variables as bash and zsh.

superatomic

superatomic

enhancement
Comment Icon0

Add support for the Elvish shell: https://elv.sh/

It looks like setting environment variables takes the form of:

Where NAME and VALUE are substituted. Note that we do not use double quotes here– Elvish will not word split and will also not expand variables inside of quotes.

superatomic

superatomic

enhancement
Comment Icon2

The [once] table should be a table that only runs if it hasn't setup any of its environment variables yet. It will do this by adding a environment variable __xshe_NAME, where NAME is the name of each environment variable.

For example, to set PATH without having it keep being modified every time xshe.toml gets sourced, this can be done:

This will set these two environment variables if there is not a environment variable named $__xshe_PATH set to 1: $PATH to the expected value, and $__xshe_PATH to 1.

Additionally, specific tables [shell.SHELL.once] (where SHELL is any of the supported shells) should be created that work like shell.SHELL but only run if the given shell is being used.

Versions

Find the latest versions by id

v0.5.1 - Jun 29, 2022

This release is a bug-fix update for release v0.5.0. To see what was added in release v0.5.0, check out its release page.

What's Changed

Full Changelog: https://github.com/superatomic/xshe/compare/v0.5.0...v0.5.1

Dependency Version Bumps

How to Upgrade Xshe

Simply reinstall xshe from any of the methods listed on the documentation page. For your convenience, some of these methods are listed below:

Via Cargo

Via Homebrew

Via Eget

v0.5.0 - Jun 20, 2022

Wow, it's finally here. Version v0.5.0 has been in development for quite some time now, but it's finally ready to be released. We passed 100 issues/pull-requests on GitHub and 300 git commits during this release's development, and quite a few features, improvement, and bug fixes have been implemented. :tada:

What's Changed

Minor Changes

Full Changelog: https://github.com/superatomic/xshe/compare/v0.4.2...v0.5.0


Dependency Version Bumps

How to Upgrade Xshe

Simply reinstall xshe from any of the methods listed on the documentation page. For your convenience, some of these methods are listed below:

Via Cargo

Via Homebrew

Via Eget

v0.4.2 - Apr 20, 2022

What's Changed

Full Changelog: https://github.com/superatomic/xshe/compare/v0.4.1...v0.4.2

v0.4.1 - Apr 19, 2022

What's Changed

Minor Changes

Full Changelog: https://github.com/superatomic/xshe/compare/v0.4.0...v0.4.1

v0.4.0 - Apr 15, 2022

What's Changed

Minor Changes

Full Changelog: https://github.com/superatomic/xshe/compare/v0.3.2...v0.4.0

v0.3.2 - Apr 04, 2022

What's Changed

Full Changelog: https://github.com/superatomic/xshe/compare/v0.3.1...v0.3.2

v0.3.1 - Apr 02, 2022

Fixes very minor problems in README.md

Full Changelog: https://github.com/superatomic/xshe/compare/v0.3.0...v0.3.1

v0.3.0 - Apr 02, 2022

What's Changed

Full Changelog: https://github.com/superatomic/xshe/compare/v0.2.2...v0.3.0

v0.2.2 - Apr 01, 2022

What's Changed

These changes cleanup code, add some informational files, add two GitHub Actions, and add one button to the README. As such, this should have no effect on the program function's between v0.2.1 and v0.2.2 (this version).

Specific Changes:

Full Changelog: https://github.com/superatomic/xshe/compare/v0.2.1...v0.2.2

v0.2.1 - Apr 01, 2022

What's Changed

Full Changelog: https://github.com/superatomic/xshe/compare/v0.2.0...v0.2.1

v0.2.0 - Mar 31, 2022

What's Changed

Full Changelog: https://github.com/superatomic/xshe/compare/v0.1.0...v0.2.0

v0.1.0 - Mar 31, 2022

Initial Release

Full Changelog: https://github.com/superatomic/xshe/commits/v0.1.0

Information - Updated Sep 19, 2022

Stars: 5
Forks: 0
Issues: 13

Repositories & Extras

CLI

317

electron-hardener

A Rust library and command line tool to harden Electron binaries against runtime behavior modifications

electron-hardener

This is a Rust command line tool that calculates a histogram of the separate types...

This is a Rust command line tool that calculates a histogram of the separate types of JSON records in an input JSON log file (one...

This is a Rust command line tool that calculates a histogram of the separate types...

cmsis-pack-manager

is a python module, Rust crate and command line utility for managing current device information that is stored in many CMSIS PACKs

cmsis-pack-manager

Find all your notes with one command!

Todo_r is a simple rust command line utility that keeps track of your todo items in code

Find all your notes with one command!

A Rust command line utility tool to connect to the QuanticTelecom captive portal

So far, the only mode supported so far requires providing password and login

A Rust command line utility tool to connect to the QuanticTelecom captive portal

Rust Command Line Experiment

This is just a little learning exercise on how to write a command line application in rust and manipulate the

Rust Command Line Experiment

Rust command-line program to automatically RSVP new Meetup events

I still haven't gotten meetup's API to respond and haven't heard back from Meetup

Rust command-line program to automatically RSVP new Meetup events

The crs command is a Rust version of the Carbon CLI

The crs command is a Rust version of the jq for pretty-printing

The crs command is a Rust version of the Carbon CLI
Facebook Instagram Twitter GitHub Dribbble
Privacy