From be14a1a730e12deaa0c897fc5debfc98c529c642 Mon Sep 17 00:00:00 2001 From: SirBlobby Date: Fri, 3 Jul 2026 16:14:37 -0400 Subject: [PATCH] Add blob_theme script and update wallpaper script --- scripts/blob_theme.sh | 63 +++++++++++++++++++++++++++++++++++++++ scripts/blob_wallpaper.sh | 6 +++- 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 scripts/blob_theme.sh diff --git a/scripts/blob_theme.sh b/scripts/blob_theme.sh new file mode 100644 index 0000000..e96ac47 --- /dev/null +++ b/scripts/blob_theme.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +# Pull a color theme shared from the wall-styles website and apply it. + +THEME_DIR="$HOME/.config/omarchy/themes/blob-dynamic" + +# Used only when a bare id is passed instead of a full share link. +# Override with: export BLOB_THEME_URL="https://your-deployment.vercel.app" +BASE_URL="${BLOB_THEME_URL:-https://wall-styles.vercel.app}" + +if [ -z "$1" ]; then + echo "Usage: blob_theme " + echo "Example: blob_theme \"https://wall-styles.vercel.app/?id=ab12cd34ef\"" + exit 1 +fi + +INPUT="$1" + +if [[ "$INPUT" == http*://* ]]; then + HOST=$(echo "$INPUT" | sed -E 's#^(https?://[^/]+).*#\1#') + ID=$(echo "$INPUT" | grep -oE 'id=[A-Za-z0-9]+' | head -1 | cut -d= -f2) + if [ -z "$ID" ]; then + echo "Error: no theme id found in link '$INPUT'." + exit 1 + fi + API="$HOST/api/theme?id=$ID&format=toml" +else + API="$BASE_URL/api/theme?id=$INPUT&format=toml" +fi + +mkdir -p "$THEME_DIR/backgrounds" + +echo "Fetching theme..." +TMP=$(mktemp) +if ! curl -fsSL "$API" -o "$TMP"; then + echo "Error: could not fetch theme. The link may be expired (themes last one hour)." + rm -f "$TMP" + exit 1 +fi + +if ! grep -q '^background = ' "$TMP"; then + echo "Error: the response did not look like a valid colors.toml." + rm -f "$TMP" + exit 1 +fi + +mv "$TMP" "$THEME_DIR/colors.toml" + +cat < "$THEME_DIR/neovim.lua" +return { + { + "LazyVim/LazyVim", + opts = { + colorscheme = "tokyonight", + }, + }, +} +EOF + +# Apply the Blob-Dynamic theme (reloads waybar, ags, etc.) +omarchy-theme-set "blob-dynamic" + +echo "Applied shared theme to blob-dynamic." diff --git a/scripts/blob_wallpaper.sh b/scripts/blob_wallpaper.sh index b16a543..e37ba48 100755 --- a/scripts/blob_wallpaper.sh +++ b/scripts/blob_wallpaper.sh @@ -8,7 +8,11 @@ mkdir -p "$WALLPAPER_DIR" mkdir -p "$THEME_DIR/backgrounds" if [ -z "$1" ]; then - # Use walker dmenu for GUI selection + # Open the AGS wallpaper selector widget + ags toggle wall-picker + exit 0 +elif [ "$1" = "--menu" ]; then + # Fallback: walker dmenu selection omarchy-launch-walker -m menus:blobBackgroundSelector --width 800 --minheight 400 -p "Select Wallpaper…" exit 0 else