#!/bin/bash
#                       /usr/local/bin/screen_last
# https://crystalfaeries.net/posix/bin/screen_last
# celeste:crystalfaery SCREEN_LAST 2016-10-11 23:24:47+00:00
# Save the most recent logout screen from InWorldz

# faerie:
if [ -f $HOME/.firestorm_x64/celestial_angela.inworldz/screen_last.bmp ]
then
	convert $HOME/.firestorm_x64/celestial_angela.inworldz/screen_last.bmp $HOME/documents/pictures/$(ls -l --time-style=long-iso $HOME/.firestorm_x64/celestial_angela.inworldz/screen_last.bmp | sed 's/ /	/g' | cut -f 6- |  sed 's/\/home\/celeste\/\.firestorm_x64\/celestial_angela\.inworldz\/screen_last\.// ; s/	/./g ; s/:/-/ ; s/^/celeste_crystalfaery./ ; s/bmp$/png/')
	rm $HOME/.firestorm_x64/celestial_angela.inworldz/screen_last.bmp
fi

#fey:
if [ -f $HOME/.firestorm/celestial_angela.inworldz/screen_last.bmp ]
then
	convert $HOME/.firestorm/celestial_angela.inworldz/screen_last.bmp $HOME/documents/pictures/$(ls -l --time-style=long-iso $HOME/.firestorm/celestial_angela.inworldz/screen_last.bmp | sed 's/ /	/g' | cut -f 6- |  sed 's/\/home\/celeste\/\.firestorm\/celestial_angela\.inworldz\/screen_last\.// ; s/	/./g ; s/:/-/ ; s/^/celeste_crystalfaery./ ; s/bmp$/png/')
	rm $HOME/.firestorm/celestial_angela.inworldz/screen_last.bmp
fi


syntax highlighted by Code2HTML, v. 0.9.1