Created
August 11, 2021 22:33
-
-
Save Rovitz/f8913974ea9bd0c473935d6301809c99 to your computer and use it in GitHub Desktop.
Qogir HiDPI theme for XFCE4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#processing function | |
process_files () { | |
cd ${1} | |
mkdir out; cd out | |
cp ../src/xfwm4/${3} themerc | |
cat ../src/xfwm4/assets.txt | while read filename | |
do | |
printf "Processing $filename.png...\n" | |
inkscape --export-id-only --export-filename=$filename.png --export-id=$filename --export-dpi=${4} ../src/xfwm4/${2}.svg > /dev/null 2>&1 | |
done | |
printf "\nRemoving old files...\n" | |
rm -rf ${5}/* | |
printf "Copying new files...\n" | |
cp -R * ${5}/ | |
printf "Cleanup...\n" | |
cd ../; rm -rf out | |
} | |
#various checks | |
if [[ $(id -u) -eq 0 ]]; then echo "Please don't run as root."; exit; fi | |
if ! [ -x "$(command -v sassc)" ]; then echo "Error: sassc is not installed."; exit; fi | |
if ! [ -x "$(command -v inkscape)" ]; then echo "Error: inkscape is not installed."; exit; fi | |
#96dpi (1x scaling), 192dpi (2x scaling) | |
DPI=192 | |
#cleanup | |
WORKING_DIR=$HOME/WORKING_DIR | |
rm -rf $WORKING_DIR; mkdir $WORKING_DIR; cd $WORKING_DIR | |
#download theme | |
printf "Downloading necessary files...\n" | |
git clone https://github.com/vinceliuice/Qogir-theme.git; cd Qogir-theme; | |
#setup theme | |
bash install.sh -c standard -t default | |
process_files $(dirname "$(realpath $0)") "assets" "themerc" $DPI $HOME/.themes/Qogir/xfwm4 | |
bash install.sh -c light -t default | |
process_files $(dirname "$(realpath $0)") "assets-light" "themerc-light" $DPI $HOME/.themes/Qogir-light/xfwm4 | |
bash install.sh -c dark -t default | |
process_files $(dirname "$(realpath $0)") "assets" "themerc" $DPI $HOME/.themes/Qogir-dark/xfwm4 | |
#final cleanup | |
printf "Removing remaining files...\n" | |
rm -rf $WORKING_DIR | |
printf "\n\nDone.\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment