Skip to content

Commit

Permalink
chore(build): cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelroses committed Mar 22, 2024
1 parent 542f990 commit 1669f7c
Showing 1 changed file with 14 additions and 23 deletions.
37 changes: 14 additions & 23 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,34 @@ _default:
@just --list

output_dir := "dist"
themes := "THEMES=\"mocha macchiato frappe latte\""

# Remove output directory
clean:
rm -rfv {{output_dir}}

# Build theme
build: clean
#!/usr/bin/env sh
{{themes}}

for THEME in $THEMES; do
_build flavor:
# make sure the directories we need exist
mkdir -p "{{output_dir}}/catppuccin-$THEME"
mkdir -p "{{output_dir}}/catppuccin-{{flavor}}"

# copy the files to the correct location
cp -r src/* "{{output_dir}}/catppuccin-$THEME"
cp -r src/* "{{output_dir}}/catppuccin-{{flavor}}"

# replace the theme name in the metadata file
sed -i -e "s/%%THEME%%/$THEME/g" "{{output_dir}}/catppuccin-$THEME/metadata.desktop"
sed -i -e "s/%%THEME%%/{{flavor}}/g" "{{output_dir}}/catppuccin-{{flavor}}/metadata.desktop"

# handle items that are diffrent per theme
cp "pertheme/$THEME.png" "{{output_dir}}/catppuccin-$THEME/preview.png"
cp "pertheme/$THEME.conf" "{{output_dir}}/catppuccin-$THEME/theme.conf"
done
# handle items that are different per theme
cp "pertheme/{{flavor}}.png" "{{output_dir}}/catppuccin-{{flavor}}/preview.png"
cp "pertheme/{{flavor}}.conf" "{{output_dir}}/catppuccin-{{flavor}}/theme.conf"

# Generate zips
zip: build
#!/usr/bin/env sh
# Build theme
build: clean (_build "latte") (_build "frappe") (_build "macchiato") (_build "mocha")

{{themes}}
_zip flavor:
zip -r {{output_dir}}/catppuccin-{{flavor}}.zip {{output_dir}}/catppuccin-{{flavor}}

for THEME in $THEMES; do
zip -r {{output_dir}}/catppuccin-$THEME.zip {{output_dir}}/catppuccin-$THEME
done
# Generate zips
zip: build (_zip "latte") (_zip "frappe") (_zip "macchiato") (_zip "mocha")

# Install themes
install: build
sudo cp -r {{output_dir}}/catppuccin-* /usr/share/sddm/themes/
cp -r {{output_dir}}/catppuccin-* /usr/share/sddm/themes/

0 comments on commit 1669f7c

Please sign in to comment.