An open API service indexing awesome lists of open source software.

https://github.com/anki-code/xontrib-rc-awesome

👓 🐚 Make your xonsh RC file installable with awesome snippets of code.
https://github.com/anki-code/xontrib-rc-awesome

List: xontrib-rc-awesome

awesome awesome-config awesome-shell awesome-xonsh cli console iterm2 linux mac macos terminal xonsh xonshrc xontrib

Last synced: 3 months ago
JSON representation

👓 🐚 Make your xonsh RC file installable with awesome snippets of code.

Awesome Lists containing this project

README

        


Awesome snippets of code for xonshrc in xonsh shell.


If you like the idea click ⭐ on the repo and tweet.

### First of all

Learn about xonsh run control (RC) files in official docs - [Run Control File](https://xon.sh/xonshrc.html). You should know about what RC files are used in interactive and non-interactive sessions.

### Use cases

#### Create your own pip-installable RC based on the awesome xonsh RC

1. Fork this repository
2. Rename the repository to `xontrib-rc-yourname`
3. Change the name [in setup.py](https://github.com/anki-code/xontrib-rc-awesome/blob/e21370c1155262b8e25bd354cb4d4f9f15945384/setup.py#L11)
4. Change the name of `xontrib/rc_awesome.xsh` to `xontrib/rc_yourname.xsh`
5. [Add xontribs you need to setup.py](https://github.com/anki-code/xontrib-rc-awesome/blob/495dce4c8e7e8c9882ea002db60935d03f3fb861/setup.py#L20-L38) (the xontribs will be installed automatically during `pip install`)
6. Now you can just run anywhere:
```xonsh
pip install -U git+https://github.com/yourname/xontrib-rc-yourname

# Only for interactive mode:
# (You can also create autoloadable xontrib using xontrib-template.)
echo 'xontrib load rc_yourname' >> ~/.xonshrc

# For interactive or non-interactive (https://xon.sh/xonshrc.html):
# mkdir -p ~/.config/xonsh/rc.d/
# echo 'xontrib load rc_yourname' > ~/.config/xonsh/rc.d/rc_yourname.xsh

xonsh
```
Also you can avoid manual loading the xontrib in `~/.xonshrc` by creating autoloadable xontrib using [xontrib-template](https://github.com/xonsh/xontrib-template). Answer yes on the question about enabling autoloading.

7. [Increment version](https://github.com/anki-code/xontrib-rc-awesome/blob/df5c0aa3e29325f5d926cec7022cd2ccc184c0c5/setup.py#L12) to update the package using `pip install -U git+https://github.com/yourname/xontrib-rc-yourname`

8. Take a look into [xonsh-awesome-cli-app](https://github.com/anki-code/xonsh-awesome-cli-app) if you want to create your own toolset.

#### Copy and paste

Just read [rc_awesome](https://github.com/anki-code/xontrib-rc-awesome/blob/main/xontrib/rc_awesome.xsh) and copy the snippets to your xonsh RC.

Or add awesome xonsh RC to the end of your [xonshrc](https://xon.sh/xonshrc.html):
```
curl -s https://raw.githubusercontent.com/anki-code/xontrib-rc-awesome/main/xontrib/rc_awesome.xsh >> ~/.xonshrc
```

Or install awesome [xonsh RC as a package](https://github.com/anki-code/xontrib-rc-awesome/blob/fabe895fbdd89f7bd3050bf492aa0665624a9705/setup.py#L10-L16) with [automatically installable xontribs](https://github.com/anki-code/xontrib-rc-awesome/blob/fabe895fbdd89f7bd3050bf492aa0665624a9705/setup.py#L20-L30):
```xonsh
pip install -U git+https://github.com/anki-code/xontrib-rc-awesome
echo 'xontrib load rc_awesome' >> ~/.xonshrc
xonsh
```

#### Learn from xonsh RC gurus

* [Anthony Scopatz RC](https://github.com/xonsh/xonsh/pull/3917#issuecomment-715649009) (click Details to see the xonshrc)
* [Sean Farley RC](https://github.com/seanfarley/dotfiles/blob/c87811f50cd696a8d4ddce83c1ca295a00b70218/xonshrc)
* [Gyuri Horak RC](https://github.com/dyuri/rcfiles/blob/master/.xonshrc)
* [Alexander Sosedkin RC](https://github.com/t184256/nix-configs/tree/main/user/xonsh/config)
* [Noorhteen Raja NJ RC](https://github.com/jnoortheen/xonfig)
* [Ryan Delaney RC](https://github.com/rpdelaney/dotfiles/tree/main/home/.config/xonsh)

### See also
* [xonsh-cheatsheet](https://github.com/anki-code/xonsh-cheatsheet/blob/main/README.md) - cheat sheet for xonsh shell with copy-pastable examples.
* [xontrib-template](https://github.com/xonsh/xontrib-template) - Full-featured template for building extension (xontrib) for the xonsh shell.