From 8342304354bcc1bb875391dc6a0777ae39524e6a Mon Sep 17 00:00:00 2001 From: SirBlob Date: Sun, 1 Nov 2026 22:05:40 -0500 Subject: [PATCH] Add wallpaper picker and compression script --- README.md | 13 +- package.json | 3 +- src/lib/components/shell/Bar.svelte | 2 + src/lib/components/shell/PopupCard.svelte | 16 +- src/lib/components/shell/WallpaperMenu.svelte | 166 ++++++++++++++++++ src/lib/content/index.ts | 5 +- src/lib/content/types.ts | 7 + src/lib/theme/wallpaper.svelte.ts | 52 ++++++ src/routes/+layout.svelte | 2 + tools/content/requirements.txt | 1 + tools/content/wallpapers.py | 132 ++++++++++++++ 11 files changed, 392 insertions(+), 7 deletions(-) create mode 100644 src/lib/components/shell/WallpaperMenu.svelte create mode 100644 src/lib/theme/wallpaper.svelte.ts create mode 100644 tools/content/wallpapers.py diff --git a/README.md b/README.md index e5a781b..230734f 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ The site recreates my [blomarchy](https://git.sirblob.co/SirBlob/blomarchy) setu ## Features - **Tiling windows** - every page opens as a window that tiles like Hyprland's dwindle layout, with gradient borders. -- **Quickshell bar** - app launcher, workspaces, clock, music player, live Discord status, battery details and a theme picker. +- **Quickshell bar** - app launcher, workspaces, clock, music player, live Discord status, battery details, a theme picker and a wallpaper picker. - **Music player** - plays a random song from a YouTube playlist, muted until you unmute it, with seek, skip, repeat, volume and a playlist view. - **Floating windows** - Alt + V or the title bar button pops a window out of the tiling layout so it can be dragged and resized. - **btop** - a system monitor window with my real GitHub commit graph, repos as processes and some very scientific CPU and caffeine readings. @@ -111,7 +111,7 @@ bun run content:setup bun run content ``` -`content:setup` creates a virtual environment in `tools/content/.venv` and installs Textual. Run it once. +`content:setup` creates a virtual environment in `tools/content/.venv` and installs Textual and Pillow. Run it once. | Key | Action | | --- | --- | @@ -138,6 +138,15 @@ Show and movie titles are looked up on OMDb with `OMDB_API_KEY` from `.env`; fil | `projects/*.json` | Open source, packages, hackathons, research groups and organizations | | `music.json` | YouTube links for the music player | | `books.json` | Books scraped from Goodreads for the about page | +| `wallpapers.json` | Wallpapers for the picker, written by `bun run wallpapers` | | `desktop.json` | Workspaces, desktop icons, the startup command and the default theme | | `themes.json` | Color themes for the site and the content editor | | `blog/*.md` | Blog posts | + +### Wallpapers + +```sh +bun run wallpapers +``` + +Converts every image in `~/dotfiles/wallpapers` into a compressed JPEG in `static/wallpapers/gallery`, with a small thumbnail for the picker, and writes the list to `content/wallpapers.json`. Unchanged wallpapers are skipped, so run it again whenever the dotfiles change. Pass a folder to use a different source, or `--force` to convert everything again. diff --git a/package.json b/package.json index 97ebe93..561a64c 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "preview": "vite preview", "start": "bun --bun vite build && bun ./build/index.js", "content": "tools/content/.venv/bin/python tools/content/app.py", - "content:setup": "python3 -m venv tools/content/.venv && tools/content/.venv/bin/pip install -r tools/content/requirements.txt", + "wallpapers": "tools/content/.venv/bin/python tools/content/wallpapers.py", + "content:setup":"python3 -m venv tools/content/.venv && tools/content/.venv/bin/pip install -r tools/content/requirements.txt", "prepare": "svelte-kit sync || echo ''", "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch" diff --git a/src/lib/components/shell/Bar.svelte b/src/lib/components/shell/Bar.svelte index 3b2051a..6d4a617 100644 --- a/src/lib/components/shell/Bar.svelte +++ b/src/lib/components/shell/Bar.svelte @@ -4,6 +4,7 @@ import Clock from './Clock.svelte'; import Workspaces from './Workspaces.svelte'; import ThemeMenu from './ThemeMenu.svelte'; + import WallpaperMenu from './WallpaperMenu.svelte'; import DiscordStatus from './DiscordStatus.svelte'; import Battery from './Battery.svelte'; import Music from './Music.svelte'; @@ -27,6 +28,7 @@ + diff --git a/src/lib/components/shell/PopupCard.svelte b/src/lib/components/shell/PopupCard.svelte index ee6f255..3dbb2de 100644 --- a/src/lib/components/shell/PopupCard.svelte +++ b/src/lib/components/shell/PopupCard.svelte @@ -2,7 +2,12 @@ import { focusTrap } from '#lib/ui/focusTrap'; import type { Snippet } from 'svelte'; - let { title, onclose, children }: { title: string; onclose: () => void; children: Snippet } = $props(); + let { + title, + wide = false, + onclose, + children + }: { title: string; wide?: boolean; onclose: () => void; children: Snippet } = $props(); function handleKeydown(event: KeyboardEvent) { if (event.key === 'Escape') onclose(); @@ -12,7 +17,7 @@ -