make it more clear
This commit is contained in:
14
README.md
14
README.md
@@ -4,3 +4,17 @@ Generates a chromium theme by using colors generated by [pywal](https://github.c
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
1. Run script `./generate-theme.sh`
|
||||||
|
2. Open chromium
|
||||||
|
3. Go to `chrome://extensions`
|
||||||
|
4. Turn on "Developer Mode" in the top right corner
|
||||||
|
5. Press "Load unpacked"
|
||||||
|
6. Select "GeneratedTheme" in the same folder with the script
|
||||||
|
7. ???
|
||||||
|
8. PROFIT!
|
||||||
|
|
||||||
|
However, you need to run this script each time you change pywal colors.
|
||||||
|
So, make an alias or something like that.
|
||||||
|
But you don't need to repeat the steps above, just run the script and that's it, chromium will update theme colors automatically. 😁
|
||||||
|
|||||||
@@ -2,26 +2,34 @@
|
|||||||
|
|
||||||
. ~/.cache/wal/colors.sh
|
. ~/.cache/wal/colors.sh
|
||||||
|
|
||||||
# Your path for extensions folder here
|
DIR=$(dirname "${BASH_SOURCE[0]}")
|
||||||
THEME_PATH="$HOME/Chromium Extensions/pywaltheme"
|
THEME_DIR="$DIR/GeneratedTheme"
|
||||||
|
|
||||||
|
# Converts hex colors into rgb joined with comma
|
||||||
|
# #fff -> 255, 255, 255
|
||||||
hexToRgb() {
|
hexToRgb() {
|
||||||
# Remove '#' character from hex color #fff -> fff
|
# Remove '#' character from hex color #fff -> fff
|
||||||
plain=${1#*#}
|
plain=${1#*#}
|
||||||
printf "%d, %d, %d" 0x${plain:0:2} 0x${plain:2:2} 0x${plain:4:2}
|
printf "%d, %d, %d" 0x${plain:0:2} 0x${plain:2:2} 0x${plain:4:2}
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ ! -d "$THEME_PATH/images" ]; then
|
if [ ! -d $THEME_DIR ]; then
|
||||||
mkdir "$THEME_PATH/images"
|
mkdir $THEME_DIR
|
||||||
fi
|
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,
|
"manifest_version": 3,
|
||||||
"version": "1.0",
|
"version": "1.0",
|
||||||
"name": "pywal theme",
|
"name": "Pywal Theme",
|
||||||
"images": {
|
"images": {
|
||||||
"theme_ntp_background" : "images/theme_ntp_background_norepeat.png"
|
"theme_ntp_background" : "images/theme_ntp_background_norepeat.png"
|
||||||
},
|
},
|
||||||
@@ -45,3 +53,11 @@ cat > "$THEME_PATH/manifest.json" << EOF
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
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