@kecan0406/ttheme 1.0.48 → 1.1.1

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.48",
2
+ "version": "1.1.1",
3
3
  "gate": [
4
4
  {
5
5
  "rule": "foreground",
@@ -1219,6 +1219,11 @@
1219
1219
  "order": 21,
1220
1220
  "ansiSource": "Rose Pine Dawn + Magica",
1221
1221
  "booru": "kyuubee",
1222
+ "booruSites": {
1223
+ "zerochan": [
1224
+ "kyubee"
1225
+ ]
1226
+ },
1222
1227
  "background": "#fff8f7",
1223
1228
  "foreground": "#1f1c39",
1224
1229
  "cursor": "#b83b64",
@@ -1676,6 +1681,9 @@
1676
1681
  ],
1677
1682
  "yande": [
1678
1683
  "gotou_hitori"
1684
+ ],
1685
+ "zerochan": [
1686
+ "gotou_hitori"
1679
1687
  ]
1680
1688
  },
1681
1689
  "background": "#201517",
@@ -2135,6 +2143,9 @@
2135
2143
  ],
2136
2144
  "yande": [
2137
2145
  "tsukino_usagi"
2146
+ ],
2147
+ "zerochan": [
2148
+ "sailor_moon_(character)"
2138
2149
  ]
2139
2150
  },
2140
2151
  "background": "#1f1518",
@@ -2475,6 +2486,11 @@
2475
2486
  "order": 43,
2476
2487
  "ansiSource": "TokyoNight",
2477
2488
  "booru": "jill_stingray",
2489
+ "booruSites": {
2490
+ "zerochan": [
2491
+ "julianne_stingray"
2492
+ ]
2493
+ },
2478
2494
  "background": "#15181e",
2479
2495
  "foreground": "#dee2f2",
2480
2496
  "cursor": "#7aa2f7",
@@ -2532,7 +2548,8 @@
2532
2548
  "ansiSource": "Cyberpunk + Glitch City",
2533
2549
  "booru": "dorothy_haze",
2534
2550
  "booruSites": {
2535
- "konachan": []
2551
+ "konachan": [],
2552
+ "zerochan": []
2536
2553
  },
2537
2554
  "background": "#201515",
2538
2555
  "foreground": "#fbdbdc",
@@ -3286,6 +3303,9 @@
3286
3303
  ],
3287
3304
  "yande": [
3288
3305
  "sans"
3306
+ ],
3307
+ "zerochan": [
3308
+ "sans"
3289
3309
  ]
3290
3310
  },
3291
3311
  "background": "#12181d",
@@ -3347,6 +3367,9 @@
3347
3367
  "booruSites": {
3348
3368
  "yande": [
3349
3369
  "papyrus"
3370
+ ],
3371
+ "zerochan": [
3372
+ "papyrus"
3350
3373
  ]
3351
3374
  },
3352
3375
  "background": "#201512",
@@ -3465,7 +3488,10 @@
3465
3488
  "ansiSource": "Laser",
3466
3489
  "booru": "mettaton",
3467
3490
  "booruSites": {
3468
- "yande": []
3491
+ "yande": [],
3492
+ "zerochan": [
3493
+ "mettaton_ex"
3494
+ ]
3469
3495
  },
3470
3496
  "background": "#1d151b",
3471
3497
  "foreground": "#f3dceb",
@@ -3586,6 +3612,9 @@
3586
3612
  ],
3587
3613
  "yande": [
3588
3614
  "nanakusa_nazuna"
3615
+ ],
3616
+ "zerochan": [
3617
+ "nanakusa_nazuna"
3589
3618
  ]
3590
3619
  },
3591
3620
  "background": "#1e151a",
@@ -3704,7 +3733,10 @@
3704
3733
  "ansiSource": "Birds Of Paradise",
3705
3734
  "booru": "kikyou_seri",
3706
3735
  "booruSites": {
3707
- "konachan": []
3736
+ "konachan": [],
3737
+ "zerochan": [
3738
+ "kikiyou_seri"
3739
+ ]
3708
3740
  },
3709
3741
  "background": "#1e160d",
3710
3742
  "foreground": "#f6dfc6",
@@ -4162,6 +4194,9 @@
4162
4194
  ],
4163
4195
  "yande": [
4164
4196
  "sayori_(doki_doki_literature_club!)"
4197
+ ],
4198
+ "zerochan": [
4199
+ "sayori_(doki_doki_literature_club!)"
4165
4200
  ]
