I am using the window manager Xmonad and have two monitors in a Xinerama setup. I want to display videos with mplayer fullscreen across the two monitors.

But, by default, I want mplayer to be a tiled window.

Until now I have done this manually:

  • by pressing the ModMask key and the right mouse button on the lower right corner of the mplayer window to resize it
  • and then by pressing the ModMask key and the left mouse button in the middle of the mplayer window, moving it to fit into the two screens.

How can I achive this semiautomatically?

1 Answer 1


The question was somedays old, and I did not submit it but it was still in my browser window.

In the meantime I have evolved a somewhat hacker brute-force solution. I went to the folder where my mplayer binary is and copied it to another name.

cd /usr/bin
sudo cp mplayer mplfull

Changed all occurrences of MPlayer to MPlfull in the copied file.

sudo sed -i 's%MPlayer%MPlfull%g' mplfull

Then I edited my ~/.xmonad/xmonad.hs file (adding my mplayer copy, that has only MPlfull in its file, so that this will also be its class name).

myManageHook = composeAll
  [ className =? "Gimp"           --> doFloat
  , className =? "Gimp-2.6"       --> doFloat
  , className =? "Gimp-2.8"       --> doFloat
  , className =? "Xsane"          --> doFloat
  , className =? "MPlfull"        --> doFloat
  , title     =? "Gnuplot (window id : 0)"        --> doFloat
  , resource  =? "desktop_window" --> doIgnore
  , resource  =? "kdesktop"       --> doIgnore ]

And then added these four lines in my ~/.bashrc file.

alias mplfull='mplfull -xineramascreen -2 -geometry 2048x1280+0+0 -fs'
alias mpl100='mplfull -xineramascreen -2 -geometry 2248x1480+-100+-100 -fs'
alias mpl200='mplfull -xineramascreen -2 -geometry 2448x1680+-200+-200 -fs'
alias mpl300='mplfull -xineramascreen -2 -geometry 2648x1880+-300+-300 -fs'

Now when I type mplayer someFile I can watch it in a tiled window. And resize it with the mouse as I ever did.

But I can also view my files with mplfull someFile and it’s automatically in fullscreen over both monitors (see the -geometry option).

The mpl100, mpl200 and mpl300 aliases are for videos that would have big black stripes on my monitors because of an aspect ratio that doesn’t fit to my dual-monitor setup. Of course a bit of the video will then be cutted away (outside of the screen), but I like that more than having big black stripes.

I am still curious if there are better and easier solutions. Maybe a Xmonad solution?


The mpl100 and so on is not needed. One can just use the mplayer standard keys e and w to zoom in and zoom out (called change pan-and-scan range in mplayer manual).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .