kitty: match any prefix of the themes kitten, not just "themes"
`kitten theme` runs the themes kitten -- kitty accepts unambiguous prefixes -- but the shim tested `$argv[1] = themes` exactly, so that spelling skipped the capture and re-apply entirely. Before the theme-mode work that was harmless, since nothing rewrote the automatic theme files; now the next regeneration reverts whatever was just chosen, which is why picking a theme stopped sticking. Accept any prefix of "themes" at least two characters long. Verified that themes/theme/them/th all trigger and icat still does not.
This commit is contained in:
parent
9e2667f8fe
commit
ccf4a18c86
@ -1,37 +1,29 @@
|
|||||||
# 1984 theme by Bertie Blackman, https://github.com/covertbert/iterm2-1984/
|
background #090200
|
||||||
|
foreground #a4a1a1
|
||||||
foreground #ffffff
|
cursor #a4a1a1
|
||||||
background #0d0f31
|
selection_background #494542
|
||||||
selection_foreground #000000
|
color0 #090200
|
||||||
selection_background #00d5eb
|
color8 #5b5754
|
||||||
color0 #000000
|
color1 #da2c20
|
||||||
color1 #ff16b0
|
color9 #e8bacf
|
||||||
color2 #b3f361
|
color2 #00a152
|
||||||
color3 #ffea16
|
color10 #3a3332
|
||||||
color4 #46bdff
|
color3 #fcec02
|
||||||
color5 #f806fa
|
color11 #494542
|
||||||
color6 #59e1e3
|
color4 #00a0e4
|
||||||
color7 #feffff
|
color12 #7f7c7b
|
||||||
color8 #000000
|
color5 #a06994
|
||||||
color9 #ff16b0
|
color13 #d6d4d3
|
||||||
color10 #b3f361
|
color6 #b5e4f4
|
||||||
color11 #ffea16
|
color14 #ccab53
|
||||||
color12 #46bdff
|
color7 #a4a1a1
|
||||||
color13 #f806fa
|
color15 #f7f7f7
|
||||||
color14 #6be4e6
|
selection_foreground #090200
|
||||||
color15 #feffff
|
|
||||||
|
|
||||||
# URL styles
|
|
||||||
url_color #f806fa
|
|
||||||
url_style single
|
|
||||||
|
|
||||||
# Cursor styles
|
|
||||||
cursor #59e1e3
|
|
||||||
|
|
||||||
# START_AUTOGENERATED_TAB_STYLE
|
# START_AUTOGENERATED_TAB_STYLE
|
||||||
# Feel free to update these colors manually and remove these comments.
|
# Feel free to update these colors manually and remove these comments.
|
||||||
active_tab_foreground #eeeeee
|
active_tab_foreground #eeeeee
|
||||||
active_tab_background #00d5eb
|
active_tab_background #494542
|
||||||
inactive_tab_foreground #ffffff
|
inactive_tab_foreground #a4a1a1
|
||||||
inactive_tab_background #0a0c27
|
inactive_tab_background #070200
|
||||||
# END_AUTOGENERATED_TAB_STYLE
|
# END_AUTOGENERATED_TAB_STYLE
|
||||||
|
|||||||
@ -4,6 +4,17 @@ function kitten --description 'Run kitten and restore Kitty theme overrides'
|
|||||||
set config_dir "$KITTY_CONFIG_DIRECTORY"
|
set config_dir "$KITTY_CONFIG_DIRECTORY"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# kitty accepts any unambiguous prefix of a kitten name, so `kitten theme`
|
||||||
|
# runs the themes kitten just as `kitten themes` does. Match the same way:
|
||||||
|
# an exact `= themes` test silently skips the re-apply below and the next
|
||||||
|
# regeneration then reverts the theme that was just chosen.
|
||||||
|
set -l is_themes false
|
||||||
|
if test (count $argv) -gt 0
|
||||||
|
and test (string length -- "$argv[1]") -ge 2
|
||||||
|
and string match -q -- "$argv[1]*" themes
|
||||||
|
set is_themes true
|
||||||
|
end
|
||||||
|
|
||||||
command kitten $argv
|
command kitten $argv
|
||||||
set -l kitten_status $status
|
set -l kitten_status $status
|
||||||
|
|
||||||
@ -13,8 +24,7 @@ function kitten --description 'Run kitten and restore Kitty theme overrides'
|
|||||||
# -- `kitty +kitten themes`, a keybinding, another shell -- is picked up on
|
# -- `kitty +kitten themes`, a keybinding, another shell -- is picked up on
|
||||||
# its next run rather than being lost.
|
# its next run rather than being lost.
|
||||||
if test $kitten_status -eq 0
|
if test $kitten_status -eq 0
|
||||||
and test (count $argv) -gt 0
|
and test $is_themes = true
|
||||||
and test "$argv[1]" = themes
|
|
||||||
"$HOME/.config/kitty/apply-theme-mode.sh" "$config_dir"
|
"$HOME/.config/kitty/apply-theme-mode.sh" "$config_dir"
|
||||||
or return $status
|
or return $status
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user