4166
4201
  },
4167
4202
  "background": "#211512",
@@ -4226,6 +4261,9 @@
4226
4261
  ],
4227
4262
  "yande": [
4228
4263
  "natsuki_(doki_doki_literature_club!)"
4264
+ ],
4265
+ "zerochan": [
4266
+ "natsuki_(doki_doki_literature_club!)"
4229
4267
  ]
4230
4268
  },
4231
4269
  "background": "#1f1518",
@@ -4290,6 +4328,9 @@
4290
4328
  ],
4291
4329
  "yande": [
4292
4330
  "yuri_(doki_doki_literature_club!)"
4331
+ ],
4332
+ "zerochan": [
4333
+ "yuri_(doki_doki_literature_club!)"
4293
4334
  ]
4294
4335
  },
4295
4336
  "background": "#1b161d",
@@ -4355,6 +4396,9 @@
4355
4396
  ],
4356
4397
  "yande": [
4357
4398
  "monika_(doki_doki_literature_club!)"
4399
+ ],
4400
+ "zerochan": [
4401
+ "monika_(doki_doki_literature_club!)"
4358
4402
  ]
4359
4403
  },
4360
4404
  "background": "#141911",
@@ -4531,6 +4575,9 @@
4531
4575
  ],
4532
4576
  "yande": [
4533
4577
  "beatrice"
4578
+ ],
4579
+ "zerochan": [
4580
+ "beatrice_(umineko_no_naku_koro_ni)"
4534
4581
  ]
4535
4582
  },
4536
4583
  "background": "#19180d",
@@ -5094,6 +5141,11 @@
5094
5141
  "order": 88,
5095
5142
  "ansiSource": "Mellow",
5096
5143
  "booru": "lucy_(cyberpunk)",
5144
+ "booruSites": {
5145
+ "zerochan": [
5146
+ "lucyna_kushinada"
5147
+ ]
5148
+ },
5097
5149
  "background": "#1e151a",
5098
5150
  "foreground": "#e3e1eb",
5099
5151
  "cursor": "#e29eca",
@@ -5150,6 +5202,11 @@
5150
5202
  "order": 89,
5151
5203
  "ansiSource": "Emerald Synth",
5152
5204
  "booru": "rebecca_(cyberpunk)",
5205
+ "booruSites": {
5206
+ "zerochan": [
5207
+ "rebecca_(cyberpunk:_edgerunners)"
5208
+ ]
5209
+ },
5153
5210
  "background": "#201516",
5154
5211
  "foreground": "#fbdbde",
5155
5212
  "cursor": "#99dfd0",
@@ -6221,7 +6278,10 @@
6221
6278
  "booru": "ryoumen_sukuna_(jujutsu_kaisen)",
6222
6279
  "booruSites": {
6223
6280
  "konachan": [],
6224
- "yande": []
6281
+ "yande": [],
6282
+ "zerochan": [
6283
+ "sukuna"
6284
+ ]
6225
6285
  },
6226
6286
  "background": "#211513",
6227
6287
  "foreground": "#e0e3e6",
@@ -7293,6 +7353,9 @@
7293
7353
  "booruSites": {
7294
7354
  "konachan": [
7295
7355
  "kirigaya_kazuto"
7356
+ ],
7357
+ "zerochan": [
7358
+ "kirigaya_kazuto"
7296
7359
  ]
7297
7360
  },
7298
7361
  "background": "#16171f",
@@ -7357,6 +7420,9 @@
7357
7420
  ],
7358
7421
  "yande": [
7359
7422
  "asuna_(sword_art_online)"
7423
+ ],
7424
+ "zerochan": [
7425
+ "yuuki_asuna"
7360
7426
  ]
7361
7427
  },
7362
7428
  "background": "#1f160d",
@@ -7419,6 +7485,9 @@
7419
7485
  "booruSites": {
7420
7486
  "konachan": [
7421
7487
  "shinon_(sao)"
7488
+ ],
7489
+ "zerochan": [
7490
+ "sinon_(ggo)"
7422
7491
  ]
7423
7492
  },
7424
7493
  "background": "#111916",
@@ -7483,6 +7552,9 @@
7483
7552
  ],
7484
7553
  "yande": [
7485
7554
  "leafa"
7555
+ ],
7556
+ "zerochan": [
7557
+ "lyfa_(alo)"
7486
7558
  ]
7487
7559
  },
7488
7560
  "background": "#141911",
@@ -7541,6 +7613,11 @@
7541
7613
  "order": 131,
