Files
dotfiles/dotfiles/config/taffybar/scripts/taffybar-screenshot
Ivan Malison 29f5f6baa4 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
2026-02-05 12:01:30 -08:00

17 lines
485 B
Bash
Executable File

#!/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"