Update Linux/Neofetch/README.md

This commit is contained in:
2025-01-05 08:41:31 +00:00
parent ef88adf548
commit c77bfd6442

View File

@@ -1,113 +1,178 @@
# Description # Description
Neofetch is a tool to display system information inside the shell with an ASCII-Logo of the given Linux Distribution. Neofetch is a tool to display system information inside the shell with an ASCII-Logo of the given Linux Distribution.
Example Output: Example Output:
![Neofetch](screenshot.png) ![Neofetch](screenshot.png)
--- ---
# Installation of Neofetch # Installation of Neofetch
You can install Neofetch by copying the following code snippets to any of the given Linux Distributions. You can install Neofetch by copying the following code snippets to any of the given Linux Distributions.
* [Alpine Linux](README.md#alpinelinux) * [Alpine Linux](README.md#alpinelinux)
* [Debian / Ubuntu](README.md#debian--ubuntu) * [Debian / Ubuntu](README.md#debian--ubuntu)
* [AlmaLinux / RockyLinux](README.md#almalinux--rockylinux) * [AlmaLinux / RockyLinux](README.md#almalinux--rockylinux)
* [Arch Linux](README.md#archlinux) * [Arch Linux](README.md#archlinux)
## Code Snippets ## Code Snippets
Click the little squares at the top right of the code window to quick and easy copy the code. Paste the code into your shell and thats it. Click the little squares at the top right of the code window to quick and easy copy the code. Paste the code into your shell and thats it.
### AlpineLinux ### AlpineLinux
```sh ```sh
# Update Packages # Update Packages
apk update apk update
# Install Neofetch # Install Neofetch
apk add neofetch apk add neofetch
# Create new message of the day file # Create new message of the day file
tee /etc/profile.d/motd.sh <<EOF tee /etc/profile.d/motd.sh <<EOF
#!/bin/bash #!/bin/bash
printf "\n" printf "\n"
neofetch neofetch
EOF EOF
# Make it executable # Make it executable
chmod +x /etc/profile.d/motd.sh chmod +x /etc/profile.d/motd.sh
# Get rid of default Message Of The Day # Get rid of default Message Of The Day
echo "" > /etc/motd echo "" > /etc/motd
``` ```
### Debian / Ubuntu ### Debian / Ubuntu
```bash ```bash
# Update Packages # Update Packages
sudo apt update sudo apt update
# Install Neofetch # Install Neofetch
sudo apt install -y neofetch sudo apt install -y neofetch
# Create new message of the day file # Create new message of the day file
tee /etc/profile.d/motd.sh <<EOF tee /etc/profile.d/motd.sh <<EOF
#!/bin/bash #!/bin/bash
printf "\n" printf "\n"
neofetch neofetch
EOF EOF
# Make it executable # Make it executable
sudo chmod +x /etc/profile.d/motd.sh sudo chmod +x /etc/profile.d/motd.sh
# Get rid of default Message Of The Day # Get rid of default Message Of The Day
echo "" > /etc/motd echo "" > /etc/motd
```
### AlmaLinux / RockyLinux ```
```bash
# Update Packages ### AlmaLinux / RockyLinux
sudo dnf update -y ```bash
# Update Packages
# Install EPEL-Release sudo dnf update -y
sudo dnf install -y epel-release
# Install EPEL-Release
# Update EPEL-Release sudo dnf install -y epel-release
sudo dnf clean all && dnf update -y
# Update EPEL-Release
# Install Neofetch sudo dnf clean all && dnf update -y
sudo dnf install -y neofetch
# Install Neofetch
# Create new message of the day file sudo dnf install -y neofetch
tee /etc/profile.d/motd.sh <<EOF
#!/bin/bash # Create new message of the day file
printf "\n" tee /etc/profile.d/motd.sh <<EOF
neofetch #!/bin/bash
EOF printf "\n"
neofetch
# Make it executable EOF
chmod +x /etc/profile.d/motd.sh
``` # Make it executable
chmod +x /etc/profile.d/motd.sh
### ArchLinux
```bash # Zielbenutzer (aktueller Benutzer standardmäßig)
# Update Packages TARGET_USER=${1:-$USER}
sudo pacman -Syu TARGET_HOME=$(eval echo ~$TARGET_USER)
# Install Neofetch # Überprüfen, ob sudo installiert ist
sudo pacman -S neofetch -noconfirm if ! command -v sudo &> /dev/null; then
echo "sudo ist nicht installiert. Installiere sudo..."
# Create new message of the day file SUDO_INSTALLED=false
tee /etc/profile.d/motd.sh <<EOF if [ -f /etc/debian_version ]; then
#!/bin/bash apt update && apt install -y sudo
printf "\n" elif [ -f /etc/redhat-release ]; then
neofetch yum install -y sudo
EOF else
echo "Nicht unterstütztes Linux-System. Bitte sudo manuell installieren."
# Make it executable exit 1
sudo chmod +x /etc/profile.d/motd.sh fi
else
# Get rid of default Message Of The Day echo "sudo ist bereits installiert."
echo "" > /etc/motd SUDO_INSTALLED=true
fi
# Passe Bash-Prompt und Farben an
echo "Passe Bash-Prompt und Farben für Benutzer $TARGET_USER an..."
sudo tee -a $TARGET_HOME/.bashrc > /dev/null <<'EOL'
# Farbiges Bash-Prompt mit grauem Hostname und gelbem @
if [ "$EUID" -eq 0 ]; then
# Root-Prompt: Benutzer rot, @ gelb, Hostname dunkelgrau, Verzeichnis gelb
PS1='\[\e[1;31m\]\u\[\e[0;33m\]@\[\e[1;30m\]\h \[\e[1;33m\]\w\[\e[0m\] # '
else
# Normaler Benutzer: Benutzer grün, @ gelb, Hostname dunkelgrau, Verzeichnis blau
PS1='\[\e[1;32m\]\u\[\e[0;33m\]@\[\e[1;30m\]\h \[\e[1;34m\]\w\[\e[0m\] \$ '
fi
# Farbiges ls und grep
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
EOL
# Rechte anpassen und Änderungen aktivieren
sudo chown $TARGET_USER:$TARGET_USER $TARGET_HOME/.bashrc
sudo chmod 644 $TARGET_HOME/.bashrc
# Änderungen für aktuelle Sitzung aktivieren
sudo -u $TARGET_USER source $TARGET_HOME/.bashrc
echo "Farbanpassung abgeschlossen! Starte ein neues Terminal oder lade die .bashrc neu mit:"
echo "source ~/.bashrc"
# sudo deinstallieren, falls es vorher nicht installiert war
if [ "$SUDO_INSTALLED" = false ]; then
echo "Deinstalliere sudo..."
if [ -f /etc/debian_version ]; then
apt remove -y sudo
elif [ -f /etc/redhat-release ]; then
yum remove -y sudo
fi
echo "sudo wurde entfernt."
fi
```
### ArchLinux
```bash
# Update Packages
sudo pacman -Syu
# Install Neofetch
sudo pacman -S neofetch -noconfirm
# Create new message of the day file
tee /etc/profile.d/motd.sh <<EOF
#!/bin/bash
printf "\n"
neofetch
EOF
# Make it executable
sudo chmod +x /etc/profile.d/motd.sh
# Get rid of default Message Of The Day
echo "" > /etc/motd
``` ```