7542
7614
  "ansiSource": "Cobalt Next Dark + Aincrad",
7543
7615
  "booru": "alice_zuberg",
7616
+ "booruSites": {
7617
+ "zerochan": [
7618
+ "alice_schuberg"
7619
+ ]
7620
+ },
7544
7621
  "background": "#1b170c",
7545
7622
  "foreground": "#ede2c6",
7546
7623
  "cursor": "#e8d082",
@@ -7603,6 +7680,9 @@
7603
7680
  ],
7604
7681
  "yande": [
7605
7682
  "konno_yuuki"
7683
+ ],
7684
+ "zerochan": [
7685
+ "konno_yuuki"
7606
7686
  ]
7607
7687
  },
7608
7688
  "background": "#1b161d",
@@ -7890,6 +7970,9 @@
7890
7970
  "konachan": [
7891
7971
  "hanzou_urushihara",
7892
7972
  "urushihara_hanzo"
7973
+ ],
7974
+ "zerochan": [
7975
+ "urushihara_hanzo"
7893
7976
  ]
7894
7977
  },
7895
7978
  "background": "#1a161e",
@@ -8299,6 +8382,9 @@
8299
8382
  ],
8300
8383
  "yande": [
8301
8384
  "tet_(no_game_no_life)"
8385
+ ],
8386
+ "zerochan": [
8387
+ "tet_(no_game_no_life)"
8302
8388
  ]
8303
8389
  },
8304
8390
  "background": "#131913",
@@ -8592,6 +8678,9 @@
8592
8678
  ],
8593
8679
  "yande": [
8594
8680
  "hakase"
8681
+ ],
8682
+ "zerochan": [
8683
+ "shinonome_hakase"
8595
8684
  ]
8596
8685
  },
8597
8686
  "background": "#1f160d",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kecan0406/ttheme",
3
- "version": "1.0.48",
3
+ "version": "1.1.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "ttheme": "bin/ttheme.js"
@@ -36,6 +36,7 @@
36
36
  "@material/material-color-utilities": "^0.4.0",
37
37
  "@types/bun": "^1.3.0",
38
38
  "@types/pngjs": "6.0.5",
39
+ "fast-string-width": "^3.0.2",
39
40
  "jpeg-js": "^0.4.4",
40
41
  "pngjs": "7.0.0",
41
42
  "smol-toml": "^1.9.0",
