@kecan0406/ttheme 0.1.2 → 0.1.4

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": "0.1.2",
2
+ "version": "0.1.4",
3
3
  "gate": [
4
4
  {
5
5
  "rule": "foreground",
@@ -1,7 +1,7 @@
1
1
  # Generated by `mise run build` — do not edit.
2
2
  # Source of truth: themes/*.toml in the ttheme repo.
3
3
 
4
- typeset -g TTHEME_VERSION=0.1.2
4
+ typeset -g TTHEME_VERSION=0.1.4
5
5
 
6
6
  # seed for `ttheme config` when no config.zsh exists yet
7
7
  typeset -g TTHEME_CONFIG_TEMPLATE='# ttheme settings — exported variables win over this file
@@ -16,7 +16,34 @@ typeset -g TTHEME_CONFIG_TEMPLATE='# ttheme settings — exported variables win
16
16
  : ${TTHEME_FX:=typewriter}
17
17
 
18
18
  # series and palettes in ttheme and preview: abc sorts them by name, series keeps the order they were added (default abc)
19
- : ${TTHEME_SORT:=abc}'
19
+ : ${TTHEME_SORT:=abc}
20
+
21
+ # the ratings find lists, any of safe, questionable and explicit, each booru read in its own rating vocabulary (default safe)
22
+ : ${TTHEME_FIND_RATING:=safe}
23
+
24
+ # the posts find drops by tag: nudity, underwear, both, or none to keep them all (default "nudity underwear")
25
+ : ${TTHEME_FIND_BLOCK:=nudity underwear}
26
+
27
+ # what find lists first: all is every post of the character, cutouts are the transparent ones (default all)
28
+ : ${TTHEME_FIND_POSTS:=all}
29
+
30
+ # the tags find calls a transparent cutout, per site as key=tag,tag pairs — e.g. "safebooru=transparent_background yande=transparent_png,vector" (default the built-in tags)
31
+ : ${TTHEME_FIND_CUTOUTS:=}
32
+
33
+ # the order find lists posts in: newest or score (default newest)
34
+ : ${TTHEME_FIND_ORDER:=newest}
35
+
36
+ # runs of the same picture at the same size from one uploader: fold shows them as one tile, show lists each (default fold)
37
+ : ${TTHEME_FIND_SETS:=fold}
38
+
39
+ # an opaque picture tried on in find: on cuts the character out with macOS Vision, off leaves it as it is (default on)
40
+ : ${TTHEME_FIND_REMOVE_BG:=on}
41
+
42
+ # when a network blocks a booru by name, 1 sends find through a local proxy that splits the TLS handshake (default 0)
43
+ : ${TTHEME_FIND_UNBLOCK:=0}
44
+
45
+ # send a find site somewhere else, as key=https://host pairs — e.g. "konachan=https://konachan.com danbooru=https://danbooru.donmai.us" (default none)
46
+ : ${TTHEME_FIND_HOSTS:=}'
20
47
 
21
48
  typeset -gA TTHEME_PALETTE=(
22
49
  neutral "#17171f #e3e0f3 #cdcdff #3e3c4c #23232b #ca8fb2 #5db9c3 #f7a895 #72a7c9 #c796c8 #65bbe3 #c7c5d0 #777680 #edaed3 #7fdae5 #ffd3c9 #a1c3f2 #dabaf5 #95dbff #eeecfe"
@@ -468,104 +495,3 @@ typeset -gA TTHEME_SRC=(
468
495
  geto "Royal + Jujutsu"
469
496
  sukuna "Hurtado + Jujutsu"
470
497
  )
471
-
472
- # the safebooru tag preview searches when a palette has no background yet
473
- typeset -gA TTHEME_BOORU=(
474
- miku "hatsune_miku"
475
- rin "kagamine_rin"
476
- len "kagamine_len"
477
- luka "megurine_luka"
478
- kaito "kaito_(vocaloid)"
479
- meiko "meiko_(vocaloid)"
480
- asuka "souryuu_asuka_langley"
481
- rei "ayanami_rei"
482
- kaworu "nagisa_kaworu"
483
- misato "katsuragi_misato"
484
- eva01 "eva_01"
485
- madoka "kaname_madoka"
486
- homura "akemi_homura"
487
- sayaka "miki_sayaka"
488
- kyoko "sakura_kyouko"
489
- mami "tomoe_mami"
490
- nagisa "momoe_nagisa"
491
- kyubey "kyuubee"
492
- kurisu "makise_kurisu"
493
- mayuri "shiina_mayuri"
494
- suzuha "amane_suzuha"
495
- konata "izumi_konata"
496
- kagami "hiiragi_kagami"
497
- tsukasa "hiiragi_tsukasa"
498
- miyuki "takara_miyuki"
499
- bocchi "gotoh_hitori"
500
- nijika "ijichi_nijika"
501
- ryo "yamada_ryou"
502
- kita "kita_ikuyo"
503
- hitagi "senjougahara_hitagi"
504
- shinobu "oshino_shinobu"
505
- tsubasa "hanekawa_tsubasa"
506
- nadeko "sengoku_nadeko"
507
- moon "sailor_moon"
508
- mercury "sailor_mercury"
509
- mars "sailor_mars"
510
- jupiter "sailor_jupiter"
511
- venus "sailor_venus"
512
- lain "iwakura_lain"
513
- jill "jill_stingray"
514
- dorothy "dorothy_haze"
515
- alma "alma_armas"
516
- stella "stella_hoshii"
517
- sei "sei_asagiri"
518
- joker "amamiya_ren"
519
- skull "sakamoto_ryuuji"
520
- panther "takamaki_anne"
521
- fox "kitagawa_yuusuke"
522
- queen "niijima_makoto"
523
- oracle "sakura_futaba"
524
- toriel "toriel"
525
- sans "sans_(undertale)"
526
- papyrus "papyrus_(undertale)"
527
- undyne "undyne"
528
- mettaton "mettaton"
529
- nazuna "nanakusa_nazuna"
530
- kou "yamori_kou"
531
- seri "kikyou_seri"
532
- anko "uguisu_anko"
533
- rena "ryuuguu_rena"
534
- mion "sonozaki_mion"
535
- rika "furude_rika"
536
- satoko "houjou_satoko"
537
- sayori "sayori_(doki_doki_literature_club)"
538
- natsuki "natsuki_(doki_doki_literature_club)"
539
- yuri "yuri_(doki_doki_literature_club)"
540
- monika "monika_(doki_doki_literature_club)"
541
- battler "ushiromiya_battler"
542
- beatrice "beatrice_(umineko)"
543
- bernkastel "frederica_bernkastel"
544
- lambdadelta "lambdadelta"
545
- yui "hirasawa_yui"
546
- ritsu "tainaka_ritsu"
547
- mio "akiyama_mio"
548
- mugi "kotobuki_tsumugi"
549
- azusa "nakano_azusa"
550
- david "david_martinez"
551
- lucy "lucy_(cyberpunk)"
552
- rebecca "rebecca_(cyberpunk)"
553
- reimu "hakurei_reimu"
554
- marisa "kirisame_marisa"
555
- cirno "cirno"
556
- youmu "konpaku_youmu"
557
- patchouli "patchouli_knowledge"
558
- flandre "flandre_scarlet"
559
- rikka "takanashi_rikka"
560
- yuuta "togashi_yuuta"
561
- shinka "nibutani_shinka"
562
- dekomori "dekomori_sanae"
563
- kumin "tsuyuri_kumin"
564
- gojo "gojou_satoru"
565
- yuji "itadori_yuuji"
566
- megumi "fushiguro_megumi"
567
- nobara "kugisaki_nobara"
568
- nanami "nanami_kento"
569
- geto "getou_suguru"
570
- sukuna "ryoumen_sukuna_(jujutsu_kaisen)"
571
- )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kecan0406/ttheme",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "ttheme": "bin/ttheme.js"
@@ -30,6 +30,10 @@ __tt_pv_bg_findable() { return 1 }
30
30
 
31
31
  __tt_pv_bg_find() { return 1 }
32
32
 
33
+ __tt_pv_bg_images() { REPLY=1 }
34
+
35
+ __tt_pv_bg_image() { : }
36
+
33
37
  __tt_pv_bg_panel() { : }
34
38
 
35
39
  __tt_pv_bg_close() { : }
@@ -398,7 +398,7 @@ __tt_pv_bg_state() {
398
398
  }
399
399
 
400
400
  __tt_pv_bg_findable() {
401
- (( bgcw )) && [[ -n ${TTHEME_BOORU[$1]} ]]
401
+ (( bgcw ))
402
402
  }
403
403
 
404
404
  __tt_pv_bg_find() {
@@ -420,6 +420,32 @@ __tt_pv_bg_find() {
420
420
  return 0
421
421
  }
422
422
 
423
+ __tt_pv_bg_images() {
424
+ local -a shelf=(${TTHEME_CONFIG:h}/backgrounds/shelf/$1/*(N/))
425
+ REPLY=$(( ${#shelf} + 1 ))
426
+ }
427
+
428
+ __tt_pv_bg_image() {
429
+ local name=$tune act=$1 err REPLY
430
+ local -i rc
431
+ if [[ $act != drop ]]; then
432
+ __tt_pv_bg_images $name
433
+ (( REPLY > 1 )) || { msg="$name has one image" msgt=200; return 0 }
434
+ fi
435
+ __tt_pv_untune
436
+ __tt_pv_bg_close
437
+ err=$(__tt_cli image $name $act 2>&1)
438
+ rc=$?
439
+ err=${${err//$'\n'/ }## #}
440
+ resized=1 bgname="" bgshown="" bgsent=() bgdim=()
441
+ unset "bgsrc[$name]"
442
+ __tt_bg_load $name
443
+ bgload[$name]="" bgedit[$name]=1
444
+ msg=${err:-"background · $name"} msgt=$(( rc ? 300 : 200 ))
445
+ [[ -r ${TTHEME_CONFIG:h}/backgrounds/$name.conf ]] || return 0
446
+ tune=$name tf=1 tsnap="${bgsize[$name]} ${bgpos[$name]} ${bgop[$name]} ${bgoff[$name]}"
447
+ }
448
+
423
449
  __tt_pv_bg_panel() {
424
450
  local name=$1 z=$'\e[0m' b=$'\e[1m' d=$'\e[2m' c=$ac val sty REPLY
425
451
  local -a labs=(size position opacity) at=(0 3 6)
package/shell/ttheme.zsh CHANGED
@@ -292,7 +292,12 @@ __tt_help() {
292
292
  ttheme update refresh the catalog from the registry'
293
293
  }
294
294
 
295
- __tt_cli() { node $TTHEME_HOME/ttheme.js "$@" }
295
+ __tt_cli() {
296
+ TTHEME_FIND_RATING=$TTHEME_FIND_RATING TTHEME_FIND_BLOCK=$TTHEME_FIND_BLOCK \
297
+ TTHEME_FIND_POSTS=$TTHEME_FIND_POSTS TTHEME_FIND_ORDER=$TTHEME_FIND_ORDER TTHEME_FIND_SETS=$TTHEME_FIND_SETS \
298
+ TTHEME_FIND_HOSTS=$TTHEME_FIND_HOSTS TTHEME_FIND_UNBLOCK=$TTHEME_FIND_UNBLOCK TTHEME_FIND_CUTOUTS=$TTHEME_FIND_CUTOUTS TTHEME_FIND_REMOVE_BG=$TTHEME_FIND_REMOVE_BG \
299
+ node $TTHEME_HOME/ttheme.js "$@"
300
+ }
296
301
 
297
302
  __tt_catalog() {
298
303
  __tt_cli "$@" || return
@@ -613,6 +618,8 @@ __tt_pv_foot() {
613
618
  kk+=(space '=' enter)
614
619
  if (( bgoff[$tune] )); then kl+=(show default keep); else kl+=(hide default keep); fi
615
620
  __tt_pv_bg_findable $tune && { kk+=(f); kl+=(find) }
621
+ __tt_pv_bg_images $tune
622
+ (( REPLY > 1 )) && { kk+=(', .' D); kl+=("image ×$REPLY" remove) }
616
623
  right=$b"esc"$z$d" undo"$z
617
624
  elif (( conf )); then
618
625
  badge=CONFIG kk=(↑↓ ←→ enter) kl=(setting value save)
@@ -695,8 +702,8 @@ __tt_pv_help() {
695
702
  "enter · esc restores $back"
696
703
  )
697
704
  if (( bgcw )); then
698
- hk+=("tune bg" "" "" "")
699
- hv+=("tab · finds one on safebooru if none" "↑↓ field ←→ step ⇧←→ ×10 1-9 place" "space hides · = default · f replaces" "enter keeps · esc undoes")
705
+ hk+=("tune bg" "" "" "" "")
706
+ hv+=("tab · finds one on the boorus if none" "↑↓ field ←→ step ⇧←→ ×10 1-9 place" "space hides · = default · f adds one" "enter keeps · esc undoes" ", . other saved images · D removes this one")
700
707
  fi
701
708
  hk+=(config "")
702
709
  hv+=("alt-c · ↑↓ setting ←→ value" "enter saves · esc undoes")
@@ -777,6 +784,9 @@ __tt_pv_tune() {
777
784
  ;;
778
785
  ' ') __tt_pv_bg_adjust on ;;
779
786
  '=') __tt_pv_bg_adjust def ;;
787
+ ',') __tt_pv_bg_image prev ;;
788
+ '.') __tt_pv_bg_image next ;;
789
+ D) __tt_pv_bg_image drop ;;
780
790
  f)
781
791
  __tt_pv_bg_findable $tune || return 0
782
792
  name=$tune