Daniel 'MaTachi' Jonsson

Tag Archives: Dual Monitor

Ubuntu Shell Script to Enable and Disable Secondary Monitor

I wrote a short, simple shell script to easily enable and disable my secondary monitor in Ubuntu. I have saved it as monitor.sh in my home folder, and here is the source code:

#!/bin/sh
echo "Turn on: 1\nTurn off: 2"
read option
if [ $option = 1 ];
then xrandr --output DFP2 --auto --left-of DFP1
elif [ $option = 2 ];
then xrandr --output DFP2 --off
fi

To run it, just open a terminal window (Ctrl + Alt + T) and type sh monitor.sh. If you are really lazy, you can add an alias for the command in the file .bashrc in your home folder. I named my alias m. :)

Watch Fullscreen Flash And Work On Second Monitor

FlashI have two monitors to my computer, and I like to have videos in fullscreen on my left monitor. But if you click outside of the video (on the second monitor) does the video goes back to its original size. Lucky for us has a guy came up with an idea to solve this. This solution can be found on this website: