Skip to content

Instantly share code, notes, and snippets.

@rene-d
Created October 21, 2020 06:53
Show Gist options
  • Save rene-d/21d21a9fc414021a067ce2eaa3cd2a0e to your computer and use it in GitHub Desktop.
Save rene-d/21d21a9fc414021a067ce2eaa3cd2a0e to your computer and use it in GitHub Desktop.
Show TGV speed in the Bash prompt
_tgv_speed()
{
LANG=C printf "%.f km/h" $(curl -s "https://wifi.sncf/router/api/train/gps" | jq -cr ".speed * 3.6")
}
PS1='\[\033[01;32m\]\u@\h\[\033[0;93m $(_tgv_speed)\033[01;34m\] \w\[\033[01;33m\]$(__git_ps1)\[\033[01;34m\] \$\[\033[00m\] '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment