Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 0 additions & 51 deletions .github/workflows/jekyll-gh-pages.yml

This file was deleted.

148 changes: 148 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
name: Main CI/CD

on:
push:
branches: ["main"]
pull_request:
paths:
- 'themes/*.theme'
schedule:
- cron: "0 * * * *" # Popularity update every hour
workflow_dispatch:

permissions:
contents: write
pages: write
id-token: write
discussions: read

concurrency:
group: "pages"
cancel-in-progress: true

jobs:
count-themes:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v5

- name: Count unique themes
run: |
# Count unique theme families (remove -v* version suffix only)
UNIQUE=$(find ./themes/ -type f -name '*.theme' | \
sed 's|.*/SxC_||; s|\.theme||; s|-v[0-9].*||' | \
sort -u | wc -l)

echo "Unique themes: $UNIQUE"

if grep -q "Themes count:" README.md; then
sed -i "s/# Themes count: .*/# Themes count: $UNIQUE/" README.md
fi

- name: Commit updated count
run: |
git config --global user.name "oSoWoSo-bot"
git config --global user.email "osowoso@disroot.org"
if git diff --exit-code HEAD -- README.md 2>/dev/null; then
echo "No changes to commit."
else
git add README.md
git commit -m "Update theme count"
git push
fi

validate-theme:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Validate theme files
run: |
for theme_file in themes/*.theme; do
echo "Validating $theme_file..."
if ! grep -q 'base:' "$theme_file"; then
echo "Error: $theme_file missing 'base:' field"
exit 1
fi
required_colors=("accent" "background" "menus")
for color in "${required_colors[@]}"; do
if ! grep -q "$color:" "$theme_file"; then
echo "Warning: $theme_file missing '$color:' field"
fi
done
echo "$theme_file is valid"
done
echo "All theme files validated successfully!"

- name: Check screenshots exist
run: |
themes=$(find themes -name '*.theme' -exec basename {} .theme \;)
for theme in $themes; do
if ! ls screenshots/SxC_${theme}*.jpg 1>/dev/null 2>&1; then
echo "Warning: No screenshots found for $theme"
fi
done

build:
runs-on: ubuntu-latest
needs: [count-themes, validate-theme]
if: always() && (needs.count-themes.result == 'success' || needs.count-themes.result == 'skipped') && (needs.validate-theme.result == 'success' || needs.validate-theme.result == 'skipped')
steps:
- uses: actions/checkout@v5

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Build with Jekyll
uses: actions/jekyll-build-pages@v4
with:
source: ./
destination: ./_site

- name: Upload artifact
uses: actions/upload-pages-artifact@v4

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

generate-popularity:
runs-on: ubuntu-latest
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 22

- name: Install dependencies
run: npm install @octokit/graphql

- name: Generate popularity
run: node scripts/generate-popularity.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Commit updated stats
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add data/popular.json
git diff --cached --quiet && exit 0
git commit -m "Update popularity stats"
git push
1 change: 1 addition & 0 deletions CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
themes.osowoso.org
100 changes: 100 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Contributing to SimpleX Themes

Thank you for your interest in contributing a theme! This guide will help you add a new theme to the repository.

## Ways to Contribute

### 1. GitHub Pull Request (Recommended)

1. Fork the repository
2. Create a new branch: `git checkout -b add-theme-name`
3. Add your theme file to `themes/` directory
4. Add 4 screenshots to `screenshots/` directory
5. Generate the index.md file using the automation script
6. Update README.md to include your theme
7. Submit a pull request

### 2. Send a Patch by Email

See [git-send-email.io](https://git-send-email.io/) for instructions.

### 3. Manual Upload

1. Create your theme in the SimpleX Chat app
2. Export your theme to a file
3. Join the SimpleX Themes group and upload your theme

## Theme File Requirements

### Naming Convention

Theme files should follow this pattern:
- `SxC_themeName.theme` (e.g., `SxC_myTheme.theme`)
- Use underscores instead of spaces
- Maximum length: 50 characters for the theme name

### Theme File Format

```yaml
base: "BLACK" # or "WHITE"
colors:
accent: "#ffa698b4"
accentVariant: "#ff584858"
secondary: "#ffecece1"
secondaryVariant: "#ff9c6e9c"
background: "#ff180818"
menus: "#ff281028"
title: "#ff807088"
accentVariant2: "#ff98a8a8"
sentMessage: "#e5503858"
sentReply: "#ff281028"
receivedMessage: "#e287758b"
receivedReply: "#ff3e293e"
wallpaper:
scale: 1.0
scaleType: "fill"
background: "#ff070707"
tint: "#00ffffff"
```

## Automating Theme Addition

We've created a script to help automate adding new themes:

```bash
python3 scripts/add_theme.py themes/SxC_yourTheme.theme
```

This script will:
- Validate your theme file format
- Generate the `resources/SxC_yourTheme_index.md` file
- Provide instructions for the next steps

### Screenshot Requirements

Each theme needs 4 screenshots (JPG format, 120px width in the index):

**Naming patterns supported:**
- `SxC_themeName01.jpg`, `SxC_themeName02.jpg`, etc.
- `SxC_themeName-v101.jpg`, `SxC_themeName-v102.jpg`, etc.

### Taking Screenshots

To take screenshots for your theme:

1. **Android Emulator**: Use the built-in screen recording or take screenshots
2. **Physical Device**: Use your device's screenshot functionality
3. **SimpleX Chat**: Navigate through the app to capture all color variations

## Theme Validation

When you submit a pull request, our GitHub Actions workflow will automatically:

- Validate that theme files have the required `base:` field
- Check for required color fields
- Verify that screenshots exist for new themes

## Need Help?

- Join the [SimpleX Themes group](https://simplex.chat/contact#/?v=2-7&smp=smp%3A%2F%2Fhpq7_4gGJiilmz5Rf-CswuU5kZGkm_zOIooSw6yALRg%3D%40smp5.simplex.im%2FjwFqICow91mcVNxBF2GXXF5Uq4H27goC%23%2F%3Fv%3D1-3%26dh%3DMCowBQYDK2VuAyEAOYs_RwIB67iDC_ORPmBpp-oED4Ric3oYkID4kdkMdGs%253D%26srv%3Djjbyvoemxysm7qxap7m5d5m35jzv5qq6gnlv7s4rsn7tdwwmuqciwpid.onion&data=%7B%22type%22%3A%22group%22%2C%22groupLinkId%22%3A%22jpatHRdLkjwNmbWBc-VWcg%3D%3D%22%7D) for support
- Open an issue on GitHub if you encounter problems
Loading
Loading