Logo signature de Bréval Le Floch

How to oxide your shell / use Rust in your shell ?

How to oxide your shell / use Rust in your shell ?
By

#Rust#Shell#Linux

Similar Articles
    Not available for now

How to Oxidize Your Shell: Embracing Rust in Your Linux Environment

Are you ready to take your Linux shell to the next level with the speed and safety of Rust?

Today I will show you some tools I use everyday in my environement to make my life easier. Here are some of the best Rust tools. From system utilities to development tools, we're about to make our entire userspace a Rustacean's paradise.

Transform Your Shell

Essential Rust Tools for Every Shell ✨

The most popular Rust shell out there is Nushell witch is bases on pipelines controls. Nushell introduces structured data to the command line, changing how we interact with our system.

Pasted image 20240308163510.png

Personally I prefere to use the Fish shell

You can throw ls at the bin and replace it with lsd, a rust fork of exa. It's a more powerfull directory listing with beatifull formating for the output.

Pasted image 20240308163725.png

As you can see, there is even a "gimick" where the last edited files have a greener date.

If you like to use a multiplexer like Tmux, you can try Zellij. Zellij is a multiplexer compatible with every shell or terminal. V4g1uw1Uku6lYIndT1cqZ6caFW-nIhP9Ettdo3hS394.webp Zellij have temux controle compatibility so you wont be lost, but it also have it's own keybinding.

If you love to have a custom prompt for a maximum of linux style points, you can use Starship . demo.webm Thanks to Starship, and it's extensive customizable config, you can alsmost achieve any style you want, and there is already a lot's of pre-made theme available. All thoses pretty line powered with Rust !

Maybe you like to print out some file in your terminal, then you must have used cat ! Then, i have a new tool you, here is bat ! It's like cat, but with the speed of Rust and a lot of syntax highlighting. 68747470733a2f2f696d6775722e636f6d2f724773646e44652e706e67.png

My personal shell setup ⚙️

Form my terminal application, I use wezterm also build with Rust. It have true colors and GPU accelerations. With it, I use a nerd-font to be able to have customs icons.

Then I personally love fish as my shell, it feel more intuitive to me and offers a lots of cool features. I added some cool plugins to it with the fisherplugins manager, like z

z tracks the directories you visit. With a combination of frequency and recency, it enables you to jump to the directory in mind. **For instance, instead of cd /var/log/apache, you can simply use z apache! **

For my multiplexer, i use tmux with some plugins with tpm like catppuccin for the theme.

for the style of my prompts I use startship with Tokyo Night preset. ✨

Pasted image 20240308202753.png

To finish, I use some tools like :

  • lds -> a Rust alternative to ls
  • lazygit -> a Go utility to use git with a visual interface in cli
  • lazydocker -> a Go utility to use docker with a visual interface in cli
  • neovim -> a better vim, I use the LazyVim setup

Beyond the Shell: A Rust Ecosystem Awaits

Development Tools

From gitui for managing large repos to iRust for interactive Rust sessions, Rust has a tool for every developer's need. Bob-nvim and evcxr_jupyter are just the tips of the iceberg for coding efficiency.

Before diving into the plethora of tools, let's boost our Rust tool compilation speed with sccache. This little trick re-uses compiled artifacts, reducing your wait time significantly.

cargo install sccache
RUSTC_WRAPPER=sccache cargo install {package}

Applications for Fun and Productivity

With tools like ncspot for Spotify control and porsmo for Pomodoro timing, Rust not only improves our development workflow but also our daily computing enjoyment.

Conclusion

Rust is not just for system programming; it's for turning your entire Linux environment into a fast, safe, and enjoyable space.

Check out this nice youtube video from No Boilerplate to learn more about some of theses tools. Watch the Video

I also give you my dotfiles if you are curious and you want to start your Rust journey. My Dotfiles

What's next? Perhaps a Rust-based editor, web browser, or even a Mastodon client. The Rust ecosystem is ever-growing, and I can't wait to see what tools we'll be able to cargo install in the future. Stay tuned, and let's oxidize our digital life together!