@kecan0406/ttheme 1.0.44 → 1.0.45

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.44",
2
+ "version": "1.0.45",
3
3
  "gate": [
4
4
  {
5
5
  "rule": "foreground",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kecan0406/ttheme",
3
- "version": "1.0.44",
3
+ "version": "1.0.45",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "ttheme": "bin/ttheme.js"
@@ -6,7 +6,7 @@ __tt_ghostty_shown() {
6
6
  [[ -r $f ]] || return 1
7
7
  REPLY=${${"$(<$f)"}##*\?}
8
8
  REPLY=${REPLY%.conf}
9
- REPLY=${REPLY/--/@}
9
+ REPLY=${${REPLY/--/@}/--//}
10
10
  }
11
11
 
12
12
  __tt_put() {
@@ -92,7 +92,7 @@ __tt_bg_path() {
92
92
  }
93
93
 
94
94
  __tt_bg_load() {
95
- local name=$1 file=${1/@/--} dir=${TTHEME_CONFIG:h}/backgrounds img="" fit=contain op=1 pos=center f line stem="" size=100 REPLY
95
+ local name=$1 file=${${1/@/--}/\//--} dir=${TTHEME_CONFIG:h}/backgrounds img="" fit=contain op=1 pos=center f line stem="" size=100 REPLY
96
96
  local -i at=5
97
97
  local -a fills lines
98
98
  (( ${+bgsrc[$name]} )) && return 0
@@ -189,7 +189,7 @@ __tt_bg_bake() {
189
189
  }
190
190
 
191
191
  __tt_bg_include() {
192
- local file=${1/@/--}
192
+ local file=${${1/@/--}/\//--}
193
193
  local conf=${TTHEME_CONFIG:h}/backgrounds/$file.conf line
194
194
  local -a lines=() add=()
195
195
  [[ -r $conf ]] && lines=("${(@f)$(<$conf)}")
@@ -205,7 +205,7 @@ __tt_bg_write() {
205
205
  local pos=${TTHEME_BG_POSITIONS[${bgpos[$1]}]}
206
206
  local -i W=$(( (pw + 2 * bgmx) * bgcw )) H=$(( (ph + 2 * bgmy) * bgch ))
207
207
  local -a wh fr
208
- [[ -r $dir/${name/@/--}.conf ]] || return 0
208
+ [[ -r $dir/${${name/@/--}/\//--}.conf ]] || return 0
209
209
  __tt_bg_include $name || return 1
210
210
  if [[ "$size ${bgpos[$1]} ${bgop[$1]}" == "${bgdef[$1]}" ]]; then
211
211
  rm -f -- $dir/${bgtunef[$1]}
@@ -449,7 +449,7 @@ __tt_pv_bg_image() {
449
449
  __tt_bg_load $name
450
450
  bgload[$name]="" bgedit[$name]=1
451
451
  msg=${err:-"background · $name"} msgt=$(( rc ? 300 : 200 ))
452
- [[ -r ${TTHEME_CONFIG:h}/backgrounds/${name/@/--}.conf ]] || return 0
452
+ [[ -r ${TTHEME_CONFIG:h}/backgrounds/${${name/@/--}/\//--}.conf ]] || return 0
453
453
  tune=$name tf=1 tsnap="${bgsize[$name]} ${bgpos[$name]} ${bgop[$name]} ${bgoff[$name]}"
454
454
  }
455
455
 
@@ -527,7 +527,7 @@ __tt_pv_bg_save() {
527
527
  continue
528
528
  fi
529
529
  saved+=($name)
530
- if [[ ! -r ${TTHEME_CONFIG:h}/backgrounds/${name/@/--}.conf ]]; then
530
+ if [[ ! -r ${TTHEME_CONFIG:h}/backgrounds/${${name/@/--}/\//--}.conf ]]; then
531
531
  msg="background · $name none"
532
532
  elif (( bgoff[$name] )); then
533
533
  msg="background · $name off"
@@ -22,9 +22,9 @@ __tt_shown() {
22
22
  __tt_bg_shown
23
23
  was=$REPLY
24
24
  [[ $was == $1 ]] && return 1
25
- [[ -r $dir/${1/@/--}.conf || ( -n $was && -r $dir/${was/@/--}.conf ) ]] || return 1
25
+ [[ -r $dir/${${1/@/--}/\//--}.conf || ( -n $was && -r $dir/${${was/@/--}/\//--}.conf ) ]] || return 1
26
26
  [[ -d $dir ]] || mkdir -p $dir || return 1
27
- __tt_put $dir/shown.conf "config-file = ?${1/@/--}.conf"
27
+ __tt_put $dir/shown.conf "config-file = ?${${1/@/--}/\//--}.conf"
28
28
  }
29
29
 
30
30
  __tt_bg_cells() {
@@ -20,7 +20,7 @@ __tt_shown() {
20
20
  __tt_bg_shown
21
21
  was=$REPLY
22
22
  [[ $2 != force && $was == $1 ]] && return 1
23
- [[ -r $dir/${1/@/--}.conf || ( -n $was && -r $dir/${was/@/--}.conf ) ]] || (( TTHEME_MUXED )) || return 1
23
+ [[ -r $dir/${${1/@/--}/\//--}.conf || ( -n $was && -r $dir/${${was/@/--}/\//--}.conf ) ]] || (( TTHEME_MUXED )) || return 1
24
24
  (( ${TTHEME_ORDER[(Ie)$1]} )) || return 1
25
25
  __tt_out $'\e]1337;SetProfile=ttheme · '$1$'\a'
26
26
  TTHEME_ITERM_SHOWN=$1
package/shell/ttheme.zsh CHANGED
@@ -404,6 +404,7 @@ __tt_menu() {
404
404
  for k in $reply; do
405
405
  grp=${TTHEME_GROUP[$k]:-Other}
406
406
  if [[ $grp != $last_grp ]]; then
407
+ [[ $grp == *@* && $last_grp != *@* && -n $last_grp ]] && printf '\033[2m── markets ──────────\033[0m\n'
407
408
  printf '\033[1m%s\033[0m' "$grp"
408
409
  [[ -n ${TTHEME_NATIVE[$k]} ]] && printf ' \033[2m%s\033[0m' "${TTHEME_NATIVE[$k]}"
409
410
  printf '\n'
@@ -589,7 +590,7 @@ __tt_rotate() {
589
590
 
590
591
  __tt_pv_rows() {
591
592
  rtype=() rval=() rcnt=()
592
- local g t gm
593
+ local g t gm ruled=""
593
594
  local -a ts
594
595
  for g in $groups; do
595
596
  ts=()
@@ -599,6 +600,10 @@ __tt_pv_rows() {
599
600
  [[ -z $flt || -n $gm || $t == *$flt* ]] && ts+=($t)
600
601
  done
601
602
  [[ -n $flt ]] && (( ! ${#ts} )) && continue
603
+ if [[ $g == *@* && -z $ruled ]]; then
604
+ ruled=1
605
+ (( ${#rtype} )) && { rtype+=(rule); rval+=(''); rcnt+=(0) }
606
+ fi
602
607
  rtype+=(hdr); rval+=($g); rcnt+=(${#ts})
603
608
  if [[ -n $flt || -n ${exp[$g]} ]]; then
604
609
  for t in $ts; do rtype+=(thm); rval+=($t); rcnt+=(0); done
@@ -733,6 +738,11 @@ __tt_pv_row() {
733
738
  local -i w
734
739
  (( color )) || b= d= r= z= lead=
735
740
  (( $1 == cur && color )) && on=$sb
741
+ if [[ ${rtype[$1]} == rule ]]; then
742
+ name='── markets '
743
+ REPLY=$d$name${(l:lw - 2 - ${#name}::─:)}$z
744
+ return 0
745
+ fi
736
746
  if [[ ${rtype[$1]} == hdr ]]; then
737
747
  [[ -n $flt || -n ${exp[$t]} ]] && arrow=▾
738
748
  name=$t
@@ -1479,8 +1489,8 @@ __tt_pv_handle() {
1479
1489
  __tt_pv_toggle
1480
1490
  fi
1481
1491
  ;;
1482
- up) (( cur > 1 )) && cur=$(( cur - 1 )) ;;
1483
- down) (( cur < ${#rval} )) && cur=$(( cur + 1 )) ;;
1492
+ up) (( cur > 1 )) && cur=$(( cur - 1 )); [[ ${rtype[cur]} == rule ]] && cur=$(( cur - 1 )) ;;
1493
+ down) (( cur < ${#rval} )) && cur=$(( cur + 1 )); [[ ${rtype[cur]} == rule ]] && cur=$(( cur + 1 )) ;;
1484
1494
  right) [[ ${rtype[cur]} == hdr && -z ${exp[${rval[cur]}]} ]] && __tt_pv_toggle ;;
1485
1495
  left) __tt_pv_left ;;
1486
1496
  home) cur=1 ;;
@@ -1488,11 +1498,13 @@ __tt_pv_handle() {
1488
1498
  pgup)
1489
1499
  cur=$(( cur - ph + 5 ))
1490
1500
  (( cur < 1 )) && cur=1
1501
+ [[ ${rtype[cur]} == rule ]] && cur=$(( cur - 1 ))
1491
1502
  ;;
1492
1503
  pgdn)
1493
1504
  cur=$(( cur + ph - 5 ))
1494
1505
  (( cur > ${#rval} )) && cur=${#rval}
1495
1506
  (( cur < 1 )) && cur=1
1507
+ [[ ${rtype[cur]} == rule ]] && cur=$(( cur + 1 ))
1496
1508
  ;;
1497
1509
  ' ') [[ ${rtype[cur]} == hdr ]] && __tt_pv_toggle ;;
1498
1510
  $'\t')