Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.