Multi-Monitor Video Script

Here is a simple script that allows you to play video synced on two screens using mplayer. The script allows the user to select the video they would like to play from a specific folder.

Ensure you have mplayer installed; it should be readily available from your package manager.
________________________________________________________________________________________________________________________________________________________

Copy the code into your favorite text editor. I currently am using KWrite

echo "Enter the name of the video you would like to play, include extension."
echo ""
read "video"

#launching the video with multimonitor support. Define one monitor as -xineramascreen 0 and the other as -xineramascreen 1; -nosound indicates the second video will be muted to avoid distortion.
mplayer -xineramascreen 0 -fs -framedrop "$path""$video" & mplayer -xineramascreen 1 -fs -framedrop -nosound "$path""$video"

You first need to define the path to your video directory, by editing this line in the code:

path="/home/$user/Videos/"

Save your file and place it in a directory that is easily accessible. I currently have mine placed in the bin folder in my home directory. You can also place it in the /usr/bin directory if you like. If you would like to support Asian characters in the program, ensure you save the script with UTF-8 encoding.

Make the script executable by running the following command in terminal, with the correct path to the script.