previews.sh 574 B

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. # @author: @vrdhn on github
  3. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
  4. cd $SCRIPT_DIR/..
  5. set_theme () {
  6. cat themes/$1.conf | awk 'BEGIN {printf("kitty @ set-colors ")} {printf( "%s=%s ",$1,$2 )} END{printf("\n")}' | sh
  7. }
  8. list=$(find themes -type f | grep "$1" | xargs basename | cut -d. -f1)
  9. for x in $list ;
  10. do
  11. kitty +kitten icat "previews/$x.png"
  12. read -n 1 -p "$x : Next / Set / Quit :" ans
  13. echo
  14. case $ans in
  15. n ) ;;
  16. s ) set_theme $x ; exit ;;
  17. q ) exit ;;
  18. esac
  19. done