bashrc: add support for Manjaro-ARM + change rule for keeping second part of hostname

This commit is contained in:
Alexandre CATTEAU 2022-03-11 15:54:31 +01:00
parent bbb9d98547
commit 15cd72d637

7
bashrc
View File

@ -1,4 +1,3 @@
#!/bin/bash
# ~/.bashrc
# byMasterKTO
@ -58,7 +57,7 @@ fi
if [[ $system == "Linux" ]]; then
case $(lsb_release -si) in
# Arch family: light blue
Arch | ManjaroLinux) COLOR=$C_BOLD$C_ARCH;;
Arch | ManjaroLinux | Manjaro-ARM) COLOR=$C_BOLD$C_ARCH;;
# Debian family: orange
Debian | Ubuntu | Linuxmint | Neon | Raspbian) COLOR=$C_BOLD$C_DEB;;
# RedHat family: blue
@ -90,8 +89,8 @@ if [[ $system == "Linux" ]]; then
fi
# hostname
# if hostname has 4 parts then host=.secondpart
if [[ $(hostname | grep -o "\." | wc -l) -eq 3 ]]; then
# if hostname has 5 parts then host=.secondpart
if [[ $(hostname | grep -o "\." | wc -l) -eq 4 ]]; then
host='.'$(hostname | cut -f 2 -d '.')
fi
hn="$COLOR\h$host$virt$C_RESET"