Last active
August 9, 2017 14:04
-
-
Save rbobillot/0076df2867f54eff8a04ac52ea90385c to your computer and use it in GitHub Desktop.
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
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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