Skip to content

Instantly share code, notes, and snippets.

@Igglybuff
Created July 30, 2015 16:50
Show Gist options
  • Save Igglybuff/8232c97c5c31b21b1c15 to your computer and use it in GitHub Desktop.
Save Igglybuff/8232c97c5c31b21b1c15 to your computer and use it in GitHub Desktop.
a few i3blocks scripts
#!/bin/sh
# check how much free disk space remains on primary drive
kbs=$(df -k /tmp | tail -1 | awk '{print $4}')
echo "$(( $kbs / 1024 / 1024 ))GB"
#!/bin/sh
# simple nowplaying script using playerctl metadata
title=$(playerctl metadata title)
artist=$(playerctl metadata artist)
playerctl status | grep Play > /dev/null
if [ $? -eq 0 ]; then
echo "▶ $title - $artist"
fi
playerctl status | grep Pause > /dev/null
if [ $? -eq 0 ]; then
echo "ⵏⵏ $title - $artist"
fi
#!/bin/sh
# simple test to see if openvpn is running
ps cax | grep openvpn > /dev/null
if [ $? -eq 0 ]; then
echo "☑ OpenVPN"
else
echo "☒ OpenVPN"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment