@kecan0406/ttheme 1.1.5 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/bin/ttheme.js +156 -156
- package/bin/ttheme.js.map +1 -1
- package/dist/manifest.json +1 -1
- package/package.json +1 -1
- package/shell/adapters/_bg.zsh +3 -9
- package/shell/adapters/terminal-app.zsh +4 -1
- package/shell/adapters/wezterm.zsh +58 -8
- package/shell/ttheme.zsh +825 -91
package/dist/manifest.json
CHANGED
package/package.json
CHANGED
package/shell/adapters/_bg.zsh
CHANGED
|
@@ -9,14 +9,6 @@ __tt_ghostty_shown() {
|
|
|
9
9
|
REPLY=${${REPLY/--/@}/--//}
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
__tt_put() {
|
|
13
|
-
local f=$1
|
|
14
|
-
shift
|
|
15
|
-
print -rl -- "$@" > $f.$$ && mv -f -- $f.$$ $f && return 0
|
|
16
|
-
rm -f -- $f.$$
|
|
17
|
-
return 1
|
|
18
|
-
}
|
|
19
|
-
|
|
20
12
|
__tt_bg_saved() {
|
|
21
13
|
local REPLY
|
|
22
14
|
(( ${TTHEME_TERMINALS[(Ie)iterm2]} )) && __tt_cli image $1 tuned
|
|
@@ -27,6 +19,8 @@ __tt_bg_saved() {
|
|
|
27
19
|
|
|
28
20
|
__tt_bg_refresh() { : }
|
|
29
21
|
|
|
22
|
+
__tt_bg_lasting() { : }
|
|
23
|
+
|
|
30
24
|
__tt_bg_aligns() { (( ! ${TTHEME_TERMINALS[(Ie)iterm2]} )) }
|
|
31
25
|
|
|
32
26
|
__tt_bg_frame() {
|
|
@@ -668,7 +662,7 @@ __tt_pv_bg_strip() {
|
|
|
668
662
|
__tt_bg_send $fill
|
|
669
663
|
id=$REPLY
|
|
670
664
|
want="$id $(( r0 + 2 )) $(( x + 1 )) $tc $tr"
|
|
671
|
-
[[ ${bgthumb[$slot]} == "$want" ]] && continue
|
|
665
|
+
__tt_bg_lasting && [[ ${bgthumb[$slot]} == "$want" ]] && continue
|
|
672
666
|
if [[ -n ${bgthumb[$slot]} ]]; then
|
|
673
667
|
printf -v cmd '\e_Ga=d,d=i,i=%d,p=%d,q=2\e\\' ${${=bgthumb[$slot]}[1]} $(( 700000 + slot ))
|
|
674
668
|
buf+=$cmd
|
|
@@ -1,23 +1,73 @@
|
|
|
1
|
-
|
|
1
|
+
source $TTHEME_HOME/adapters/_bg.zsh
|
|
2
|
+
|
|
3
|
+
typeset -g TTHEME_WEZTERM_SHOWN="" TTHEME_WEZTERM_VIEW=""
|
|
2
4
|
|
|
3
5
|
__tt_keepable() { (( ${TTHEME_TERMINALS[(Ie)wezterm]} )) }
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
__tt_wezterm_var() {
|
|
6
8
|
local REPLY
|
|
7
|
-
__tt_b64s "$
|
|
8
|
-
|
|
9
|
+
__tt_b64s "$2"
|
|
10
|
+
__tt_out $'\e]1337;SetUserVar='$1'='$REPLY$'\a'
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
__tt_shown() {
|
|
12
14
|
[[ $2 != force && $TTHEME_WEZTERM_SHOWN == $1 ]] && return 1
|
|
13
15
|
TTHEME_WEZTERM_SHOWN=$1
|
|
14
|
-
|
|
16
|
+
__tt_wezterm_var ttheme_shown $1
|
|
15
17
|
return 1
|
|
16
18
|
}
|
|
17
19
|
|
|
20
|
+
__tt_bg_shown() { REPLY=$TTHEME_WEZTERM_SHOWN }
|
|
21
|
+
|
|
22
|
+
__tt_bg_refresh() { __tt_wezterm_var ttheme_shown $TTHEME_WEZTERM_SHOWN }
|
|
23
|
+
|
|
24
|
+
__tt_bg_lasting() { return 1 }
|
|
25
|
+
|
|
26
|
+
__tt_bg_cells() {
|
|
27
|
+
local REPLY resp
|
|
28
|
+
__tt_ask $'\e[16t' || return 0
|
|
29
|
+
resp=$REPLY
|
|
30
|
+
[[ $resp == *'[6;'<1->';'<1->t ]] || return 0
|
|
31
|
+
resp=${${resp##*\[6;}%t}
|
|
32
|
+
bgch=${resp%;*} bgcw=${resp#*;}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
__tt_pv_bg_findable() { return 1 }
|
|
36
|
+
|
|
18
37
|
__tt_pv_bg_show() {
|
|
19
|
-
|
|
20
|
-
|
|
38
|
+
(( bgcw )) || return 0
|
|
39
|
+
local name=$1 img="" size fit=contain view="" REPLY
|
|
40
|
+
local -i W=$(( pw * bgcw )) H=$(( ph * bgch )) focus=-1
|
|
41
|
+
local -a p=(${=TTHEME_PALETTE[${name%:*}]}) wh
|
|
42
|
+
(( ${#p} >= 20 )) || return 0
|
|
43
|
+
(( $2 )) && TTHEME_WEZTERM_VIEW=-
|
|
44
|
+
bgname=$name
|
|
45
|
+
__tt_bg_load $name
|
|
46
|
+
if [[ $name != "$bginc" || "${bgsize[$name]} ${bgpos[$name]} ${bgop[$name]} ${bgoff[$name]}" != "${bgload[$name]}" ]]; then
|
|
47
|
+
size=${bgsize[$name]}
|
|
48
|
+
if [[ $size == fill ]]; then
|
|
49
|
+
img=${bgfill[$name]} size=100 fit=cover
|
|
50
|
+
elif [[ "$size ${bgpos[$name]}" == "${bgshotkey[$name]}" && -r ${bgshot[$name]} ]]; then
|
|
51
|
+
img=${bgshot[$name]} size=100 fit=cover
|
|
52
|
+
else
|
|
53
|
+
img=${bgsrc[$name]} focus=${bgfocus[$name]}
|
|
54
|
+
fi
|
|
55
|
+
(( bgoff[$name] )) && img=""
|
|
56
|
+
view="$p[1]||1|$W|$H|0|0|0|0|5"
|
|
57
|
+
if [[ -n $img ]] && __tt_bg_dim "$img"; then
|
|
58
|
+
wh=(${=bgdim[$img]})
|
|
59
|
+
__tt_bg_frame $wh[1] $wh[2] $W $H $size ${bgpos[$name]} $fit $focus
|
|
60
|
+
view="$p[1]|$img|${bgop[$name]}|$W|$H|${REPLY// /|}|${bgpos[$name]}"
|
|
61
|
+
fi
|
|
62
|
+
fi
|
|
63
|
+
[[ $view == "$TTHEME_WEZTERM_VIEW" ]] && return 0
|
|
64
|
+
TTHEME_WEZTERM_VIEW=$view
|
|
65
|
+
__tt_wezterm_var ttheme_view "$view"
|
|
21
66
|
}
|
|
22
67
|
|
|
23
|
-
__tt_pv_bg_close() {
|
|
68
|
+
__tt_pv_bg_close() {
|
|
69
|
+
(( bgcw )) && { printf '\e_Ga=d,d=A,q=2\e\\'; __tt_bg_forget }
|
|
70
|
+
[[ -n $TTHEME_WEZTERM_VIEW ]] || return 0
|
|
71
|
+
TTHEME_WEZTERM_VIEW=""
|
|
72
|
+
__tt_wezterm_var ttheme_view ""
|
|
73
|
+
}
|