Skip to content

Commit

Permalink
Fixed theme table + archive format changes (#10)
Browse files Browse the repository at this point in the history
* Theme Library Generate fix

* Update release.yml

* Rename generate_theme_library to generate_theme_library.yml

* Action with generated files

* Update readmetemplate.md

* Update themepagetemplate.md

* Update themepagetemplate.md

* Action with generated files
  • Loading branch information
VagueParade authored Sep 22, 2024
1 parent d2a6ceb commit d0e7020
Show file tree
Hide file tree
Showing 6 changed files with 244 additions and 267 deletions.
9 changes: 3 additions & 6 deletions .github/md_templates/readmetemplate.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
# Theme Library
You can find all themes for muOS here. Click on a theme title to download a zip, place that file on your device within `/ARCHIVE`, and use your on-device Archive Manager to install it. Both the preview image and theme will be installed in this way.

- [Complete Theme Archive download](https://github.com/MustardOS/theme/releases/latest/download/@_Complete_Theme_Archive.zip). ***Warning! This is quite a big file, currently exceeding 600MB.***
This will download all available muOS themes as a single installable archive, and can update previously installed themes.
You can find all themes for muOS here. Click on a theme title to download a zip. Place that file on your device within `MUOS/theme`.

- [Discord Community](https://discord.gg/muos). All these themes were made by members of the muOS community. Join the community today!

- [combine.zip](https://combine.zip). To prevent having to install lots of individual archives separately, you can combine archives together using this website, to create a customised single archive for multiple themes.

- [Complete Theme Archive download](https://github.com/MustardOS/theme/releases/latest/download/@_Complete_Theme_Archive.zip). ***Warning! This is quite a big file, currently exceeding 1GB.***
This will download all available muOS themes as a single installable archive, and can update previously installed themes. Drop this in `/ARCHIVE`, and use your on-device Archive Manager to install it.

> *Some themes have matching folder artwork whilst navigating Explore Content, this is installed separately from themes. To see if a theme has these available, navigate to the specific theme's release page on the [muOS Discord server](https://discord.gg/muos).*
Expand Down
13 changes: 5 additions & 8 deletions .github/md_templates/themepagetemplate.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,21 @@ layout: default
title: Themes
permalink: /themes
nav_enabled: true
nav_order: 3
nav_order: 4
has_children: true
---

# Themes
On muOS, you can fully customise the look of your menus on your device! This is achieved with **Themes**. You can make your own themes by following the help pages here, or install some pre-existing ones below. Happy theme-ing!

# Theme Library
You can find all themes for muOS here. Click on a theme title to download a zip, place that file on your device within `/ARCHIVE`, and use your on-device Archive Manager to install it. Both the preview image and theme will be installed in this way.

- [Complete Theme Archive download](https://github.com/MustardOS/theme/releases/latest/download/@_Complete_Theme_Archive.zip). ***Warning! This is quite a big file, currently exceeding 600MB.***
This will download all available muOS themes as a single installable archive, and can update previously installed themes.
You can find all themes for muOS here. Click on a theme title to download a zip. Place that file on your device within `MUOS/theme`.

- [Discord Community](https://discord.gg/muos). All these themes were made by members of the muOS community. Join the community today!

- [combine.zip](https://combine.zip). To prevent having to install lots of individual archives separately, you can combine archives together using this website, to create a customised single archive for multiple themes.


- [Complete Theme Archive download](https://github.com/MustardOS/theme/releases/latest/download/@_Complete_Theme_Archive.zip). ***Warning! This is quite a big file, currently exceeding 1GB.***
This will download all available muOS themes as a single installable archive, and can update previously installed themes. Drop this in `/ARCHIVE`, and use your on-device Archive Manager to install it.
> *Some themes have matching folder artwork whilst navigating Explore Content, this is installed separately from themes. To see if a theme has these available, navigate to the specific theme's release page on the [muOS Discord server](https://discord.gg/muos).*
| | | |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Theme Table and Scripts Generate
name: Theme Table Generate

on: workflow_dispatch

Expand All @@ -17,15 +17,11 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4
# Here's some info! So firstly, the theme table. First text files are generated with the theme table content, with images and credits
# in each cell. This includes the preview folder, so we create a temporary credits file before deleting the preview cell.
# There is no need to create a temporary preview/preview.png file as the images are referred to as linked images directly from the preview folder.
- name: Create temporary credits file
run: |
echo preview > "preview/credits.txt"
# in each cell.
# This is a huge step... it generates individual text files named after the directory, with a mostly correctly formatted cell within the table.
- name: Generate text file with all directory names, with directory name inside
run: |
mkdir -p /tmp/page && for dir in */; do dir_name="${dir%/}"; (cd "${dir_name}" && echo "| ![${dir_name}](<https://raw.githubusercontent.com/MustardOS/theme/main/preview/${dir_name}.png>) <br>[${dir_name}" > "/tmp/page/${dir_name}.txt" && echo -n "](https://github.com/MustardOS/theme/releases/latest/download/${dir_name}.zip)<br><sup>" | tr [:space:] "." >> "/tmp/page/${dir_name}.txt"); cat "${dir_name}/credits.txt" >> "/tmp/page/${dir_name}.txt"; (cd "${dir_name}" && echo "</sup>" >> "/tmp/page/${dir_name}.txt"); done
mkdir -p /tmp/page && for dir in */; do dir_name="${dir%/}"; (cd "${dir_name}" && echo "| ![${dir_name}](<https://raw.githubusercontent.com/MustardOS/theme/main/${dir_name}/preview.png>) <br>[${dir_name}" > "/tmp/page/${dir_name}.txt" && echo -n "](https://github.com/MustardOS/theme/releases/latest/download/${dir_name}.zip)<br><sup>" | tr [:space:] "." >> "/tmp/page/${dir_name}.txt"); cat "${dir_name}/credits.txt" >> "/tmp/page/${dir_name}.txt"; (cd "${dir_name}" && echo "</sup>" >> "/tmp/page/${dir_name}.txt"); done
# Next we format the text files to only be one line.
- name: Replace line breaks with space
run: |
Expand All @@ -34,14 +30,6 @@ jobs:
- name: Ensure all line breaks are now deleted
run: |
for dir in */; do dir_name="${dir%/}"; tr -d "\n\r" < "/tmp/txt/${dir_name}.txt" > "/tmp/page/${dir_name}.txt"; done
# We remove the preview text file as it is no longer needed. We do not want this directory's contents to show in a single cell on the table.
- name: Delete placeholder preview text file
run: |
rm /tmp/page/preview.txt
- name: Delete placeholder preview text file
run: |
rm /tmp/txt/preview.txt
# We do this to easily sort the theme cells in each row to be alphabetical by capitalising all the file names.
# This will help to ignore if the original theme was lower or uppercase.
- name: make all file names uppercase
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@ jobs:
# Create theme archives here! Zipping everything together and creating a complete theme archive.
- name: Zip directories
run: |
mkdir -p /tmp/release/run/muos/storage/theme && for dir in */; do dir_name="${dir%/}"; (cd "$dir_name" && zip -qq -r "/tmp/release/run/muos/storage/theme/${dir_name}.zip" *); done
mkdir -p /tmp/release/run/muos/storage/theme && for dir in */; do dir_name="${dir%/}"; (cd "$dir_name" && zip -qq -r "/tmp/release/${dir_name}.zip" *); done
- name: Copy zips to complete archive zip format
run: |
cp -a /tmp/release/*.zip /tmp/release/run/muos/storage/theme/
# Create the archive!
- name: Zip mnt folder
- name: Zip complete folder
run: |
(cd /tmp/release && zip -r @_Complete_Theme_Archive.zip run)
- name: Create individual archive managers
run: |
for dir in */; do dir_name="${dir%/}"; (cd /tmp/release && zip -r "${dir_name}.zip" . -i "/run/muos/storage/theme/${dir_name}.zip"); done
- name: List archives
run: |
Expand Down Expand Up @@ -57,7 +58,7 @@ jobs:
- name: Prepare Release
uses: ncipollo/[email protected]
with:
name: "All Themes - Archive Manager"
name: "All Themes"
tag: "${{steps.date.outputs.date}}"
allowUpdates: true
draft: true
Expand All @@ -70,7 +71,7 @@ jobs:
- name: Publish Release
uses: ncipollo/[email protected]
with:
name: "All Themes - Archive Manager"
name: "All Themes"
tag: "${{steps.date.outputs.date}}"
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
Expand Down
Loading

0 comments on commit d0e7020

Please sign in to comment.