One way is to use tput to count the columns of your terminal and subtract the number of characters that will be printed left and right, and then use this number as the number of spaces between the left and right text. Use printf to build a string.
quick example:
left="[${status}]\ u@ \h:\w\$ " right="$(git symbolic-ref HEAD) $(date +%T)" spaces="$(( $(tput cols) - ${#left} - ${#right} ))" export PS1="$(printf "%s%${spaces}s\n" "$left" "$right")"
c00kiemon5ter
source share