Results 1 to 8 of 8

Thread: How can I choose which screen an application is displayed on

  1. #1
    Join Date
    Mar 2005
    Location
    Isle of Bute, Scotland
    Beans
    369
    Distro
    Ubuntu Gnome 14.04 Trusty Tahr

    How can I choose which screen an application is displayed on

    I have seen a Windows program which allows you to choose where to send video output to.
    For example with a laptop connected to a TV via the VGA port 'Display 1' is the laptop screen and 'Display 2' is the TV
    Selecting 'Display 2' and then launching an mp4 video displays the video on 'Display 2' only.
    On the laptop everything else is displayed including the program which launched the video.
    Can this be done in Linux? Even better is it possible in python?
    I want to use this with a projector.
    tia
    Norman
    Running 14.04 on my HP Pavilion g6 4 Gig Ram 320 Gig Disc

  2. #2
    Join Date
    Sep 2006
    Location
    United States
    Beans
    624

    Re: How can I choose which screen an application is displayed on

    You can't, usually. The best you can do is get the effect you want is to set the primary monitor. Often a desktop environment will default to the primary screen, same as Windows. Unlike Windows, it really depends on your desktop environment. What you can do is move the window after the application has started up, but the desktop environment and the window manager usually select the default screen. I presently do not know of any helper programs to change that.

    This is not to say that your request is impossible. In fact, it is very possible. but most desktops designed after Windows, like Unity/Gnome and KDE do not do allow you to preset which monitor for a specific app. There are others that do, but you have to understand X11 window settings, specifically "window geometry" in order to do it. As for using Python, the answer is the same. If you can reset the window geometry, then you can pretty much do whatever you want. I suspect most of the "modern" DE's might annoy you in trying to do so.
    Last edited by T.J.; November 26th, 2015 at 06:27 PM.

  3. #3
    Join Date
    Mar 2005
    Location
    Isle of Bute, Scotland
    Beans
    369
    Distro
    Ubuntu Gnome 14.04 Trusty Tahr

    Re: How can I choose which screen an application is displayed on

    Thanks T.J, I thought that might be the case.
    I wanted to display videos on a projector but nothing else except the wallpaper.
    Up to now I have been doing it the way you indicated using vlc so today I started
    looking to see if there is some way of doing it from within vlc and came across this:
    http://albert-mylearning.blogspot.co...c-monitor.html
    Of course Linux isn't mentioned and without a second screen connected nothing shows up.
    When I get chance I will connect my TV via hdmi ( same connection as used by projector ) and see if it then appears.
    I will post back when I find out
    Running 14.04 on my HP Pavilion g6 4 Gig Ram 320 Gig Disc

  4. #4
    Join Date
    Sep 2006
    Location
    United States
    Beans
    624

    Re: How can I choose which screen an application is displayed on

    Actually, your question intrigued me. My knowledge of X11 has slipped a great deal over the years. I used to know a lot more. If I find a way, I'll let you know.

    As an afterthought, have you tried using Kodi (formerly XBMC)? You can specify which screen it uses, in the settings. It plays everything that VLC can. If it fills your need, it would be an easy fix.
    Last edited by T.J.; November 27th, 2015 at 05:40 AM.

  5. #5
    Join Date
    Feb 2008
    Location
    Land of fire and drought
    Beans
    Hidden!
    Distro
    Xubuntu

    Re: How can I choose which screen an application is displayed on

    I use two screens. If I click on a screen and launch an application, the application launches on that screen. I can move windows to any screen I want.

    Your video is displayed on display 2 only? Are you saying you want it on both screens, so they are identical, or mirrored? Then Settings> Display> Position> Same as.

  6. #6
    Join Date
    Mar 2005
    Location
    Isle of Bute, Scotland
    Beans
    369
    Distro
    Ubuntu Gnome 14.04 Trusty Tahr

    Re: How can I choose which screen an application is displayed on

    @Bucky Ball,
    No, I only want the video to display on the projector. I have them set as extended. I don't want the audience distracted by all the other stuff.
    Thanks for the thought anyway.
    @T.J
    I haven't tried kodi at all. I will have a look now.
    Running 14.04 on my HP Pavilion g6 4 Gig Ram 320 Gig Disc

  7. #7
    Join Date
    Mar 2005
    Location
    Isle of Bute, Scotland
    Beans
    369
    Distro
    Ubuntu Gnome 14.04 Trusty Tahr

    Re: How can I choose which screen an application is displayed on

    Kodi does look promising. I can launch it with the video I want playing and select which screen I want it to display on.
    It doesn't automatically close after showing the video but I believe I can add an option in my python script which will simply kill it anyway.
    I think this will work for me but I have also now seen mpv. It is a command line program which plays the video and then closes. Don't know yet if it can play video on the screen I want it to or not.
    I will play about with them both and get back here and let you know how I get on.
    Thanks
    Update
    mpv does what I need, it can be set to launch on whichever display I want and it closes by itself as soon as the video ends.
    Kodi doesn't so I have to add an extra button or reprogram the one which launches the program to kill it,
    while vlc closes but doesn't have the option to launch on the screen I want.
    Last edited by linuxonbute; November 28th, 2015 at 02:26 PM.
    Running 14.04 on my HP Pavilion g6 4 Gig Ram 320 Gig Disc

  8. #8
    Join Date
    Sep 2006
    Location
    United States
    Beans
    624

    Re: How can I choose which screen an application is displayed on

    Great! If there is anything else I can try to help with please post, but if you have what you need please mark the thread solved.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •