Files
blomarchy/bin/blob-theme-foot
T

21 lines
533 B
Bash
Executable File

#!/bin/bash
# blob:summary=Apply current Blob theme colors to running Foot terminals
# blob:hidden=true
colors_toml=$HOME/.local/state/blob/current/theme/colors.toml
if [[ ! -f $colors_toml ]] || ! pgrep -x foot >/dev/null; then
exit 0
fi
foot_osc=$(blob-theme-osc "$colors_toml")
[[ -n $foot_osc ]] || exit 0
for foot_pid in $(pgrep -x foot); do
for child_pid in $(pgrep -P "$foot_pid"); do
tty=$(readlink "/proc/$child_pid/fd/1" 2>/dev/null)
[[ $tty == /dev/pts/* ]] && printf '%b' "$foot_osc" >"$tty"
done
done