- Create a shell script:
battery.sh
#!/usr/bin/env bash
echo "♥" $(pmset -g batt | grep -Eo '[0-9]+%')
- Make the file executable:
chmod +x battery.sh
- Call it from within
tmux.conf
:
tmux.conf
set -g status-right "#($HOME/.config/tmux/battery.sh)"
#!/usr/bin/env bash
echo "♥" $(pmset -g batt | grep -Eo '[0-9]+%')
chmod +x battery.sh
tmux.conf
:set -g status-right "#($HOME/.config/tmux/battery.sh)"