Customizing Shells
Customize Prompt
Section titled “Customize Prompt”You can customize the Bash shell prompt by editing the PS1
variable in ~/.bashrc
. For example, the current shell prompt is the following:
PS1="\e[1;32m┌──[HQ🚀🌐\e[1;31m$(ip -4 addr | grep -v '127.0.0.1' | grep -v 'secondary' | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | sed -z 's/\n/|/g;s/|\$/\n/' | rev | cut -c 2- | rev)🔥\u\e[1;32m]\n└──╼[👾]\[\e[1;36m\]\$(pwd) $ \[\e[0m\]"
The emoji used on PS1
come from Emojipedia. For showing them on terminal, the noto-fonts-emoji
package is needed.
Customize Prompt
Section titled “Customize Prompt”You can customize the Fish shell prompt by editing ~/.config/fish/functions/fish_prompt.fish
. For example, you can start to edit the shell prompt in Athena that is:
function fish_prompt set -l var (tty) switch $var case '*/dev/tty*' set_color 00ff00 echo -n "[HQ:" set_color ff00d7 echo -n "$(ip -4 addr | grep -v '127.0.0.1' | grep -v 'secondary' | grep -oP '(?<=inet\s)\d+(\.\d+){3}' |> echo -n " | $USER" set_color 00ff00 echo "]" set_color 00ff00 echo -n "[>]" set_color 00ffff echo (pwd) '$' (set_color normal) case '*' set_color 00ff00 echo -n "┌──[HQ🚀🌐" set_color ff00d7 echo -n "$(ip -4 addr | grep -v '127.0.0.1' | grep -v 'secondary' | grep -oP '(?<=inet\s)\d+(\.\d+){3}' |> echo -n "🔥$USER" set_color 00ff00 echo "]" set_color 00ff00 echo -n "└──╼[👾]" set_color 00ffff echo (pwd) '$' (set_color normal) end end
After saving the file, the shell will wait for something. Just close it.
For different colors, refer to the ANSI escape code web resouce and pass the mouse over the colors for getting the HEX code, for example:
set_color ff8700 -> Orangeset_color 00ff00 -> Greenset_color 00ffff -> Cyanset_color ff00d7 -> Purpleset_color 123e7c -> Dark Blue
Customize Prompt
Section titled “Customize Prompt”You can customize the Zsh shell prompt by editing the PROMPT
variable in ~/.zshrc
. The Athena OS default shell prompt appears as:
PROMPT="%F{46}┌──[HQ🚀🌐%F{201}$(ip -4 addr | grep -v '127.0.0.1' | grep -v 'secondary' | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | sed -z 's/\n/|/g;s/|\$/\n/' | rev | cut -c 2- | rev)🔥%n%F{46}]"$'\n'"└──╼[👾]%F{44}%~ $%f "
PowerShell
Section titled “PowerShell”Customize Prompt
Section titled “Customize Prompt”You can customize the PowerShell prompt by editing ~/.config/powershell/Microsoft.PowerShell_profile.ps1
and modifying its content:
function prompt(){ $ESC=$([char]27) "$ESC[1;31m┌──L3ts D0 1t $(whoami)💥$ESC[00m$($executionContext.SessionState.Path.CurrentLocation)$("`r`n$ESC[1;34m└──╼Weaponizing PowerShell...🚀>$ESC[00m" * ($nestedPromptLevel + 1)) ";}
Switching Shell
Section titled “Switching Shell”If you have installed more than one shell and you wish to use mainly one, just edit the export SHELL=
line in ~/.bashrc
by adding the name of your favourite shell, for example:
export SHELL=$(which fish)