Skip to content

Instantly share code, notes, and snippets.

@int0x80
Last active January 29, 2016 20:40
Show Gist options
  • Save int0x80/5b2ac4639ca019d0c314 to your computer and use it in GitHub Desktop.
Save int0x80/5b2ac4639ca019d0c314 to your computer and use it in GitHub Desktop.
Stupid color prompt with disk utilization
PROMPT_COMMAND='time=$(date +%T | tr -d '\n'); disk=($(df -BG | grep dm-1 | tr -d 'G' | tr -d '\n')); host=$(hostname --fqdn | tr -d '\n'); echo -en "\e[1;37m[\e[1;35m${time} \e[0m/ "; if [[ ${disk[3]} -gt 3000 ]]; then echo -en "\e[1;32m"; elif [[ ${disk[3]} -gt 1000 ]]; then echo -en "\e[1;33m"; else echo -en "\e[1;31m"; fi; echo -en "${disk[3]} GB \e[0m/ \e[1;36m${host}\e[1;37m] \e[0m";'
PS1=' \e[1;34m\w \e[0;32m\$\e[0m '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment