Skip to content

Instantly share code, notes, and snippets.

@sionleroux
Created June 17, 2013 07:34
Show Gist options
  • Save sionleroux/5795214 to your computer and use it in GitHub Desktop.
Save sionleroux/5795214 to your computer and use it in GitHub Desktop.
A bash script which displays a pop-up showing a Steam activation key piped to it by a MUA.
#/bin/bash
# Displays a pop-up showing a Steam activation key piped to it by a MUA.
# In the e-mail the steam key is wrapped in <h2> tags
# Author: Siôn Le Roux <sinisterstuf@gmail.com>
# read e-mail from pipe
while read -r line; do
# find <h2>
buffer=$(echo $line | grep 'h2')
if [[ ! -z $buffer ]]; then
#strip surrounding <h2> tags
steamkey=$(echo $buffer | sed -e 's/<\/\?h2>//g')
fi
done
# display the steam code in a pop-up
zenity --info --title="Steam Key" \
--window-icon="/usr/share/pixmaps/steam.png" \
--text="<tt><big><b>$steamkey</b></big></tt>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment