Skip to content

Instantly share code, notes, and snippets.

@k5njm
Created August 26, 2023 22:00
Show Gist options
  • Save k5njm/b50a25279a2b2623264d7a2690c95c13 to your computer and use it in GitHub Desktop.
Save k5njm/b50a25279a2b2623264d7a2690c95c13 to your computer and use it in GitHub Desktop.
Beepy tmux WiFi status
nick@beepy:~ $ cat .tmux.conf
#set -g monitor-silence 5
#set-hook alert-silence 'run-shell "echo hello"'
set-option -g status-interval 15
set-option -g status-right "#(~/bin/wifi_status.sh) "
set-option -ag status-right "#(~/repos/beepy-battery/src/battery.sh ) "
set-option -ag status-right "#(vcgencmd measure_temp | cut -c6-9 )C"
nick@beepy:~ $ cat bin/wifi_status.sh
#! /bin/bash
wifi="$(ip a | grep wlan0 | grep inet | wc -l)"
ssid="$(iwgetid -r)"
if [ $wifi = 1 ] || [ $wifi = 2 ]; then
echo "$ssid↑"
else
echo "$ssid↓"
fi
# Looks like this
# mynetwork↑ 35% 47.2C
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment