Initial import: Lua config, trimmed omarchy scripts, theme system
This commit is contained in:
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
# archypr:summary=Apply current Omarchy theme colors to running Foot terminals
|
||||
# archypr:hidden=true
|
||||
|
||||
foot_theme=~/.config/archypr/current/theme/foot.ini
|
||||
|
||||
if [[ ! -f $foot_theme ]] || ! pgrep -x foot >/dev/null; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
foot_osc=$(awk -F= '
|
||||
function color(value) { return "#" value }
|
||||
/^foreground=/ { printf "\033]10;%s\007", color($2) }
|
||||
/^background=/ { printf "\033]11;%s\007", color($2) }
|
||||
/^cursor=/ { split($2, parts, " "); printf "\033]12;%s\007", color(parts[2]) }
|
||||
/^selection-background=/ { printf "\033]17;%s\007", color($2) }
|
||||
/^selection-foreground=/ { printf "\033]19;%s\007", color($2) }
|
||||
/^regular[0-7]=/ { split($1, parts, "regular"); printf "\033]4;%d;%s\007", parts[2], color($2) }
|
||||
/^bright[0-7]=/ { split($1, parts, "bright"); printf "\033]4;%d;%s\007", parts[2] + 8, color($2) }
|
||||
' "$foot_theme")
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user