• Re: [gentoo-user] bashrc and setting PS1 variable heads up.

    From Wols Lists@21:1/5 to Dale on Fri Jun 28 09:50:01 2024
    On 28/06/2024 08:32, Dale wrote:
    Also, some software can add files to the bashrc.d directory too.  I'm
    not sure what added the gentoo-color file but I also found a file for
    kitty that I installed recently.  If I remove kitty, it removes the file too.  From what I've read, this is why it is changing to a directory.
    It gives software a place to change these settings and be removed if the software is removed.

    The other BIGGY here, is that by separating out all the little changes
    for eg kitty, your personal preferrences, etc etc into little files on
    their own rather than one big monolith, you don't suddenly get
    etc-update or whatever moaning "/etc/bashrc has changed, do you want the
    old one, new one, or merge changes".

    I've still got my original /etc/postfix.cf file because it's been so
    mangled with local changes I daren't touch it ...

    I think systemd is the big driver here - it was a design aim of systemd
    to put default configuration in one place, local system over-rides in a
    second, and user over-rides in a third. I'm sure other software beat
    systemd to it, but systemd said "you *WILL* do this", and once they
    enforced it, everybody started doing it. Makes sense ...

    Cheers,
    Wol

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Peter Humphrey@21:1/5 to All on Fri Jun 28 17:00:01 2024
    On Friday, 28 June 2024 08:32:44 BST Dale wrote:

    I did a major upgrade and found out I had a lot of config files to
    update. I performed those updates, while losing some of my settings.
    Anyway, I figured out how to set the alias variables. Simple enough.
    Create a file and list them in the file. The PS1 is different because
    it usually determines if a user is root or not and gives a different
    prompt. That requires a little bit of scripting, which most know is a
    huge weak point for me.

    I thought the proper place to define aliases was in /etc/profile.d/ profile_aliases.sh. That's where I have mine, anyway.

    PS1 is set in /etc/bash/bashrc.d/10-gentoo-color.bash, as you say. I change
    the prompt colours in there, in the case of the little rescue system I have on each machine. That's so that I can see which system I'm logged-on to (I maintain the rescue system by chrooting into it from the main system, and it's far too easy to make mistakes without that precaution).

    --
    Regards,
    Peter.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)