Created
June 17, 2013 07:34
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/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