@@ -437,13 +437,13 @@ __tt_pv_bg_find() {
437
437
  err=${${err//$'\n'/ }## #}
438
438
  resized=1 bgname="" bgshown="" bgdim=()
439
439
  if (( rc == 1 )); then
440
- msg=${err:-"find failed for $name"} msgt=300
440
+ msg=${err:-"Find failed for $name"} msgt=300
441
441
  fi
442
442
  (( rc == 0 )) || return 1
443
443
  unset "bgsrc[$name]"
444
444
  __tt_bg_load $name
445
445
  bgload[$name]="" bgedit[$name]=1
446
- msg=${err:-"background · $name"} msgt=200
446
+ msg=${err:-"Background · $name"} msgt=200
447
447
  return 0
448
448
  }
449
449
 
@@ -469,14 +469,14 @@ __tt_pv_bg_image() {
469
469
  unset "bgsrc[$name]"
470
470
  __tt_bg_load $name
471
471
  bgload[$name]="" bgedit[$name]=1
472
- msg=${err:-"background · $name"} msgt=$(( rc ? 300 : 200 ))
472
+ msg=${err:-"Background · $name"} msgt=$(( rc ? 300 : 200 ))
473
473
  [[ -r ${TTHEME_CONFIG:h}/backgrounds/${${name/@/--}/\//--}.conf ]] || return 0
474
474
  tune=$name tf=1 tsnap="${bgsize[$name]} ${bgpos[$name]} ${bgop[$name]} ${bgoff[$name]}"
475
475
  }
476
476
 
477
477
  __tt_pv_bg_panel() {
478
478
  local name=$1 z=$'\e[0m' b=$'\e[1m' d=$'\e[2m' c=$ac val sty REPLY
479
- local -a labs=(size position opacity) at=(0 3 6)
479
+ local -a labs=(Size Position Opacity) at=(0 3 6)
480
480
  local -i r0=$2 col=$3 end=$4 off=${bgoff[$1]} T=$(( $4 - $3 - 19 )) lo=100 hi=100 k i r knob pos=${bgpos[$1]} o
481
481
  (( color )) || z= b= d= c=
482
482
  (( T < 8 )) && T=8
@@ -510,7 +510,7 @@ __tt_pv_bg_panel() {
510
510
  else
511
511
  if (( k == 1 )); then
512
512
  if [[ ${bgsize[$name]} == fill ]]; then
513
- knob=$(( T - 1 )) val=FILL
513
+ knob=$(( T - 1 )) val=fill
514
514
  else
515
515
  knob=$(( (${bgsize[$name]} - lo) * (T - 1) / (hi - lo + 1) )) val=${bgsize[$name]}%
516
516
  fi
@@ -549,12 +549,12 @@ __tt_pv_bg_save() {
549
549
  fi
550
550
  saved+=($name)
551
551
  if [[ ! -r ${TTHEME_CONFIG:h}/backgrounds/${${name/@/--}/\//--}.conf ]]; then
552
- msg="background · $name none"
552
+ msg="Background · $name none"
553
553
  elif (( bgoff[$name] )); then
554
- msg="background · $name off"
554
+ msg="Background · $name off"
555
555
  else
556
556
  __tt_bg_label $name
557
- msg="background · $name $REPLY"
557
+ msg="Background · $name $REPLY"
558
558
  fi
559
559
  if __tt_color; then
560
560
  printf '\033[2m%s\033[0m\n' "$msg"
package/shell/ttheme.zsh CHANGED
@@ -89,6 +89,8 @@ __tt_pins_load
89
89
 
90
90
  : ${TTHEME_SORT:=abc}
91
91
 
92
+ : ${TTHEME_BG_BLUR:=0}
93
+
92
94
  typeset -g TTHEME_STATE_DIR=${XDG_STATE_HOME:-$HOME/.local/state}/ttheme
93
95
 
94
96
  if [[ $TERM_PROGRAM == WarpTerminal ]]; then
@@ -400,9 +402,9 @@ __tt_pin_save() {
400
402
  TTHEME_PIN=$key TTHEME_PIN_SPEC=${TTHEME_PALETTE[$name]}
401
403
  __tt_tilde "$key"
402
404
  if __tt_color; then
403
- printf '\033[2mpinned · %s → %s\033[0m\n' "$REPLY" "$name"
405
+ printf '\033[2mPinned · %s → %s\033[0m\n' "$REPLY" "$name"
404
406
  else
405
- print -r -- "pinned · $REPLY → $name"
407
+ print -r -- "Pinned · $REPLY → $name"
406
408
  fi
407
409
  }
408
410
 
@@ -418,9 +420,9 @@ __tt_unpin() {
418
420
  __tt_dir_sync
419
421
  __tt_tilde "$key"
420
422
  if __tt_color; then
421
- printf '\033[2munpinned · %s\033[0m\n' "$REPLY"
423
+ printf '\033[2mUnpinned · %s\033[0m\n' "$REPLY"
422
424
  else
423
- print -r -- "unpinned · $REPLY"
425
+ print -r -- "Unpinned · $REPLY"
424
426
  fi
425
427
  return 0
426
428
  done
@@ -472,7 +474,7 @@ __tt_menu() {
472
474
  for k in $reply; do
473
475
  grp=${TTHEME_GROUP[$k]:-Other}
474
476
  if [[ $grp != $last_grp ]]; then
475
- [[ $grp == *@* && $last_grp != *@* && -n $last_grp ]] && printf ' \033[2m── markets ──────────\033[0m\n'
477
+ [[ $grp == *@* && $last_grp != *@* && -n $last_grp ]] && printf ' \033[2m── Markets ──────────\033[0m\n'
476
478
  printf ' \033[1m%s\033[0m' "$grp"
477
479
  [[ -n ${TTHEME_NATIVE[$k]} ]] && printf ' \033[2m%s\033[0m' "${TTHEME_NATIVE[$k]}"
478
480
  printf '\n'
@@ -535,7 +537,7 @@ __tt_cli() {
535
537
  __tt_catalog() {
536
538
  local was
537
539
  __tt_cli "$@" || return
538
- [[ $1 == (list|share|market) ]] && return 0
540
+ [[ $1 == (list|share) ]] && return 0
539
541
  [[ -r $TTHEME_HOME/palettes.zsh ]] || return 0
540
542
  was="$TTHEME_STARTUP ${TTHEME_PALETTE[$TTHEME_STARTUP]}"
541
543
  __tt_palettes_load && __tt_reloaded
@@ -562,12 +564,25 @@ __tt_switch() {
562
564
  }
563
565
 
564
566
  __tt_config() {
567
+ local blur
565
568
  if [[ ! -e $TTHEME_CONFIG ]]; then
566
569
  mkdir -p ${TTHEME_CONFIG:h} || return 1
567
570
  print -r -- "$TTHEME_CONFIG_TEMPLATE" > $TTHEME_CONFIG
568
571
  fi
572
+ blur=${(M)${(@f)"$(<$TTHEME_CONFIG)"}:#': ${TTHEME_BG_BLUR:='*}
569
573
  ${=${VISUAL:-${EDITOR:-vi}}} $TTHEME_CONFIG || return
570
- print -r -- "settings apply in new tabs — $TTHEME_CONFIG"
574
+ [[ ${(M)${(@f)"$(<$TTHEME_CONFIG)"}:#': ${TTHEME_BG_BLUR:='*} == "$blur" ]] || __tt_redraw
575
+ print -r -- "Settings apply in new tabs — $TTHEME_CONFIG"
576
+ }
577
+
578
+ __tt_redraw() {
579
+ local out
580
+ out=$(__tt_cli redraw 2>&1) || { [[ -n $out ]] && print -ru2 -- "$out"; return 1 }
581
+ [[ -n $out ]] || return 0
582
+ print -r -- "$out"
583
+ __tt_reload
584
+ (( $+functions[__tt_bg_refresh] )) && __tt_bg_refresh $TTHEME_ORDER
585
+ return 0
571
586
  }
572
587
 
573
588
  __tt_config_line() {
@@ -624,11 +639,11 @@ __tt_resolve() {
624
639
  return 0
625
640
  elif (( ${#m} > 1 )); then
626
641
  m=(${(o)m})
627
- print -u2 "multiple palettes start with '$name': $m"
642
+ print -u2 "ttheme: multiple palettes start with '$name': $m"
628
643
  elif m=(${(o)${(M)${(k)TTHEME_PALETTE}:#*$name*}}) && (( ${#m} )); then
629
- print -u2 "unknown palette '$name' — did you mean: ${(j:, :)m[1,3]}?"
644
+ print -u2 "ttheme: unknown palette '$name' — did you mean: ${(j:, :)m[1,3]}?"
630
645
  else
631
- print -u2 "unknown palette '$name' — run \`ttheme\` to list palettes"
646
+ print -u2 "ttheme: unknown palette '$name' — run \`ttheme\` to list palettes"
632
647
  fi
633
648
  return 1
634
649
  }
@@ -808,7 +823,7 @@ __tt_pv_row() {
808
823
  (( color )) && on=$sb
809
824
  fi
810
825
  if [[ ${rtype[$1]} == rule ]]; then
811
- name='── markets '
826
+ name='── Markets '
812
827
  REPLY=" "$d$name${(l:lw - 4 - ${#name}::─:)}$z
813
828
  return 0
814
829
  fi
@@ -878,9 +893,9 @@ __tt_pv_foot() {
878
893
  note=$REPLY
879
894
  (( pk == 2 )) && note+="/**"
880
895
  elif (( pk == 1 )); then
881
- note="until this tab closes"
896
+ note="Until this tab closes"
882
897
  else
883
- note="new tabs · the default palette"
898
+ note="New tabs · the default palette"
884
899
  fi
885
900
  kk=(enter) kl=(confirm)
886
901
  right=$b"esc"$z$d" back"$z
@@ -977,19 +992,19 @@ __tt_pv_foot() {
977
992
  __tt_pv_help() {
978
993
  local back="the tab" z=$'\e[0m' b=$'\e[1m' blank
979
994
  [[ -n ${TTHEME_PALETTE[$cn]} ]] && back=$cn
980
- local -a hk=(move series filter apply) hv=(
995
+ local -a hk=(Move Series Filter Apply) hv=(
981
996
  "↑↓ home end pgup pgdn"
982
997
  "←→ · enter or space on a series"
983
998
  "a-z 0-9 - · bksp · ctrl-u clears"
984
999
  "enter · esc restores $back"
985
1000
  )
986
1001
  if (( bgcw )); then
987
- hk+=("tune bg" "" "" "" "")
1002
+ hk+=("Tune bg" "" "" "" "")
988
1003
  hv+=("tab · finds one on the boorus, or takes your own, if none" "↑↓ field ←→ step ⇧←→ ×10 1-9 place" "space hides · = default · f adds one from the boorus or your own" "enter keeps · esc undoes" ", . other saved images · D removes this one")
989
1004
  fi
990
- hk+=(config "")
1005
+ hk+=(Config "")
991
1006
  hv+=("alt-c · ↑↓ setting ←→ value" "enter saves · esc undoes")
992
- hk+=(close)
1007
+ hk+=(Close)
993
1008
  hv+=("? esc")
994
1009
  (( color )) || z= b=
995
1010
  local -i i r x y w hh
@@ -1005,7 +1020,7 @@ __tt_pv_help() {
1005
1020
  x=$(( (pw - w) / 2 + 1 )) y=$(( (ph - hh) / 2 ))
1006
1021
  (( y < 4 )) && y=4
1007
1022
  blank=${(l:w:: :)}
1008
- out+=$'\e['$y';'$x'H'"╭─ keys ${(l:$(( w - 9 ))::─:)}╮"
1023
+ out+=$'\e['$y';'$x'H'"╭─ Keys ${(l:$(( w - 9 ))::─:)}╮"
1009
1024
  for (( r = y + 1; r < y + hh - 1; r++ )); do
1010
1025
  out+=$'\e['$r';'$x'H'$blank$'\e['$r';'$x'H│'$'\e['$r';'$(( x + w - 1 ))'H│'
1011
1026
  done
@@ -1089,7 +1104,7 @@ __tt_pv_tune() {
1089
1104
  ;;
1090
1105
  $'\r'|$'\n')
1091
1106
  if [[ "${bgsize[$tune]} ${bgpos[$tune]} ${bgop[$tune]} ${bgoff[$tune]}" != "$tsnap" ]]; then
1092
- bgedit[$tune]=1 msg="kept · saved when preview closes" msgt=200
1107
+ bgedit[$tune]=1 msg="Kept · saved when preview closes" msgt=200
1093
1108
  fi
1094
1109
  tune=""
1095
1110
  ;;
@@ -1169,13 +1184,33 @@ __tt_pv_conf_save() {
1169
1184
  fi
1170
1185
  __tt_tilde "$TTHEME_CONFIG"
1171
1186
  if __tt_config_write "${pairs[@]}"; then
1172
- conf=0 msg="saved · $REPLY" msgt=200
1187
+ conf=0 msg="Saved · $REPLY" msgt=200
1188
+ (( ${pairs[(Ie)TTHEME_BG_BLUR]} )) && __tt_pv_redraw
1173
1189
  else
1174
1190
  __tt_pv_unconf
1175
- msg="could not write $REPLY" msgt=200
1191
+ msg="Could not write $REPLY" msgt=200
1176
1192
  fi
1177
1193
  }
1178
1194
 
1195
+ __tt_pv_redraw() {
1196
+ local name out
1197
+ if (( $+functions[__tt_bg_write] )); then
1198
+ for name in ${(k)bgedit}; do
1199
+ __tt_bg_write $name
1200
+ done
1201
+ fi
1202
+ bgedit=()
1203
+ msg="Drawing the background pictures again" msgt=300
1204
+ printf '\e[?2026h'
1205
+ __tt_pv_draw
1206
+ __tt_pv_bg_close
1207
+ out=$(__tt_cli redraw 2>&1)
1208
+ bgsrc=() resized=1 bgname="" bgshown="" bgdim=()
1209
+ __tt_reload
1210
+ (( $+functions[__tt_bg_refresh] )) && __tt_bg_refresh $TTHEME_ORDER
1211
+ msg=${${out//$'\n'/ }:-"Saved · no background pictures to draw"} msgt=300
1212
+ }
1213
+
1179
1214
  __tt_pv_conf_panel() {
1180
1215
  local z=$'\e[0m' b=$'\e[1m' d=$'\e[2m' c=$ac on=$'\e[7;1m'$ac var v note
1181
1216
  local -a ch sh
@@ -1219,7 +1254,7 @@ __tt_pv_conf_panel() {
1219
1254
  done
1220
1255
  done
1221
1256
  var=${cvars[cf]}
1222
- note=${cnote[${(P)var}]}
1257
+ note=${cnote[$var:${(P)var}]}
1223
1258
  [[ -n $note ]] && out+=$'\e['$(( r0 + ${#cvars} + 1 ))';'$col'H'$d${note[1,end-col+1]}$z
1224
1259
  return 0
1225
1260
  }
@@ -1272,7 +1307,7 @@ __tt_pv_draw() {
1272
1307
  if (( pw < 40 || ph < 12 )); then
1273
1308
  line="ttheme preview"
1274
1309
  (( color )) && line=$'\e[1m'$ac$line$'\e[0m'
1275
- out+=$line$'\e[K\n'"needs 40×12 — now ${pw}×${ph}"$'\e[K\n'
1310
+ out+=$line$'\e[K\n'"Needs 40×12 — now ${pw}×${ph}"$'\e[K\n'
1276
1311
  line="esc quits"
1277
1312
  (( color )) && line=$'\e[2m'$line$'\e[0m'
1278
1313
  out+=$line$'\e[K\e[J'
@@ -1305,7 +1340,7 @@ __tt_pv_draw() {
1305
1340
  ex="${ex[1,gkeep]}▏"
1306
1341
  fi
1307
1342
  fi
1308
- line=" "$dd"search… e.g. $ex"$zz
1343
+ line=" "$dd"Search… e.g. $ex"$zz
1309
1344
  fi
1310
1345
  local tail=$'\e['$(( lw - ${#cnt} ))'G'$dd$cnt$zz
1311
1346
  [[ -n $flt ]] && tail=$'\e['$(( lw - ${#cnt} ))'G'$cnt
@@ -1322,7 +1357,7 @@ __tt_pv_draw() {
1322
1357
  line=""
1323
1358
  if (( k < h )); then
1324
1359
  if (( ! N )); then
1325
- (( k == 0 )) && line=" ${dd}no palettes match '$flt'$zz"
1360
+ (( k == 0 )) && line=" ${dd}No palettes match '$flt'$zz"
1326
1361
  elif (( i <= N )); then
1327
1362
  __tt_pv_row $i
1328
1363
  line=$REPLY
@@ -1335,20 +1370,20 @@ __tt_pv_draw() {
1335
1370
  __tt_pv_foot $(( split ? se : pw ))
1336
1371
  if (( split )); then
1337
1372
  if (( help && sw >= 48 )); then
1338
- __tt_pv_head 1 $sc $se keys
1373
+ __tt_pv_head 1 $sc $se Keys
1339
1374
  __tt_pv_help
1340
1375
  elif [[ -n $tune ]]; then
1341
1376
  (( bgoff[$tune] )) && state=off
1342
- src=background
1377
+ src=Background
1343
1378
  [[ -n ${bgfrom[$tune]} ]] && src+=" · ${bgfrom[$tune]}"
1344
- (( ${#tune} + ${#src} + 6 > sw )) && src=background
1379
+ (( ${#tune} + ${#src} + 6 > sw )) && src=Background
1345
1380
  __tt_pv_head 1 $sc $se $tune "$src" $state
1346
1381
  __tt_pv_bg_panel $tune 4 $sc $se
1347
1382
  elif (( conf )); then
1348
1383
  __tt_tilde "$TTHEME_CONFIG"
1349
1384
  src=$REPLY
1350
1385
  (( 8 + ${#src} > sw )) && src=""
1351
- __tt_pv_head 1 $sc $se config "" "$src"
1386
+ __tt_pv_head 1 $sc $se Config "" "$src"
1352
1387
  __tt_pv_conf_panel 4 $sc $se
1353
1388
  else
1354
1389
  [[ -n $an ]] && src=${TTHEME_SRC[$an]}
@@ -1360,13 +1395,13 @@ __tt_pv_draw() {
1360
1395
  else
1361
1396
  if [[ -n $tune ]]; then
1362
1397
  (( bgoff[$tune] )) && state=off
1363
- src=background
1398
+ src=Background
1364
1399
  [[ -n ${bgfrom[$tune]} ]] && src+=" · ${bgfrom[$tune]}"
1365
- (( ${#tune} + ${#src} + 6 > lw )) && src=background
1400
+ (( ${#tune} + ${#src} + 6 > lw )) && src=Background
1366
1401
  __tt_pv_head $(( ph - 9 )) 1 $lw $tune "$src" $state
1367
1402
  __tt_pv_bg_panel $tune $(( ph - 8 )) 1 $lw
1368
1403
  elif (( conf )); then
1369
- __tt_pv_head $(( ph - 7 )) 1 $lw config
1404
+ __tt_pv_head $(( ph - 7 )) 1 $lw Config
1370
1405
  __tt_pv_conf_panel $(( ph - 6 )) 1 $lw
1371
1406
  fi
1372
1407
  (( help )) && __tt_pv_help
@@ -1592,7 +1627,7 @@ __tt_pv_handle() {
1592
1627
  elif __tt_pv_bg_findable $name; then
1593
1628
  :
1594
1629
  elif (( bgcw )); then
1595
- msg="no background image for $name" msgt=200
1630
+ msg="No background image for $name" msgt=200
1596
1631
  fi
1597
1632
  ;;
1598
1633
  altc)
@@ -1637,16 +1672,19 @@ __tt_preview() {
1637
1672
  local -a bgorder=()
1638
1673
  local -A bgfrom=() bgsent=() bgcost=() bgdim=() bgsrc=() bgfill=() bgfocus=() bgsize=() bgpos=() bgop=() bgdef=() bgoff=() bgbase=() bgload=() bgshot=() bgshotkey=() bgedit=() bgtunef=() bgofff=() bgimages=()
1639
1674
  local conf=0 cf=1
1640
- local -a plabel=(" this tab " " default ") csnap=()
1641
- local -a cvars=(TTHEME_TAB_PALETTE TTHEME_ANNOUNCE TTHEME_FX TTHEME_SORT) clabel=("new tabs" announce "search fx" sort)
1642
- local -a cchoice=("off seq" "1 0" "typewriter decode glitch" "abc series") cshow=("off seq" "on off" "typewriter decode glitch" "abc series")
1675
+ local -a plabel=(" This tab " " Default ") csnap=()
1676
+ local -a cvars=(TTHEME_TAB_PALETTE TTHEME_ANNOUNCE TTHEME_FX TTHEME_SORT TTHEME_BG_BLUR) clabel=("New tabs" Announce "Search fx" Sort Blur)
1677
+ local -a cchoice=("off seq" "1 0" "typewriter decode glitch" "abc series" "0 1 2 3 4") cshow=("off seq" "on off" "typewriter decode glitch" "abc series" "off 1px 2px 3px 4px")
1643
1678
  local -A cnote=(
1644
- seq "new tabs rotate through palettes" off "new tabs keep the terminal theme"
1645
- 1 "shows the palette notice" 0 "silences the palette notice"
1646
- typewriter "the search hint types itself" decode "the search hint decodes" glitch "the search hint glitches in"
1647
- abc "series and palettes by name" series "series in the order added"
1679
+ TTHEME_TAB_PALETTE:seq "New tabs rotate through palettes" TTHEME_TAB_PALETTE:off "New tabs keep the terminal theme"
1680
+ TTHEME_ANNOUNCE:1 "Shows the palette notice" TTHEME_ANNOUNCE:0 "Silences the palette notice"
1681
+ TTHEME_FX:typewriter "The search hint types itself" TTHEME_FX:decode "The search hint decodes" TTHEME_FX:glitch "The search hint glitches in"
1682
+ TTHEME_SORT:abc "Series and palettes by name" TTHEME_SORT:series "Series in the order added"
1683
+ TTHEME_BG_BLUR:0 "Pictures stay sharp" TTHEME_BG_BLUR:1 "Pictures soften a little behind the text"
1684
+ TTHEME_BG_BLUR:2 "Pictures soften behind the text" TTHEME_BG_BLUR:3 "Pictures blur behind the text"
1685
+ TTHEME_BG_BLUR:4 "Pictures blur well behind the text"
1648
1686
  )
1649
- [[ $mode == pin ]] && pkdef=2 plabel=(" this directory " " and below ")
1687
+ [[ $mode == pin ]] && pkdef=2 plabel=(" This directory " " And below ")
1650
1688
  [[ $mode == init ]] && pkdef=2
1651
1689
  __tt_pv_canpick
1652
1690
  __tt_pv_size
@@ -1791,9 +1829,11 @@ if (( $+functions[compdef] )); then
1791
1829
  compadd -- add remove search init
1792
1830
  elif [[ $words[2] == market && $words[3] == (add|init) && CURRENT == 4 ]]; then
1793
1831
  _files -/
1832
+ elif [[ $words[2] == add && $words[CURRENT-1] == --market ]]; then
1833
+ _files -/
1794
1834
  elif [[ $words[2] == add ]]; then
1795
1835
  reply=(${${${(M)${(f)"$(__tt_cli list --json 2>/dev/null)"}:#*\"name\": *}#*\"name\": \"}%%\"*})
1796
- compadd -- ${reply:|TTHEME_ORDER}
1836
+ compadd -- --market ${reply:|TTHEME_ORDER}
1797
1837
  fi
1798
1838
  }
1799
1839
  compdef __tt_complete ttheme