diff --git a/README.md b/README.md index 06633d0..af495ed 100644 --- a/README.md +++ b/README.md @@ -10,4 +10,4 @@ bash -c "$(curl -fsSL https://raw.githubusercontent.com/galoz11/proxy/refs/heads example: bash -c "$(curl -fsSL https://raw.githubusercontent.com/galoz11/proxy/refs/heads/main/code_server.sh)" -bash -c "$(curl -fsSL https://raw.githubusercontent.com/galoz11/proxy/refs/heads/main/docker_portainer.sh)" +bash -c "$(curl -fsSL https://git.galoz.site/galoz/proxy/raw/branch/main/set_ps1.sh)" diff --git a/set_ps1.sh b/set_ps1.sh new file mode 100644 index 0000000..89b8a0a --- /dev/null +++ b/set_ps1.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Define the new PS1 string +# Example: [User@Host CurrentDir]$ +# This example uses colors: green for user@host, blue for directory. +# \u: username +# \h: hostname (short) +# \w: current working directory (basename only) +# \$: # if root, $ otherwise +NEW_PS1='\[\e[1m\]\[\e[90m\]0\[\e[0;32m\]\u@\[\e[36m\]\h\[\e[90m\]:\[\e[33m\]\w\[\e[90m\]$ \[\e[m\]' + +# The line to be added to .bashrc +PS1_LINE="PS1='${NEW_PS1}'" + +# Check if the line already exists in .bashrc to prevent duplicates +if grep -qE "^PS1=" ~/.bashrc; then + echo "PS1 setting already exists in ~/.bashrc. No changes made." +else + # Append the PS1 line to .bashrc + echo -e "\n" >> ~/.bashrc # Ensure there's a newline before adding + echo "${PS1_LINE}" >> ~/.bashrc + echo "PS1 setting has been added to ~/.bashrc." + echo "Please open a new terminal or run 'source ~/.bashrc' for changes to take effect." +fi