Skip to content

Instantly share code, notes, and snippets.

@smeech
Last active May 12, 2025 10:10
Show Gist options
  • Save smeech/9f8d8909fb14a8dd365753b1fe7761e7 to your computer and use it in GitHub Desktop.
Save smeech/9f8d8909fb14a8dd365753b1fe7761e7 to your computer and use it in GitHub Desktop.
[tmux-pi] Four-pane tmux to show chrono and filtered processing for two Piholes. Requires tmux and access to two Pi via ssh keys. Works well in a TTY session. #pihole #tmux #bash
#!/bin/bash
# Requires tmux and access to two Pi via ssh keys
# chmod +x tmux-pi to make executable
SESSION=$USER
tmux new-session -d -s $SESSION
# Setup a window for monitoring pi & dietpi
tmux new-window -t $SESSION -n 'Pi'
# Split window into 4 panes
tmux split-window -v
tmux resize-pane -D 10
tmux split-window -h
tmux select-pane -t 0
tmux split-window -h
tmux send-keys -t {top-left} "ssh [email protected]" C-m "pihole -t | grep -B 1 gravity" C-m
tmux send-keys -t {bottom-left} "ssh [email protected]" C-m "pihole -c" C-m
tmux send-keys -t {top-right} "ssh [email protected]" C-m "pihole -t | grep -B 1 gravity" C-m
tmux send-keys -t {bottom-right} "ssh [email protected]" C-m "pihole -c" C-m
tmux select-window -t $SESSION:1
# Attach to session - works best in a TTY console
tmux a -t $SESSION # or $USER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment