Files
dotfiles/eww/scripts/get-theme.sh
2026-04-20 20:37:54 +02:00

15 lines
475 B
Bash

#!/usr/bin/env bash
# Wraps your existing theme-cycle.sh to extract a display icon for eww.
# theme-cycle.sh status returns JSON like: {"text":"...","class":"...","tooltip":"..."}
# We parse the "text" field and emit it directly.
RAW=$(bash "$HOME/.config/hypr/theme-cycle.sh" status 2>/dev/null)
# If it's JSON, extract text field
if echo "$RAW" | jq -e . >/dev/null 2>&1; then
echo "$RAW" | jq -r '.text // "󰔎"'
else
# Plain text fallback
echo "${RAW:-󰔎}"
fi