Skip to content

ScubaAnon/my-fastfetch-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

A script which inserts container and VM information into your fastfetch config.jsonc.

This script doesn't generate a fastfetch config.jsonc from scratch though. Instead it ingeniuosly makes use of a temoplate.json file, meaning a normal config.jsonc without these inserted containers is always used as a base, making this script nondestructive as long as you cp (or mv) the config.jsonc to template.json in the fastfetch config directory.

Usage (IMPORTANT: config.jsonc contents needs to go to template.json)

Edit FastfetchConfDir (if nonstandard) and Array_index. Then rename your config.jsonc to template.json. Finally, add two lines in your sudoers file so you don't need to type your password to run the script (guixcontainersinfo.sh and nsenter).

Explanation

However you invoke the script, ensure it's ran with sudo. I have an alias for fastfetch in my bashrc which first executes guixcontainersinfo.sh (with sudo) before running fastfetch (&&), then simply add the fastfetch command to the end of my bash_profile.

The reason template.json is important is because it'll serve as the base for constructing the final config.jsonc. Therefore, anything you have in there will never be destroyed (no guarantee, I hold no liability, etc, etc, yada, yada). Treat it as the true config.jsonc. If you at any point don't need this script anymore, you'll still have your basic config.jsonc stored as template.json.

As for the nsenster, even though you run the script with sudo, you'll still need sudo inside the script in order for nsenter to work with you. Below is a sample entry:

  • user ALL=NOPASSWD: /run/current-system/profile/bin/nsenter ^[0-9]{4,5}$ hostname

About

Simple scripts I use to extend information displayed in fastfetch where its config alone proves insufficient

Resources

Stars

Watchers

Forks

Contributors

Languages