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