summaryrefslogtreecommitdiff
path: root/dotfiles/hyprland/.local/bin/monitor-dashboard
blob: 9236d2079bb65348a41741e9aafa5d3b0481bc0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
# monitor-dashboard - tmux session with system monitoring tools
# Each tool gets its own window for full screen real estate

SESSION="monitor"

# Check if system has a battery
has_battery() {
    [ -d /sys/class/power_supply/BAT0 ] || [ -d /sys/class/power_supply/BAT1 ]
}

# Attach to existing session or create new one
if tmux has-session -t "$SESSION" 2>/dev/null; then
    exec tmux attach-session -t "$SESSION"
fi

# Create new session with btop in first window
tmux new-session -d -s "$SESSION" -n btop btop

# Add windows for other monitoring tools (grouped logically)
# CPU/GPU
tmux new-window -t "$SESSION" -n s-tui s-tui
tmux new-window -t "$SESSION" -n nvtop nvtop
# Disk
tmux new-window -t "$SESSION" -n duf "watch --color -n 60 duf"
# Network
tmux new-window -t "$SESSION" -n bandwhich "sudo bandwhich"
tmux new-window -t "$SESSION" -n wavemon wavemon
# Power (laptop only)
if has_battery; then
    tmux new-window -t "$SESSION" -n powertop "sudo powertop"
fi

# Start on btop window
tmux select-window -t "$SESSION:btop"

exec tmux attach-session -t "$SESSION"