Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
128 changes: 128 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: Release

# Triggers whenever a push to main changes Cargo.toml. The `check-version` job
# then confirms the `version = "..."` line actually changed (vs. some other
# Cargo.toml edit landing on main) before the release job runs anything.
#
# To cut a release: bump `version` in Cargo.toml, commit with a message
# describing the release (used verbatim as the GitHub release notes), and
# push to main.
on:
push:
branches: [main]
paths: [Cargo.toml]

permissions:
contents: write

env:
CARGO_TERM_COLOR: always

jobs:
check-version:
runs-on: ubuntu-latest
outputs:
changed: ${{ steps.check.outputs.changed }}
version: ${{ steps.check.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2

- id: check
run: |
NEW="$(grep -m1 '^version = ' Cargo.toml | sed -E 's/version = "(.*)"/\1/')"
if git rev-parse HEAD~1 >/dev/null 2>&1; then
OLD="$(git show HEAD~1:Cargo.toml | grep -m1 '^version = ' | sed -E 's/version = "(.*)"/\1/' || true)"
else
OLD=""
fi
echo "old version: $OLD"
echo "new version: $NEW"
if [[ "$NEW" != "$OLD" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
echo "version=$NEW" >> "$GITHUB_OUTPUT"
else
echo "changed=false" >> "$GITHUB_OUTPUT"
fi

release:
needs: check-version
if: needs.check-version.outputs.changed == 'true'
runs-on: ubuntu-latest
env:
VERSION: ${{ needs.check-version.outputs.version }}
steps:
- uses: actions/checkout@v4

- name: Install cross
run: cargo install cross --locked

- name: Extract release note from commit message
id: note
run: |
{
echo "note<<GNOMAD_RELEASE_NOTE_EOF"
git log -1 --pretty=%B
echo "GNOMAD_RELEASE_NOTE_EOF"
} >> "$GITHUB_OUTPUT"

- name: Build x86_64
run: cargo build --release

- name: Package x86_64
run: (cd target/release && tar czf "$GITHUB_WORKSPACE/gnomad-x86_64-unknown-linux-gnu.tar.gz" gnomad)

- name: Cross-build aarch64
run: cross build --release --target aarch64-unknown-linux-gnu

- name: Package aarch64
run: (cd target/aarch64-unknown-linux-gnu/release && tar czf "$GITHUB_WORKSPACE/gnomad-aarch64-unknown-linux-gnu.tar.gz" gnomad)

- name: Create GitHub release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "v$VERSION" \
--repo GooseRooster/gnomad \
--title "v$VERSION" \
--notes "${{ steps.note.outputs.note }}" \
gnomad-x86_64-unknown-linux-gnu.tar.gz \
gnomad-aarch64-unknown-linux-gnu.tar.gz

- name: Compute checksums
id: sha
run: |
echo "x86=$(sha256sum gnomad-x86_64-unknown-linux-gnu.tar.gz | awk '{print $1}')" >> "$GITHUB_OUTPUT"
echo "arm=$(sha256sum gnomad-aarch64-unknown-linux-gnu.tar.gz | awk '{print $1}')" >> "$GITHUB_OUTPUT"

- name: Publish to crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish

- name: Update homebrew tap
env:
X86_SHA: ${{ steps.sha.outputs.x86 }}
ARM_SHA: ${{ steps.sha.outputs.arm }}
TAP_REPO_TOKEN: ${{ secrets.TAP_REPO_TOKEN }}
run: |
git clone "https://x-access-token:${TAP_REPO_TOKEN}@github.com/GooseRooster/homebrew-gnomad.git" tap
FORMULA="tap/Formula/gnomad.rb"

sed -i "s/version \".*\"/version \"$VERSION\"/" "$FORMULA"
sed -i \
"s|releases/download/v[^/]*/gnomad-x86_64|releases/download/v$VERSION/gnomad-x86_64|" \
"$FORMULA"
sed -i \
"s|releases/download/v[^/]*/gnomad-aarch64|releases/download/v$VERSION/gnomad-aarch64|" \
"$FORMULA"
sed -i "/gnomad-x86_64-unknown-linux-gnu.tar.gz\"/{n;s/sha256 \".*\"/sha256 \"$X86_SHA\"/}" "$FORMULA"
sed -i "/gnomad-aarch64-unknown-linux-gnu.tar.gz\"/{n;s/sha256 \".*\"/sha256 \"$ARM_SHA\"/}" "$FORMULA"

cd tap
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add Formula/gnomad.rb
git commit -m "gnomad $VERSION"
git push
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "gnomad"
version = "0.3.7"
version = "0.4.0"
edition = "2021"
description = "A lightweight TUI for managing tinted color schemes in the GNOME shell"
readme = "README.md"
Expand Down
39 changes: 35 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,17 @@ https://youtu.be/VyY0kjDfrCM
- **Custom schemes** — drop your own YAML files into a configured directory and they appear alongside the catalogue
- **Dark/light preference** — optionally filter schemes to match your GNOME colour scheme setting (prefer-dark / prefer-light)
- **Adwaita for Steam** — optional integration with [Adwaita-for-Steam](https://github.com/tkashkin/Adwaita-for-Steam); writes scheme colours to its custom CSS override on every scheme switch, keeping Steam's UI in sync with your desktop
- **Hooks** — Support for custom hooks in config allowing you to run your own shell commands whenever gnomad changes the color scheme, wallpaper, or batch converts a directory.

---

## Requirements

- GNOME 45+ on Wayland
- `rustup` installed from your distribution's package manager
- `tinty` in `$PATH` — `cargo install tinty`
- `rustup` installed from your distribution's package manager, or Homebrew
- `tinty` in `$PATH` — `cargo install tinty` or `brew install tinty` with the tinted-theming brew tap configured
- `git` in `$PATH`
- `gowall` in `$PATH` — [installation](https://github.com/Achno/gowall#installation) *(optional — only required when `wallpaper_enabled = true`, which is the default)*
- `gowall` in `$PATH` — [installation](https://github.com/Achno/gowall#installation) *(optional — only required when `wallpaper_enabled = true`, which is the default. Also supports installation on linux via homebrew)*
- A terminal with [Sixel](https://en.wikipedia.org/wiki/Sixel) or [Kitty Graphics Protocol](https://sw.kovidgoyal.net/kitty/graphics-protocol/) support for wallpaper preview (e.g. Kitty, foot, WezTerm, Ghostty) *(optional — wallpaper panel only)*

---
Expand Down Expand Up @@ -113,7 +114,9 @@ tinty sync

See the [Tinty documentation](https://github.com/tinted-theming/tinty) for details.

gnomad will warn on startup if User Themes is not detected or if Tinty/gowall are missing from `$PATH`.
For **custom schemes** (from `custom_schemes_dir`), gnomad automatically writes a copy into tinty's own custom-schemes directory (`~/.local/share/tinted-theming/tinty/custom-schemes/<system>/<slug>.yaml`) immediately before every `tinty apply` call, no manual registration or `tinty sync` needed. This file is regenerated on every apply, so edits to your source YAML in `custom_schemes_dir` take effect on the next scheme switch, effectively allowing you to manage your schemes entirely from gnomad.

gnomad will warn on startup if dependencies are missing.

### 4. Adwaita for Steam (optional)

Expand Down Expand Up @@ -149,6 +152,11 @@ wallpaper_enabled = true # set to false to disable all wallpaper feature
adwaita_steam_enabled = false # set to true to enable Adwaita for Steam integration
slideshow_static_secs = 3600 # seconds each wallpaper is shown before crossfading
slideshow_transition_secs = 1800 # seconds each crossfade lasts

[hooks]
# on_scheme_apply = "..."
# on_wallpaper_apply = "..."
# on_wallpaper_batch_convert = "..."
```

| Key | Default | Description |
Expand All @@ -169,6 +177,27 @@ The wallpaper directory can also be changed at runtime with `[d]` in the wallpap

---

## Hooks

gnomad can run arbitrary shell commands after key events, with event-specific `GNOMAD_*` environment variables injected for the hook to reference. Hooks run via `sh -c "<command>"` with a 30s timeout, and never block or fail the underlying gnomad operation — failures are logged to `~/.local/share/gnomad/gnomad.log` (run with `-v`) but otherwise silent.

Configure them under a `[hooks]` table in `config.toml`:

```toml
[hooks]
on_wallpaper_batch_convert = "/usr/bin/gsettings set org.gnome.shell.extensions.wallpaper-slideshow.picture-uri-list-source-directory \"file://$GNOMAD_CACHE_DIR\""
```

> Use full paths like `/usr/bin/gsettings` rather than bare `gsettings`. This avoids PATH issues with tools like Homebrew shadowing system binaries, and mirrors gnomad's own internal convention (see `gsettings_set`/`gsettings_get` in `src/pipeline/gnome.rs`).

| Key | Fires | Env vars available |
|---|---|---|
| `on_scheme_apply` | After a full scheme switch completes successfully | `GNOMAD_SCHEME_SLUG`, `GNOMAD_SCHEME_NAME`, `GNOMAD_SCHEME_SYSTEM` (`base16`/`base24`), `GNOMAD_SCHEME_VARIANT` (empty if unset), `GNOMAD_WALLPAPER_PATH` (empty if wallpapers disabled) |
| `on_wallpaper_apply` | After a standalone wallpaper switch (no scheme change) | `GNOMAD_WALLPAPER_PATH`, `GNOMAD_SCHEME_SLUG` (empty if no active scheme) |
| `on_wallpaper_batch_convert` | After `[c]`/`[Shift+C]` batch-converts a wallpaper directory, and after `[s]` creates a slideshow (which batch-converts internally) | `GNOMAD_SCHEME_SLUG`, `GNOMAD_CACHE_DIR` (the per-scheme cache directory, now populated), `GNOMAD_WALLPAPER_COUNT` |

---

## Key Bindings

| Key | Action |
Expand Down Expand Up @@ -222,6 +251,8 @@ Picking a wallpaper and pressing `Enter` runs only gowall + wallpaper set; no CS

Place any base16/base24 YAML files in your configured `custom_schemes_dir`. They appear in the browser with a `[*]` tag and support everything the catalogue schemes do. Both the new format (with `palette:` key) and the legacy flat format are parsed.

Under the hood, gnomad mirrors each custom scheme into tinty's `custom-schemes/<system>/` directory before applying, so Tinty-themed apps (kitty, neovim, etc.) pick up custom schemes exactly like catalogue ones.



---
Expand Down
144 changes: 0 additions & 144 deletions scripts/release.sh

This file was deleted.

Loading
Loading