Skip to content

Instantly share code, notes, and snippets.

@kylejohnson
Created October 27, 2016 21:44
Show Gist options
  • Select an option

  • Save kylejohnson/518e9ef84f135ea5f4b48e3d73b50f70 to your computer and use it in GitHub Desktop.

Select an option

Save kylejohnson/518e9ef84f135ea5f4b48e3d73b50f70 to your computer and use it in GitHub Desktop.
#!/bin/sh
i3status | while :
do
read line
pbpid=$(pidof pianobar)
if [[ "$pbpid" ]]; then
currentSong=~/.config/pianobar/currentSong
artist=`cut -f 1 -d ',' "${currentSong}"`
song=`cut -f 2 -d ',' "${currentSong}"`
pianobar="${artist} - ${song}"
else
pianobar="Pianobar is not running"
fi
gputemp=$( nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader,nounits )
cputemp=$( sensors coretemp-isa-0000|grep Physical|awk '{print $4}' )
nastemp=$( ssh nas sudo sg_ses -f --page es /dev/ses0|grep Temperature|grep C|cut -f 2 -d '=' )
echo "NAS: ${nastemp} CPU: ${cputemp} GPU: ${gputemp}C | ${pianobar} | $line" || exit 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment