Skip to content

Instantly share code, notes, and snippets.

@rbobillot
Last active August 9, 2017 14:04
Show Gist options
  • Save rbobillot/0076df2867f54eff8a04ac52ea90385c to your computer and use it in GitHub Desktop.
Save rbobillot/0076df2867f54eff8a04ac52ea90385c to your computer and use it in GitHub Desktop.
function primary_check {
[[ `which wget` == "" ]] && sudo apt install wget
[[ `which gnash` == "" ]] && sudo apt install gnash
[[ `which wmctrl` == "" ]] && sudo apt install wmctrl
}
function read_swf_file_fullscreen_on_every_display {
primary_check
SWF_FILE=$1
SCREENS_QTY=` xrandr -q | grep " connected " | wc -l`
SCREENS_INFOS=`xrandr -q | grep " connected " | sed -E "s/.+ ([0-9x+]{10,}).+/\1/g" | sort | sed -E "s/([0-9]+)\x([0-9]+)\+([0-9]+)\+([0-9]+)/0,\3,\4,\1,\2/"`
for (( i=1; i<=$SCREENS_QTY; i++ )) ; do
gnash $SWF_FILE -t 12 &
done
sleep 0.3
for (( i=1; i<=$SCREENS_QTY; i++ )) ; do
VPID=`pgrep gnash | tail -n $i | head -1`
NAME=`wmctrl -lp | awk -vpid="$VPID" '$3==pid{print $1}'`
INFO=`echo $SCREENS_INFOS | cut -d ' ' -f $i`
wmctrl -ir "$NAME" -e $INFO
wmctrl -r :ACTIVE: -b toggle,fullscreen
done
}
function allahuakbash {
SWF_FILE="/tmp/countdown.swf"
[[ ! -f $SWF_FILE ]] && wget -q http://www.thecleverest.com/countdown.swf -O $SWF_FILE
read_swf_file_fullscreen_on_every_display $SWF_FILE
}
export DISPLAY=:0
allahuakbash
@rbobillot
Copy link
Author

rbobillot commented Jul 17, 2017

Only works with Linux
It plays for 12 secs, the countdown flash file, fullscreen, on every screen you have.
It is stupid af, but funny af

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment