batipanel 0.4.30 → 0.4.31
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 +15 -1
- package/VERSION +1 -1
- package/install.sh +57 -26
- package/lib/shell-setup.sh +11 -6
- package/lib/themes-bash.sh +1 -1
- package/lib/themes.sh +42 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -445,10 +445,22 @@ All optional tools are auto-installed when possible. Missing tools gracefully fa
|
|
|
445
445
|
|
|
446
446
|
| Platform | Supported Terminals |
|
|
447
447
|
|----------|---------------------|
|
|
448
|
-
| **macOS** |
|
|
448
|
+
| **macOS** | Terminal.app, iTerm2, Alacritty, Kitty, WezTerm, Warp |
|
|
449
449
|
| **Linux** | GNOME Terminal, Konsole, Alacritty, Kitty, WezTerm, xterm |
|
|
450
450
|
| **Windows** | Windows Terminal + WSL2 |
|
|
451
451
|
|
|
452
|
+
### macOS Terminal.app (built-in)
|
|
453
|
+
|
|
454
|
+
batipanel works out of the box with macOS's built-in Terminal. The installer automatically:
|
|
455
|
+
|
|
456
|
+
- Installs **Nerd Font** (MesloLGS NF) via Homebrew
|
|
457
|
+
- Sets the font on your Terminal profile via `osascript`
|
|
458
|
+
- Applies **theme colors** (background, text, cursor) to your profile
|
|
459
|
+
|
|
460
|
+
All layouts, panels, keyboard shortcuts, 256-color themes, Powerline arrows, and session resume work fully.
|
|
461
|
+
|
|
462
|
+
> **Want true color (24-bit)?** Use [iTerm2](https://iterm2.com) for the richest color experience. Terminal.app supports 256 colors which covers all themes well.
|
|
463
|
+
|
|
452
464
|
<details>
|
|
453
465
|
<summary><b>Troubleshooting</b></summary>
|
|
454
466
|
|
|
@@ -458,6 +470,8 @@ All optional tools are auto-installed when possible. Missing tools gracefully fa
|
|
|
458
470
|
|
|
459
471
|
**"claude CLI not installed"?** Run `curl -fsSL https://claude.ai/install.sh | bash`. Everything else still works without it.
|
|
460
472
|
|
|
473
|
+
**Powerline arrows showing as ">"?** Make sure your terminal font is set to a Nerd Font (e.g., MesloLGS NF). On macOS, the installer sets this automatically.
|
|
474
|
+
|
|
461
475
|
**WSL clipboard not working?** Run `sudo apt install xclip`.
|
|
462
476
|
|
|
463
477
|
**Navigation**: Use `Alt + h/j/k/l` to switch panels, `Alt + f` to zoom, mouse click to select.
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.4.
|
|
1
|
+
0.4.31
|
package/install.sh
CHANGED
|
@@ -648,11 +648,11 @@ else
|
|
|
648
648
|
fi
|
|
649
649
|
fi
|
|
650
650
|
|
|
651
|
-
# === 9b. install Nerd Font +
|
|
651
|
+
# === 9b. install Nerd Font + configure terminal (macOS) ===
|
|
652
652
|
if [ "$OS" = "Darwin" ]; then
|
|
653
653
|
echo ""
|
|
654
654
|
|
|
655
|
-
# install Nerd Font
|
|
655
|
+
# install Nerd Font via Homebrew
|
|
656
656
|
if command -v brew &>/dev/null; then
|
|
657
657
|
if ! brew list --cask font-meslo-lg-nerd-font &>/dev/null 2>&1; then
|
|
658
658
|
echo "Installing Nerd Font (MesloLGS NF) for powerline glyphs..."
|
|
@@ -660,19 +660,55 @@ if [ "$OS" = "Darwin" ]; then
|
|
|
660
660
|
fi
|
|
661
661
|
fi
|
|
662
662
|
|
|
663
|
-
#
|
|
663
|
+
# auto-configure Apple Terminal: font + theme colors via osascript
|
|
664
664
|
if [ "${TERM_PROGRAM:-}" = "Apple_Terminal" ]; then
|
|
665
|
-
#
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
665
|
+
# detect current profile name
|
|
666
|
+
_term_profile=$(defaults read com.apple.Terminal "Default Window Settings" 2>/dev/null || echo "Basic")
|
|
667
|
+
|
|
668
|
+
# set Nerd Font on the profile
|
|
669
|
+
echo " Configuring Apple Terminal font (MesloLGS NF)..."
|
|
670
|
+
osascript -e "tell application \"Terminal\" to set font name of settings set \"${_term_profile}\" to \"MesloLGS-NF-Regular\"" 2>/dev/null || true
|
|
671
|
+
osascript -e "tell application \"Terminal\" to set font size of settings set \"${_term_profile}\" to 13" 2>/dev/null || true
|
|
672
|
+
|
|
673
|
+
# apply theme colors to Terminal.app profile
|
|
674
|
+
_apply_terminal_app_colors() {
|
|
675
|
+
local theme="${1:-default}"
|
|
676
|
+
local term_colors
|
|
677
|
+
if declare -f _get_theme_terminal_colors &>/dev/null; then
|
|
678
|
+
term_colors=$(_get_theme_terminal_colors "$theme")
|
|
670
679
|
else
|
|
671
|
-
|
|
680
|
+
term_colors="#1e1e2e #cdd6f4 #f5e0dc blue cyan green magenta"
|
|
672
681
|
fi
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
682
|
+
local bg fg cursor
|
|
683
|
+
read -r bg fg cursor _ <<< "$term_colors"
|
|
684
|
+
|
|
685
|
+
# convert hex #RRGGBB to AppleScript RGB {R*257, G*257, B*257}
|
|
686
|
+
_hex_to_applescript_rgb() {
|
|
687
|
+
local hex="${1#\#}"
|
|
688
|
+
local r=$((16#${hex:0:2}))
|
|
689
|
+
local g=$((16#${hex:2:2}))
|
|
690
|
+
local b=$((16#${hex:4:2}))
|
|
691
|
+
echo "$((r * 257)), $((g * 257)), $((b * 257))"
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
if [[ "$bg" =~ ^# ]]; then
|
|
695
|
+
local bg_rgb fg_rgb cursor_rgb
|
|
696
|
+
bg_rgb=$(_hex_to_applescript_rgb "$bg")
|
|
697
|
+
fg_rgb=$(_hex_to_applescript_rgb "$fg")
|
|
698
|
+
cursor_rgb=$(_hex_to_applescript_rgb "$cursor")
|
|
699
|
+
local profile="$_term_profile"
|
|
700
|
+
osascript <<APPLESCRIPT 2>/dev/null || true
|
|
701
|
+
tell application "Terminal"
|
|
702
|
+
set background color of settings set "$profile" to {${bg_rgb}}
|
|
703
|
+
set normal text color of settings set "$profile" to {${fg_rgb}}
|
|
704
|
+
set cursor color of settings set "$profile" to {${cursor_rgb}}
|
|
705
|
+
end tell
|
|
706
|
+
APPLESCRIPT
|
|
707
|
+
fi
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
_apply_terminal_app_colors "${BATIPANEL_THEME:-default}"
|
|
711
|
+
echo " Applied theme colors to Apple Terminal profile (${_term_profile})"
|
|
676
712
|
fi
|
|
677
713
|
fi
|
|
678
714
|
|
|
@@ -745,24 +781,19 @@ echo " b config layout 7panel # Change default layout"
|
|
|
745
781
|
echo " b theme # List/change color themes"
|
|
746
782
|
echo ""
|
|
747
783
|
if [ "${TERM_PROGRAM:-}" = "Apple_Terminal" ]; then
|
|
748
|
-
echo "
|
|
784
|
+
echo "Apple Terminal: font and theme colors have been configured automatically."
|
|
749
785
|
echo ""
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
echo " 3. Type: b"
|
|
755
|
-
else
|
|
756
|
-
echo "Next steps:"
|
|
757
|
-
echo " 1. Install iTerm2:"
|
|
786
|
+
echo "Type: b"
|
|
787
|
+
echo ""
|
|
788
|
+
echo "Tip: For the best experience (true color, native tabs), try iTerm2:"
|
|
789
|
+
if [ ! -d "/Applications/iTerm.app" ]; then
|
|
758
790
|
if command -v brew &>/dev/null; then
|
|
759
|
-
echo "
|
|
791
|
+
echo " brew install --cask iterm2"
|
|
760
792
|
else
|
|
761
|
-
echo "
|
|
793
|
+
echo " https://iterm2.com/downloads.html"
|
|
762
794
|
fi
|
|
763
|
-
|
|
764
|
-
echo "
|
|
765
|
-
echo " 4. Type: b"
|
|
795
|
+
else
|
|
796
|
+
echo " iTerm2 is already installed — open it and type: b"
|
|
766
797
|
fi
|
|
767
798
|
else
|
|
768
799
|
echo "Tip: Set your terminal font to a Nerd Font (e.g. MesloLGS NF)"
|
package/lib/shell-setup.sh
CHANGED
|
@@ -61,11 +61,16 @@ _generate_zsh_prompt() {
|
|
|
61
61
|
_bp_env="$HOME/.batipanel/config/theme-env.sh"
|
|
62
62
|
[[ -f "$_bp_env" ]] && source "$_bp_env"
|
|
63
63
|
|
|
64
|
-
# set terminal colors
|
|
65
|
-
if [[ "$TERM" != "dumb" ]] && [[
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
# set terminal colors
|
|
65
|
+
if [[ "$TERM" != "dumb" ]] && [[ -n "${BP_BG:-}" ]]; then
|
|
66
|
+
if [[ "${TERM_PROGRAM:-}" == "Apple_Terminal" ]]; then
|
|
67
|
+
# Apple Terminal: colors are set via osascript at install/theme-change time
|
|
68
|
+
:
|
|
69
|
+
else
|
|
70
|
+
printf '\e]11;%s\a' "$BP_BG"
|
|
71
|
+
printf '\e]10;%s\a' "$BP_FG"
|
|
72
|
+
printf '\e]12;%s\a' "$BP_CURSOR"
|
|
73
|
+
fi
|
|
69
74
|
fi
|
|
70
75
|
|
|
71
76
|
autoload -U colors && colors
|
|
@@ -130,7 +135,7 @@ _setup_default_bash_prompt() {
|
|
|
130
135
|
_bp_env="$HOME/.batipanel/config/theme-env.sh"
|
|
131
136
|
[ -f "$_bp_env" ] && source "$_bp_env"
|
|
132
137
|
|
|
133
|
-
# set terminal colors
|
|
138
|
+
# set terminal colors (Apple Terminal uses osascript at install/theme-change time)
|
|
134
139
|
if [[ "$TERM" != "dumb" ]] && [[ "${TERM_PROGRAM:-}" != "Apple_Terminal" ]] && [[ -n "${BP_BG:-}" ]]; then
|
|
135
140
|
printf '\e]11;%s\a' "$BP_BG"
|
|
136
141
|
printf '\e]10;%s\a' "$BP_FG"
|
package/lib/themes-bash.sh
CHANGED
|
@@ -127,7 +127,7 @@ _generate_themed_prompt() {
|
|
|
127
127
|
_bp_env="\$HOME/.batipanel/config/theme-env.sh"
|
|
128
128
|
[ -f "\$_bp_env" ] && source "\$_bp_env"
|
|
129
129
|
|
|
130
|
-
# set terminal colors
|
|
130
|
+
# set terminal colors (Apple Terminal uses osascript at install/theme-change time)
|
|
131
131
|
if [[ "\$TERM" != "dumb" ]] && [[ "\${TERM_PROGRAM:-}" != "Apple_Terminal" ]] && [[ -n "\${BP_BG:-}" ]]; then
|
|
132
132
|
printf '\e]11;%s\a' "\$BP_BG"
|
|
133
133
|
printf '\e]10;%s\a' "\$BP_FG"
|
package/lib/themes.sh
CHANGED
|
@@ -2,6 +2,37 @@
|
|
|
2
2
|
# batipanel themes - color theme system (orchestrator)
|
|
3
3
|
# Sub-modules: themes-data.sh, themes-tmux.sh, themes-bash.sh
|
|
4
4
|
|
|
5
|
+
# apply theme colors to Apple Terminal via osascript
|
|
6
|
+
_apply_apple_terminal_colors() {
|
|
7
|
+
local bg="$1" fg="$2" cursor="$3"
|
|
8
|
+
[[ "$bg" =~ ^# ]] || return 0
|
|
9
|
+
command -v osascript &>/dev/null || return 0
|
|
10
|
+
|
|
11
|
+
# convert hex #RRGGBB to AppleScript RGB {R*257, G*257, B*257}
|
|
12
|
+
_hex_to_as_rgb() {
|
|
13
|
+
local hex="${1#\#}"
|
|
14
|
+
local r=$((16#${hex:0:2}))
|
|
15
|
+
local g=$((16#${hex:2:2}))
|
|
16
|
+
local b=$((16#${hex:4:2}))
|
|
17
|
+
echo "$((r * 257)), $((g * 257)), $((b * 257))"
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
local profile
|
|
21
|
+
profile=$(defaults read com.apple.Terminal "Default Window Settings" 2>/dev/null || echo "Basic")
|
|
22
|
+
local bg_rgb fg_rgb cursor_rgb
|
|
23
|
+
bg_rgb=$(_hex_to_as_rgb "$bg")
|
|
24
|
+
fg_rgb=$(_hex_to_as_rgb "$fg")
|
|
25
|
+
cursor_rgb=$(_hex_to_as_rgb "$cursor")
|
|
26
|
+
|
|
27
|
+
osascript <<APPLESCRIPT 2>/dev/null || true
|
|
28
|
+
tell application "Terminal"
|
|
29
|
+
set background color of settings set "$profile" to {${bg_rgb}}
|
|
30
|
+
set normal text color of settings set "$profile" to {${fg_rgb}}
|
|
31
|
+
set cursor color of settings set "$profile" to {${cursor_rgb}}
|
|
32
|
+
end tell
|
|
33
|
+
APPLESCRIPT
|
|
34
|
+
}
|
|
35
|
+
|
|
5
36
|
# apply theme: generate files, persist config, live reload
|
|
6
37
|
# shellcheck disable=SC2153 # BATIPANEL_HOME is set by core.sh
|
|
7
38
|
_apply_theme() {
|
|
@@ -47,13 +78,17 @@ _apply_theme() {
|
|
|
47
78
|
tmux source-file "$BATIPANEL_HOME/config/theme.conf" 2>/dev/null || true
|
|
48
79
|
fi
|
|
49
80
|
|
|
50
|
-
# live reload: apply terminal colors immediately
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
81
|
+
# live reload: apply terminal colors immediately
|
|
82
|
+
local term_colors
|
|
83
|
+
term_colors=$(_get_theme_terminal_colors "$theme")
|
|
84
|
+
local bg fg cursor
|
|
85
|
+
read -r bg fg cursor _ <<< "$term_colors"
|
|
86
|
+
|
|
87
|
+
if [[ "${TERM_PROGRAM:-}" == "Apple_Terminal" ]]; then
|
|
88
|
+
# Apple Terminal: use osascript instead of OSC sequences
|
|
89
|
+
_apply_apple_terminal_colors "$bg" "$fg" "$cursor"
|
|
90
|
+
else
|
|
91
|
+
# other terminals: OSC 10/11/12
|
|
57
92
|
printf '\e]11;%s\a' "$bg"
|
|
58
93
|
printf '\e]10;%s\a' "$fg"
|
|
59
94
|
printf '\e]12;%s\a' "$cursor"
|
package/package.json
CHANGED