From 41bdeb88009dd232808edee9fc0e4ae94358d8d6 Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Sat, 29 Aug 2026 02:02:23 +0530 Subject: refactor: moving script into modules that makes sense - instead of collecting all scripts into modules/scripts we are moving them to modules that makes sense (yazi-file-chooser.sh into yazi) --- modules/system/system-monitor/system-monitor.sh | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 modules/system/system-monitor/system-monitor.sh (limited to 'modules/system/system-monitor/system-monitor.sh') diff --git a/modules/system/system-monitor/system-monitor.sh b/modules/system/system-monitor/system-monitor.sh new file mode 100644 index 0000000..7a9e7ea --- /dev/null +++ b/modules/system/system-monitor/system-monitor.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +SESSION="system-monitor" + +kitty @ set-font-size -- -5 + +cleanup() { + kitty @ set-font-size -- +5 +} +trap cleanup EXIT INT TERM + +# Kill any existing session +tmux kill-session -t "$SESSION" 2>/dev/null + +# Start new tmux session with btm wrapped to kill session on exit +tmux new-session -d -s "$SESSION" -c "$HOME" "bash -c 'btm; tmux kill-session -t $SESSION'" + +# Split horizontally: right pane runs nvtop wrapped similarly +tmux split-window -h -t "$SESSION:0" -c "$HOME" "bash -c 'nvtop; tmux kill-session -t $SESSION'" + +tmux set -g status off +tmux set -g mouse on +tmux set -g focus-events on + +# Select main pane and attach +tmux select-pane -t "$SESSION:0.0" +tmux attach-session -t "$SESSION" -- cgit v1.2.3