wal_walker_light.sh 894 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. # Walk through all wal built in themes,
  3. # prompting the user to pluck one into .wal_alias with
  4. # the following format:
  5. # alias wal-$theme_name='wal --theme $theme_name'
  6. for theme in $(wal --theme | grep - | grep -v random | sed s/\ -\ //g); do
  7. echo
  8. echo
  9. echo $theme
  10. check_theme=$(grep $theme .wal_alias > /dev/null 2>&1; echo $?)
  11. if [[ $check_theme -eq 0 ]]; then
  12. echo "Skipping $theme, already have an alias"
  13. continue
  14. fi
  15. wal -n -e --theme $theme -l
  16. if [ $? -ne 0 ]; then
  17. echo "Wal failed on dark theme for $theme, trying light"
  18. wal -n -e --theme $theme -l
  19. read -p "Store this theme? " REPLY
  20. if [[ $REPLY =~ ^[Yy] ]]; then
  21. echo "alias wal-$theme='wal -n -e --theme $theme -l'" >> .wal_alias
  22. fi
  23. else
  24. read -p "Store this theme? " REPLY
  25. if [[ $REPLY =~ ^[Yy] ]]; then
  26. echo "alias wal-$theme='wal -n -e --theme $theme'" >> .wal_alias
  27. fi
  28. fi
  29. done