@kecan0406/ttheme 1.0.32 → 1.0.33
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 +1 -0
- package/bin/ttheme.js +112 -123
- package/dist/manifest.json +1 -1
- package/package.json +1 -1
- package/shell/ttheme.zsh +22 -2
package/dist/manifest.json
CHANGED
package/package.json
CHANGED
package/shell/ttheme.zsh
CHANGED
|
@@ -390,6 +390,7 @@ __tt_help() {
|
|
|
390
390
|
ttheme preview browse live — focus repaints, enter keeps (this tab or default), esc restores, ? lists keys
|
|
391
391
|
ttheme next advance this tab to the next palette
|
|
392
392
|
ttheme default make a palette the one new tabs open with
|
|
393
|
+
ttheme off open new tabs in the terminal'"'"'s own colors — ttheme on wears the default again
|
|
393
394
|
ttheme pin pick a palette for this directory — cd into it repaints, cd out restores
|
|
394
395
|
ttheme unpin drop the palette pinned to this directory
|
|
395
396
|
ttheme config edit settings in $EDITOR — they apply in new tabs
|
|
@@ -418,6 +419,23 @@ __tt_catalog() {
|
|
|
418
419
|
[[ "$TTHEME_STARTUP ${TTHEME_PALETTE[$TTHEME_STARTUP]}" == "$was" ]] || __tt_reload
|
|
419
420
|
}
|
|
420
421
|
|
|
422
|
+
__tt_switch() {
|
|
423
|
+
local spec
|
|
424
|
+
__tt_catalog $1 || return
|
|
425
|
+
__tt_active || return 0
|
|
426
|
+
if [[ $1 == off ]]; then
|
|
427
|
+
__tt_osc_reset
|
|
428
|
+
TTHEME_SPEC=
|
|
429
|
+
__tt_shown "" && __tt_reload
|
|
430
|
+
__tt_unshown force
|
|
431
|
+
elif [[ -n $TTHEME_STARTUP ]]; then
|
|
432
|
+
spec=${TTHEME_PALETTE[$TTHEME_STARTUP]}
|
|
433
|
+
__tt_apply "$spec"
|
|
434
|
+
TTHEME_SPEC=$spec
|
|
435
|
+
__tt_shown "$TTHEME_STARTUP" force && __tt_reload
|
|
436
|
+
fi
|
|
437
|
+
}
|
|
438
|
+
|
|
421
439
|
__tt_config() {
|
|
422
440
|
if [[ ! -e $TTHEME_CONFIG ]]; then
|
|
423
441
|
mkdir -p ${TTHEME_CONFIG:h} || return 1
|
|
@@ -1481,6 +1499,7 @@ __tt_preview() {
|
|
|
1481
1499
|
abc "series and palettes by name" series "series in the order added"
|
|
1482
1500
|
)
|
|
1483
1501
|
[[ $mode == pin ]] && pkdef=2 plabel=(" this directory " " and below ")
|
|
1502
|
+
[[ $mode == init ]] && pkdef=2
|
|
1484
1503
|
__tt_pv_canpick
|
|
1485
1504
|
__tt_pv_size
|
|
1486
1505
|
local -a groups=() rtype=() rval=() rcnt=() reply=()
|
|
@@ -1540,7 +1559,7 @@ __tt_preview() {
|
|
|
1540
1559
|
}
|
|
1541
1560
|
|
|
1542
1561
|
ttheme() {
|
|
1543
|
-
if [[ $TTHEME_ADAPTER == warp && $1 != (-h|--help|help|browse|list|add|remove|update|config|default) ]]; then
|
|
1562
|
+
if [[ $TTHEME_ADAPTER == warp && $1 != (-h|--help|help|browse|list|add|remove|update|config|default|on|off) ]]; then
|
|
1544
1563
|
print -u2 "ttheme: Warp wears one theme app-wide and paints no tab background of its own — \`ttheme default <palette>\` puts one on every Warp window"
|
|
1545
1564
|
return 1
|
|
1546
1565
|
fi
|
|
@@ -1566,6 +1585,7 @@ ttheme() {
|
|
|
1566
1585
|
__tt_resolve "$2" || return 1
|
|
1567
1586
|
__tt_keep "$REPLY"
|
|
1568
1587
|
return ;;
|
|
1588
|
+
on|off) __tt_switch $1; return ;;
|
|
1569
1589
|
preview) __tt_preview; return ;;
|
|
1570
1590
|
pin) __tt_preview pin; return ;;
|
|
1571
1591
|
unpin) __tt_unpin; return ;;
|
|
@@ -1583,7 +1603,7 @@ ttheme() {
|
|
|
1583
1603
|
|
|
1584
1604
|
if (( $+functions[compdef] )); then
|
|
1585
1605
|
__tt_complete() {
|
|
1586
|
-
(( CURRENT == 2 )) && compadd -- preview next default pin unpin config help browse list add remove update
|
|
1606
|
+
(( CURRENT == 2 )) && compadd -- preview next default on off pin unpin config help browse list add remove update
|
|
1587
1607
|
compadd -- $TTHEME_ORDER
|
|
1588
1608
|
}
|
|
1589
1609
|
compdef __tt_complete ttheme
|