Skip to content

Instantly share code, notes, and snippets.

@jmwohl
Created July 4, 2019 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmwohl/e8a7b01def6923581b7a98186b178d5c to your computer and use it in GitHub Desktop.
Save jmwohl/e8a7b01def6923581b7a98186b178d5c to your computer and use it in GitHub Desktop.
#!/bin/bash
# Add this to a file, e.g. video-autoplay.sh, and then source it from .bashrc
# If n has been pressed, don't autoplay
read -t 1 -n 1 key
if [[ $key = n ]]
then
echo "no video"
else
# hide the prompt:
PS1=""
# set the terminal text color to black
setterm --foreground black --background black --cursor off --clear all
# start up video looping as bg process
nohup omxplayer --loop --no-osd iatech-reel.mp4 >/dev/null 2>&1 &
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment