taffybar: refresh config and add helpers

- Remove stack config in favor of cabal/flake
- Add helper scripts for running/restarting and screenshots
- Update bar CSS/HS config
This commit is contained in:
2026-02-05 12:01:30 -08:00
committed by Kat Huang
parent 937b1c218c
commit 769fe29de0
9 changed files with 186 additions and 122 deletions

View File

@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -euo pipefail
root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
pkill -u "$USER" -x taffybar || true
cd "$root"
setsid -f direnv exec . cabal run >/tmp/taffybar.log 2>&1
echo "Started taffybar in the background. Logs: /tmp/taffybar.log"

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail
root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$root"
exec direnv exec . cabal run

View File

@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -euo pipefail
monitors="$(hyprctl monitors -j)"
height="$(jq -r '.[] | select(.focused) | .reserved[1]' <<<"$monitors")"
geo="$(jq -r '.[] | select(.focused) | "\(.x),\(.y) \(.width)x\(.reserved[1])"' <<<"$monitors")"
if [[ -z "$geo" || "$height" == "0" ]]; then
echo "No top reserved area found on focused monitor." >&2
echo "Is taffybar reserving space?" >&2
exit 1
fi
out="/tmp/taffybar-$(date +%Y%m%d-%H%M%S).png"
grim -g "$geo" "$out"
echo "$out"

View File

@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -euo pipefail
ts="$(date +%Y%m%d-%H%M%S)"
found="0"
while IFS=$'\t' read -r name geo; do
found="1"
out="/tmp/taffybar-${name}-${ts}.png"
grim -g "$geo" "$out"
echo "$out"
done < <(hyprctl monitors -j | jq -r '.[] | select(.reserved[1] > 0) | "\(.name)\t\(.x),\(.y) \(.width)x\(.reserved[1])"')
if [[ "$found" == "0" ]]; then
echo "No monitors with a top reserved area found." >&2
exit 1
fi