toy.svg 2.1 KB

1234567891011121314151617181920
  1. #!/bin/sh
  2. template() {
  3. status=$(echo "$1" | head -n1 | cut -d ';' -f3)
  4. case "$status" in
  5. n)
  6. printf '<svg width="111.87" height="20" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="m0 0h58.874v20h-58.874z" fill="#292929"/><path d="m58.874 0h53v20h-53z" fill="#317b9f"/><text x="29.437" y="13.003" fill="#ffffff" font-family="Iosevka, monospace" font-size="11px" text-anchor="middle" textLength="44.244">toymaker</text><text x="85.374" y="13.003" fill="#ffffff" font-family="Iosevka, monospace" font-size="11px" text-anchor="middle" textLength="38.564">pending</text></svg>'
  7. ;;
  8. r)
  9. printf '<svg width="111.87" height="20" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="m0 0h58.874v20h-58.874z" fill="#292929"/><path d="m58.874 0h53v20h-53z" fill="#317b9f"/><text x="29.437" y="13.003" fill="#ffffff" font-family="Iosevka, monospace" font-size="11px" text-anchor="middle" textLength="44.244">toymaker</text><text x="85.374" y="13.003" fill="#ffffff" font-family="Iosevka, monospace" font-size="11px" text-anchor="middle" textLength="37.886">running</text></svg>'
  10. ;;
  11. 0)
  12. printf '<svg width="111.87" height="20" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="m0 0h58.874v20h-58.874z" fill="#292929"/><path d="m58.874 0h53v20h-53z" fill="#1c9867"/><text x="29.437" y="13.003" fill="#ffffff" font-family="Iosevka, monospace" font-size="11px" text-anchor="middle" textLength="44.244">toymaker</text><text x="85.374" y="13.003" fill="#000" font-family="Iosevka, monospace" font-size="11px" text-anchor="middle" textLength="38.374">success</text></svg>'
  13. ;;
  14. *)
  15. printf '<svg width="111.87" height="20" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="m0 0h58.874v20h-58.874z" fill="#292929"/><path d="m58.874 0h53v20h-53z" fill="#892b30"/><text x="29.437" y="13.003" fill="#ffffff" font-family="Iosevka, monospace" font-size="11px" text-anchor="middle" textLength="44.244">toymaker</text><text x="85.374" y="13.003" fill="#fff" font-family="Iosevka, monospace" font-size="11px" text-anchor="middle" textLength="38.408">failure</text></svg>'
  16. ;;
  17. esac
  18. }