I'm using an CLI Arch Linux and I want to run an Shell/Bash Script to show the status of my Battery with acpi directly on the String Prompt(PS1).
I create the following Shell Script to Show me the Battery Status:
# Permition Acess: chmod +x loop.sh
# run .sh: ./loop.sh
i=true
#COLOR:
ORANGE='\e[33m'
STOP='\e[0m'
while ($i = true)
do
printf ${ORANGE}
echo $(clear)
echo $(acpi -b)
sleep 1
printf ${STOP}
done
My Idea is to Connect the Script on PS1 to keep showing the Battery Status always update!
My Current PS1 is:
PS1='[${OR}USER: \u ${B}TIME: \t ${C}DIR: \W ${RED}$(__git_ps1 " (%s)")]\n[${LG}$(acpi -b)${R}]\n\$
I'm calling the acpi
but he only update when I use some command
$(command)
. – meuh May 18 '18 at 18:54screen
ortmux
which can show a status line which remains independent of the rest of the tty. Some terminal emulators may also propose an escape sequence to create a status line, or to uptdate the title of the window and so on. – meuh May 18 '18 at 19:03echo "$PS1"
; 2. quote your variables with quotes.