@ShaunaTheDead@kbin.social avatar

ShaunaTheDead

@ShaunaTheDead@kbin.social

Hi, I'm Shauna! I'm a 37 year old transgender woman from Ontario, Canada. I'm also a Linux enthusiast, and a Web Developer by trade. Huge Star Trek fan, huge Soulsborne fan, and all-around huge nerd.

This profile is from a federated server and may be incomplete. Browse more on the original instance.

What's the best way to have a .bashrc that I can use throughout systems?

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...

ShaunaTheDead, (edited )
@ShaunaTheDead@kbin.social avatar

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.

ShaunaTheDead,
@ShaunaTheDead@kbin.social avatar

lol but it's definitely a typo. If you click on the link the actual article says "700 year old".

ShaunaTheDead,
@ShaunaTheDead@kbin.social avatar

Ezarr is a pretty great little project for getting started. Just clone the repo and follow the README and it should just be plug and play.

ShaunaTheDead,
@ShaunaTheDead@kbin.social avatar

Oh god... Imagine the horse bolting after hearing the gunshot and you're falling from your own height plus the height of the horse. I bet a lot of necks were broken from this experiment before they cancelled it.

ShaunaTheDead, (edited )
@ShaunaTheDead@kbin.social avatar

But then why is it available in my command line terminal as a command that I can use? Like when I type do and then hit TAB twice to list commands that match the output is do done dofsck etc... but when I just enter do in the command line or do --help I get bash: syntax error near unexpected token 'do'

I would assume that since I can run sudo apt update that I could also run do apt update where it would run it not as a super user. I know just apt update would do that too, but I'm just so curious if it's possible to use do as a user-level sudo or what else it might be able to do.

ShaunaTheDead, (edited )
@ShaunaTheDead@kbin.social avatar

You can just choose not to use it. They still release everything through their regular repositories for now.

ShaunaTheDead,
@ShaunaTheDead@kbin.social avatar

Depends where you live, I guess. I don't really consider -20 to be dangerous but I live in Canada so I know how to dress for cold weather.

ShaunaTheDead,
@ShaunaTheDead@kbin.social avatar

I'm not sure where you're getting that idea from. Almost anything designed for Windows works flawlessly through WINE or Proton. If I do run into an issue I usually find that Windows users are also having the same problems so it's not a Linux compatibility issue. Every once in awhile I'll have to run winetricks or protontricks to install a dependency. Overall, Linux compatibility is pretty incredible these days, in my opinion.

ShaunaTheDead,
@ShaunaTheDead@kbin.social avatar

We're not enemies as soon as a Windows user walks in. Or... Uuuugh.... A Mac user.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • localhost
  • All magazines
  • Loading…
    Loading the web debug toolbar…
    Attempt #