This commit is contained in:
2025-06-23 15:38:08 +03:00
2 changed files with 24 additions and 1 deletions

View File

@@ -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)"

23
set_ps1.sh Normal file
View File

@@ -0,0 +1,23 @@
#!/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 "${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