Tontonjo / proxmox_toolbox

A toolbox to get the firsts configurations of Proxmox VE / BS done in no time
https://www.youtube.com/c/tontonjo
GNU General Public License v3.0
271 stars 40 forks source link

[FEATURE SUGGESTION] Bash Terminal Colours #6

Closed BadCo-NZ closed 2 years ago

BadCo-NZ commented 2 years ago

Hi, I recently setup a second node and came across a few things that might be useful to add to the Toolbox

First up, is terminal colours! I'm not a fan of how stock Debian keeps everything the same, but I am a fan of how Turnkey Linux has theirs setup.

This can be done by editing bash.rc

nano /etc/bash.bashrc

Before: From Line 18

# set a fancy prompt (non-color, overwrite the one in /etc/profile)
# but only if not SUDOing and have SUDO_PS1 set; then assume smart user.
if ! [ -n "${SUDO_USER}" -a -n "${SUDO_PS1}" ]; then
  PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi

After:

# set a fancy prompt (non-color, overwrite the one in /etc/profile)
# but only if not SUDOing and have SUDO_PS1 set; then assume smart user.
if ! [ -n "${SUDO_USER}" -a -n "${SUDO_PS1}" ]; then
    eval "`dircolors -b`"
    alias ls='ls --color=auto'
    alias ll='ls --color=auto -alF'
    alias la='ls --color=auto -A'
    alias l='ls --color=auto -CF'
    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'

    # Set a terminal prompt style (default is fancy color prompt)
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;33m\]\u@\h \[\033[01;34m\]\w\[\033[00m\]\$ '
else
    alias ls="ls -F"
    alias ll='ls -alF'
    alias la='ls -A'
    alias l='ls -CF'
    PS1='${debian_chroot:+($debian_chroot)}\u@\h \w\$ '
fi
Tontonjo commented 2 years ago

Hi!

Thanks for your suggestions. I'm not sure this could be a very usfull add as this is more globally related to any terminal connexions and i'm feeling it would just lead to add complexit where there are already enough. I'd like to keep this script the more "proxmox features" related as possible

that said, On my side, i have no needs for such things as my software already does a coloring job aswell.

This may take place in a more "general debian configurations" tool.

i may leave this open if there are other ppl interested or other arguments, i may reconsider my point

BadCo-NZ commented 2 years ago

Hi @Tontonjo, you make some good points, yes it isn't Proxmox specific but more underlying OS (Debian) specific, I still think it would be useful though :)

What terminal emulator are you using that does bash colouring well?

Any stock ones I have tried (Gnome Terminal and Manjaro KDE Konsole) just colour either everything (Konsole) or just the prompt.

Tontonjo commented 2 years ago

I'm using Moba Xterm on Windows. Again, i dont think i want this kind of features atm. May think about another tool.

Tontonjo commented 2 years ago

Not enough Proxmox related to me at the moment.