#!/usr/bin/env bash
# Применить цвета через OSC4 ко всем foot-инстансам
for pts in /dev/pts/[0-9]*; do
  printf '\e]11;#{{colors.surface.default.hex_stripped}}\007' >>"$pts" 2>/dev/null
  printf '\e]10;#{{colors.on_surface.default.hex_stripped}}\007' >>"$pts" 2>/dev/null
  printf '\e]4;0;#{{colors.surface_container_lowest.default.hex_stripped}}\007' >>"$pts" 2>/dev/null
  printf '\e]4;1;#{{colors.error.default.hex_stripped}}\007' >>"$pts" 2>/dev/null
  printf '\e]4;2;#{{colors.tertiary.default.hex_stripped}}\007' >>"$pts" 2>/dev/null
  printf '\e]4;3;#{{colors.secondary.default.hex_stripped}}\007' >>"$pts" 2>/dev/null
  printf '\e]4;4;#{{colors.primary.default.hex_stripped}}\007' >>"$pts" 2>/dev/null
  printf '\e]4;5;#{{colors.secondary_container.default.hex_stripped}}\007' >>"$pts" 2>/dev/null
  printf '\e]4;6;#{{colors.tertiary_container.default.hex_stripped}}\007' >>"$pts" 2>/dev/null
  printf '\e]4;7;#{{colors.on_surface_variant.default.hex_stripped}}\007' >>"$pts" 2>/dev/null
  printf '\e]4;8;#{{colors.surface_container_high.default.hex_stripped}}\007' >>"$pts" 2>/dev/null
  printf '\e]4;9;#{{colors.error_container.default.hex_stripped}}\007' >>"$pts" 2>/dev/null
  printf '\e]4;10;#{{colors.tertiary_container.default.hex_stripped}}\007' >>"$pts" 2>/dev/null
  printf '\e]4;11;#{{colors.secondary_container.default.hex_stripped}}\007' >>"$pts" 2>/dev/null
  printf '\e]4;12;#{{colors.primary_container.default.hex_stripped}}\007' >>"$pts" 2>/dev/null
  printf '\e]4;13;#{{colors.inverse_primary.default.hex_stripped}}\007' >>"$pts" 2>/dev/null
  printf '\e]4;14;#{{colors.tertiary_fixed_dim.default.hex_stripped}}\007' >>"$pts" 2>/dev/null
  printf '\e]4;15;#{{colors.surface_bright.default.hex_stripped}}\007' >>"$pts" 2>/dev/null
done
