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:
11
dotfiles/config/taffybar/scripts/taffybar-restart
Executable file
11
dotfiles/config/taffybar/scripts/taffybar-restart
Executable 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"
|
||||
7
dotfiles/config/taffybar/scripts/taffybar-run
Executable file
7
dotfiles/config/taffybar/scripts/taffybar-run
Executable 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
|
||||
16
dotfiles/config/taffybar/scripts/taffybar-screenshot
Executable file
16
dotfiles/config/taffybar/scripts/taffybar-screenshot
Executable 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"
|
||||
17
dotfiles/config/taffybar/scripts/taffybar-screenshot-all
Executable file
17
dotfiles/config/taffybar/scripts/taffybar-screenshot-all
Executable 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
|
||||
Reference in New Issue
Block a user