batipanel 0.4.0 → 0.4.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.
- package/VERSION +1 -1
- package/lib/layout.sh +12 -6
- package/lib/themes.sh +2 -2
- package/package.json +1 -1
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.4.
|
|
1
|
+
0.4.1
|
package/lib/layout.sh
CHANGED
|
@@ -74,15 +74,21 @@ run_remote() {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
# Launch system monitor: btop → htop → top
|
|
77
|
-
# btop needs ~80x24 minimum;
|
|
77
|
+
# btop needs ~80x24 minimum; if pane is too small, let user choose
|
|
78
78
|
run_monitor() {
|
|
79
79
|
local pane="$1"
|
|
80
80
|
label_pane "$pane" "Monitor"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
81
|
+
if has_cmd btop; then
|
|
82
|
+
local pw ph
|
|
83
|
+
pw=$(tmux display-message -t "$pane" -p '#{pane_width}' 2>/dev/null || echo 0)
|
|
84
|
+
ph=$(tmux display-message -t "$pane" -p '#{pane_height}' 2>/dev/null || echo 0)
|
|
85
|
+
if (( pw >= 80 && ph >= 24 )); then
|
|
86
|
+
tmux send-keys -t "$pane" "btop" Enter
|
|
87
|
+
else
|
|
88
|
+
# pane too small for btop — let user choose
|
|
89
|
+
tmux send-keys -t "$pane" \
|
|
90
|
+
"echo 'Pane is ${pw}x${ph} (btop needs 80x24)' && echo '' && echo ' 1) btop (force — or zoom with Alt+f first)' && echo ' 2) htop' && echo ' 3) top' && echo '' && printf 'Choose [1]: ' && read -r _c && case \${_c:-1} in 2) htop;; 3) top;; *) btop;; esac" Enter
|
|
91
|
+
fi
|
|
86
92
|
elif has_cmd htop; then
|
|
87
93
|
tmux send-keys -t "$pane" "htop" Enter
|
|
88
94
|
elif has_cmd top; then
|
package/lib/themes.sh
CHANGED
|
@@ -31,9 +31,9 @@ _apply_theme() {
|
|
|
31
31
|
echo "BATIPANEL_THEME=\"$theme\"" > "$TMUX_CONFIG"
|
|
32
32
|
fi
|
|
33
33
|
|
|
34
|
-
# live reload
|
|
34
|
+
# live reload: apply theme overlay to all running tmux servers
|
|
35
35
|
if command -v tmux &>/dev/null && tmux list-sessions &>/dev/null 2>&1; then
|
|
36
|
-
|
|
36
|
+
# source theme.conf directly (not tmux.conf which reloads defaults first)
|
|
37
37
|
tmux source-file "$BATIPANEL_HOME/config/theme.conf" 2>/dev/null || true
|
|
38
38
|
fi
|
|
39
39
|
|