Files
imladris/configs/omarchy/bin/omarchy-theme-bg-set
kyle 3e564d57db Add Omarchy-style Hyprland desktop for straylight
Ports the classic dotfiles Omarchy setup to a no-home-manager NixOS
system module (configs/omarchy.nix), scoped to straylight only so the
other desktop hosts keep i3.

- Hyprland (programs.hyprland) becomes the default lightdm session; i3
  stays enabled and selectable as a fallback.
- Omarchy config layout under ~/.config/{hypr,waybar,rofi,wlogout,
  swayosd,alacritty} symlinked from the store; mutable theme/wallpaper
  state in ~/.config/omarchy/current.
- omarchy-dots generates 8 themes (hyprland/hyprlock/waybar/rofi/
  swayosd/wlogout/alacritty/mako colour files) from each theme's
  palette, with wallpapers fetched from the Omarchy v3.8.4 tag.
- Helper scripts: omarchy-theme-set/bg-next/bg-set/apply, omarchy-menu
  (rofi power/theme/background menus), waybar toggle, screenshot, lock.
- Shared desktop modules (desktop.nix / desktop-light.nix) untouched.
2026-10-14 01:18:23 -07:00

24 lines
762 B
Bash

#!/usr/bin/env bash
# Set the background for the current theme to a given image path.
set -euo pipefail
OMARCHY_PATH="${OMARCHY_PATH:-$HOME/.local/share/omarchy}"
CURRENT="$HOME/.config/omarchy/current"
[ -n "${1:-}" ] && [ -f "$1" ] || { echo "Usage: omarchy-theme-bg-set <path-to-image>" >&2; exit 1; }
bg="$(realpath "$1")"
name="$(cat "$CURRENT/theme.name" 2>/dev/null || true)"
if [ -n "$name" ] && [ "$(dirname "$bg")" = "$OMARCHY_PATH/themes/$name/backgrounds" ]; then
basename "$bg" >"$CURRENT/background.name"
ln -sfn "$bg" "$CURRENT/background"
else
rm -f "$CURRENT/background.name"
ln -sfn "$bg" "$CURRENT/background"
fi
pkill -x swaybg 2>/dev/null || true
sleep 0.1
setsid swaybg -i "$CURRENT/background" -m fill >/dev/null 2>&1 &
exit 0