diff options
author | Aditya <bluenerd@protonmail.com> | 2023-02-26 16:56:21 +0530 |
---|---|---|
committer | Aditya <bluenerd@protonmail.com> | 2023-02-26 16:56:21 +0530 |
commit | 5e11af40c6b399a6739918970d734e7205d3eeca (patch) | |
tree | b43d8282f023457902ad3d8c743ad814bfba0c10 /kitty/kitty-themes/.tools/generate_theme_preview.sh | |
parent | 9e49894d0503cfa2d619a5285783c71d500541d0 (diff) |
update kitty config
Diffstat (limited to 'kitty/kitty-themes/.tools/generate_theme_preview.sh')
-rwxr-xr-x | kitty/kitty-themes/.tools/generate_theme_preview.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/kitty/kitty-themes/.tools/generate_theme_preview.sh b/kitty/kitty-themes/.tools/generate_theme_preview.sh new file mode 100755 index 0000000..040867b --- /dev/null +++ b/kitty/kitty-themes/.tools/generate_theme_preview.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +# This script generate all preview images for the themes +# In order to capture previews without the to bar start kitty without decorations +# kitty -o hide_window_decorations=yes + +# shellcheck source=libcapture.sh +source libcapture.sh + +# read theme path from args +id=$1 +theme=$2 +preview_filename=$3 + +conf_filename=$(basename "$theme") + +lockfile=$(mktemp) + +kitty @ set-colors --match id:"$id" "$theme" +kitty @ send-text --match id:"$id" "clear && figlet -f digital -t \"$conf_filename\" && unbuffer ./color_table.sh && rm \"$lockfile\"\n" + +# simple sync mechanism, wait for the lockfile to be removed +( echo "$lockfile" | entr "false" 1>/dev/null 2>&1 ) || capture themes "$preview_filename" |