make it more clear
This commit is contained in:
@@ -2,26 +2,34 @@
|
||||
|
||||
. ~/.cache/wal/colors.sh
|
||||
|
||||
# Your path for extensions folder here
|
||||
THEME_PATH="$HOME/Chromium Extensions/pywaltheme"
|
||||
DIR=$(dirname "${BASH_SOURCE[0]}")
|
||||
THEME_DIR="$DIR/GeneratedTheme"
|
||||
|
||||
# Converts hex colors into rgb joined with comma
|
||||
# #fff -> 255, 255, 255
|
||||
hexToRgb() {
|
||||
# Remove '#' character from hex color #fff -> fff
|
||||
plain=${1#*#}
|
||||
printf "%d, %d, %d" 0x${plain:0:2} 0x${plain:2:2} 0x${plain:4:2}
|
||||
}
|
||||
|
||||
if [ ! -d "$THEME_PATH/images" ]; then
|
||||
mkdir "$THEME_PATH/images"
|
||||
if [ ! -d $THEME_DIR ]; then
|
||||
mkdir $THEME_DIR
|
||||
fi
|
||||
|
||||
cp $wallpaper "$THEME_PATH/images/theme_ntp_background_norepeat.png"
|
||||
if [ ! -d "$THEME_DIR/images" ]; then
|
||||
mkdir "$THEME_DIR/images"
|
||||
fi
|
||||
|
||||
cat > "$THEME_PATH/manifest.json" << EOF
|
||||
# Copy wallpaper so it can be used in theme
|
||||
cp $wallpaper "$THEME_DIR/images/theme_ntp_background_norepeat.png"
|
||||
|
||||
# Theme template
|
||||
cat > "$THEME_DIR/manifest.json" << EOF
|
||||
{
|
||||
"manifest_version": 3,
|
||||
"version": "1.0",
|
||||
"name": "pywal theme",
|
||||
"name": "Pywal Theme",
|
||||
"images": {
|
||||
"theme_ntp_background" : "images/theme_ntp_background_norepeat.png"
|
||||
},
|
||||
@@ -45,3 +53,11 @@ cat > "$THEME_PATH/manifest.json" << EOF
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
|
||||
# Remove cache so chrome will refresh theme colors on restart
|
||||
if [ -f "$THEME_DIR/Cached Theme.pak" ]; then
|
||||
rm "$THEME_DIR/Cached Theme.pak"
|
||||
fi
|
||||
|
||||
echo "Theme generated at $THEME_DIR"
|
||||
|
||||
Reference in New Issue
Block a user