Replace tdp check in bashrc in favor of proper bash prompt

This commit is contained in:
Quad 2021-05-21 21:12:47 +02:00
parent 0b715bfd52
commit f207806363
2 changed files with 19 additions and 2 deletions

View File

@ -19,7 +19,6 @@ else
mkdir -p ~/.local mkdir -p ~/.local
git clone https://gitea.quad.moe/quad/win3-resources.git ~/.local/gpd-win3 git clone https://gitea.quad.moe/quad/win3-resources.git ~/.local/gpd-win3
echo -e "\n# GPD Win 3 scripts\nPATH=\"\${PATH}:\${HOME}/.local/gpd-win3/scripts\"" >> ~/.bashrc echo -e "\n# GPD Win 3 scripts\nPATH=\"\${PATH}:\${HOME}/.local/gpd-win3/scripts\"" >> ~/.bashrc
echo "tdp check" >> ~/.bashrc
printf "$(tput setaf 2)-- Install finished. Please open a new terminal to use the scripts --$(tput sgr0)\n" printf "$(tput setaf 2)-- Install finished. Please open a new terminal to use the scripts --$(tput sgr0)\n"
fi fi
``` ```
@ -103,3 +102,16 @@ Example commands:
# Reload touchscreen module # Reload touchscreen module
touch-fix touch-fix
``` ```
## GPD Prompt
This is a customized version of my bash prompt that adds a TDP display after the hostname:
![../img/gpd-prompt.png]
This script collection must be installed for it to work.
To use it, open your `~/.bashrc` file and add the following line:
```
source gpd-prompt
```

5
scripts/gpd-prompt Executable file
View File

@ -0,0 +1,5 @@
function set_gpd_prompt() {
export PS1="\[\e[1;32m\]\h ($(tdp check | cut -d ' ' -f3))\[\e[m\] - \[\e[1;31m\]\u\[\e[m\] - \[\e[1;34m\]\W\[\e[m\] \\$ "
}
PROMPT_COMMAND=set_gpd_prompt