#!/bin/bash WHO=$(whoami) popuppic1=$(ls /home/$WHO/Pictures | shuf -n 1); popuppic2=$(ls /home/$WHO/Pictures | shuf -n 1); function fact { fact=$(wget randomfunfacts.com -O - 2>/dev/null | grep \ | sed "s;^.*\(.*\).*$;\1;"); notify-send "$fact" " " -i "/home/$WHO/Pictures/$popuppic2" -t 15000 } function bashquote { quote=$(curl -s http://bash.org/?random1|grep -oE " .* .*

"|sed -e 's//

/g' -e 's/

//g' -e 's/

//g'|perl -ne 'use HTML::Entities;print decode_entities($_),"

"'|head -1); notify-send "$quote" " " -i "/home/$WHO/Pictures/$popuppic1" -t 15000 } function imgur { feh -B black --scale-down "$(wget -q http://imgur.com/random -O - | grep -Po '(?<=")http://i.imgur.com/[^"]+(png|jpg)')" & } function comic { feh -B black --scale-down "$(wget -q http://dynamic.xkcd.com/comic/random/ -O - | grep -Po '(?<=")http://imgs.xkcd.com/comics/[^"]+(png|jpg)')" & } N=1 ARRAY2=( imgur comic bashquote fact ) for index in `shuf --input-range=0-$(( ${#ARRAY2[*]} - 1 )) | head -${N}` do ${ARRAY2[$index]} done