So, I just found out about a programme called SynthShell which kind of does the work for you and gives you a nice looking shell, the thing is that this also creates some config files and other stuff in my system, instead of just one .bashrc file to edit. What would be the best way to learn to have a nice looking bash where I can just have a backup of it that I can use throughout systems?
If you are using nixos try home manager. Otherwise Ansible is nice for plopping templates and files into your own home directory
chezmoi.io is one of the best dotfile managers available. Great template language if you need different, many ways to distribute secrets safely, merging works well even with templates, not limited to homedir.
https://github.com/sineemore/backpack
"backpack is a small wrapper around ssh.
It transfers contents of a local file ~/.backpack and itself to remote host, sources it and continues with normal ssh session.
works best as alias ssh=backpack won’t create any files on remote hosts (even temporary) tries to fallback to normal ssh when remote shell is not bash self-replication allows you to use backpack again directly from remote host, in this case backpack will keep original local file as you go deaper from host to host."
I uses Uyuni to push config files out to the machines I’m working on, including .bashrc files, .vimrc and all kinds of little QOL improvements.
Probably overkill just to use Uyuni for that, though.
GitHub?
You can use syncthing. Set it up and forget about it, you’ll have the same dotfiles anywhere. I have it on my phone so that changes are always synced to it if all other computers are offline.
As long as you’re not going to store sensitive data in there, I’ve just been using GitHub. I’ve got a Private Repository setup with my configs (.bashrc as well as WM configs and other dot files) and I just commit/push it up and heave an update script pull it down elsewhere. Then it’s also version controlled.
I think I maybe phrased it horribly, my question was more like, what do I need to learn in order to modify myself the .bashrc by myself instead of using a programme. Does it make sense?
You need to learn bash scripting. Also, there are a few default files that the .bashrc uses which can be helpful to compartmentalize the custom things you do to it so that it’s easier to undo if you screw something up. To do that, just add this to the bottom of your .bashrc
if [ -f ~/.bash_custom ]; then . ~/.bash_custom fi
What that will do is check if the .bash_custom file exists and then run the .bash_custom file in your home directory and apply anything in there. Also, you can call the file whatever you like, but bash does have some defaults that it will check for and run them without editing the .bashrc at all. It’s kind of hard to find a list of the the files that it automatically checks for, but I know that .bash_aliases is one of them, and I think it checks .bash_commands as well, but I’m not entirely sure. Either way, you can force it to check your custom one by using the code above.
Then you can create the file and add any custom things in there that you like. For example, I like to frequently update through the terminal but running
sudo apt update && sudo apt upgrade && sudo apt autoremove && flatpak upgrade
was a bit tedious and I wanted a bit less feedback so I made a custom alias for my personal use.alias update='echo "Updating packages..."; sudo apt update -y &> /dev/null; echo "Packages updated."; echo "Upgrading packages..."; sudo apt upgrade -y &> /dev/null; echo "Packages upgraded."; echo "Cleaning up packges..."; sudo apt autoremove -y &> /dev/null; echo "Packages cleaned up."; echo "Updating flatpaks..."; flatpak update -y &> /dev/null; echo "Flatpaks updated."'
Which hides most of the text from updating and just gives me feedback on what it’s currently doing if I don’t really care to know all of the details. So now I just run
update
in the terminal and plug in my password and it updates and upgrades everything in a human readable way.There’s a lot that can be done with bash scripting, like editing files, iterating over files and directories, setting environment variables. It’s basically a full programming language so the limits are mostly your imagination.
Use chatgpt. Take the first line of your bashrc file and ask it to explain it. Than the second line etc. Won’t be always perfect but for bashrc it shouldn’t be a problem and you can learn a lot from it.
if you want a shell that needs less configuration and has more features, i recommend fish shell.
for bash, you could search for someone else’s bashrc, copy that, and modify until it works how you want it to.