From f207806363b50be0ac70db4c42981265f8d05ff0 Mon Sep 17 00:00:00 2001 From: Quad Date: Fri, 21 May 2021 21:12:47 +0200 Subject: [PATCH] Replace tdp check in bashrc in favor of proper bash prompt --- scripts/README.md | 16 ++++++++++++++-- scripts/gpd-prompt | 5 +++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100755 scripts/gpd-prompt diff --git a/scripts/README.md b/scripts/README.md index a1f7d53..42fc6bb 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -19,7 +19,6 @@ else mkdir -p ~/.local 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 "tdp check" >> ~/.bashrc printf "$(tput setaf 2)-- Install finished. Please open a new terminal to use the scripts --$(tput sgr0)\n" fi ``` @@ -102,4 +101,17 @@ Example commands: ```bash # Reload touchscreen module touch-fix -``` \ No newline at end of file +``` + +## 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 +``` diff --git a/scripts/gpd-prompt b/scripts/gpd-prompt new file mode 100755 index 0000000..cdf030b --- /dev/null +++ b/scripts/gpd-prompt @@ -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