Announcement

Collapse
No announcement yet.

How to dictate which monitor a program opens on?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [SOLVED] How to dictate which monitor a program opens on?

    What I would like to know is: how to tell my system to open a given application on a particular monitor every time?

    I have a Thinkpad x260 running Kubuntu 20.04 with a single desktop.

    At home I have it set on a docking station running two external displays, with the laptop display disabled. Primary display is in landscape mode on the left. The non-primary is in portrait mode on the right. Screens are aligned at the top (though this seems to not matter - despite claims to the contrary).

    On the go, I use just the laptop screen and no docking station.

    The way it is now, it appears to be totally random. Chromium, Firefox, Kate, Konsole all open on either monitor, seemingly randomly. It doesn't matter where they were last session. Or even if that monitor is powered on/off at execution time

    I have found that settings in Kwin GUI have no effect whatsoever on anything ever. (this was also true for me in 18.04)

    Here are my terminal outputs for $DISPLAY, kwinrc, and xrandr

    Code:
    hoo@ares:~$ echo $DISPLAY
    :0
    Code:
    hoo@ares:~$ cat ./.config/kwinrc
    [$Version]
    update_info=kwin.upd:replace-scalein-with-scale,kwin.upd:port-minimizeanimation-effect-to-js,kwin.upd:port-scale-effect-to-js,kwin.upd:port-dimscreen-effect-to-js,kwin.upd:auto-bordersize,kwin.upd:animation-speed
    
    [Compositing]
    OpenGLIsUnsafe=false
    
    [Desktops]
    Id_1=4131f9f3-28fe-43e2-91f0-53cd977c41ee
    Number=1
    Rows=1
    
    [NightColor]
    Active=true
    LatitudeAuto=35.6409
    LongitudeAuto=-120.701
    NightTemperature=4800
    
    [TabBox]
    DesktopLayout=org.kde.breeze.desktop
    DesktopListLayout=org.kde.breeze.desktop
    LayoutName=org.kde.breeze.desktop
    Code:
    hoo@ares:~$ xrandr
    [FONT=monospace]Screen 0: minimum 320 x 200, current 2820 x 1440, maximum 16384 x 16384
    eDP-1 connected (normal left inverted right x axis y axis)
    1366x768      60.11 +
    1360x768      59.80    59.96   
    1280x720      60.00    59.99    59.86    59.74   
    1024x768      60.04    60.00   
    960x720       60.00   
    928x696       60.05   
    896x672       60.01   
    1024x576      59.95    59.96    59.90    59.82   
    960x600       59.93    60.00   
    960x540       59.96    59.99    59.63    59.82   
    800x600       60.00    60.32    56.25   
    840x525       60.01    59.88   
    864x486       59.92    59.57   
    800x512       60.17   
    700x525       59.98   
    800x450       59.95    59.82   
    640x512       60.02   
    720x450       59.89   
    700x450       59.96    59.88   
    640x480       60.00    59.94   
    720x405       59.51    58.99   
    684x384       59.88    59.85   
    680x384       59.80    59.96   
    640x400       59.88    59.98   
    576x432       60.06   
    640x360       59.86    59.83    59.84    59.32   
    512x384       60.00   
    512x288       60.00    59.92   
    480x270       59.63    59.82   
    400x300       60.32    56.34   
    432x243       59.92    59.57   
    320x240       60.05   
    360x202       59.51    59.13   
    320x180       59.84    59.32   
    DP-1 disconnected (normal left inverted right x axis y axis)
    HDMI-1 disconnected (normal left inverted right x axis y axis)
    DP-2 disconnected (normal left inverted right x axis y axis)
    HDMI-2 disconnected (normal left inverted right x axis y axis)
    DP-2-1 disconnected (normal left inverted right x axis y axis)
    DP-2-2 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 510mm x 290mm
    1920x1080     60.00*+  50.00    59.94   
    1600x1200     60.00   
    1680x1050     59.88   
    1280x1024     60.02   
    1440x900      59.90   
    1280x960      60.00   
    1280x800      59.91   
    1280x720      60.00    50.00    59.94   
    1024x768      60.00   
    800x600       60.32    56.25   
    720x576       50.00   
    720x480       60.00    59.94   
    640x480       60.00    59.94   
    DP-2-3 connected 900x1440+1920+0 left (normal left inverted right x axis y axis) 408mm x 255mm
    1440x900      59.89*+
    1280x1024     75.02    60.02   
    1280x960      60.00   
    1152x864      75.00   
    1024x768      75.03    60.00   
    832x624       74.55   
    800x600       75.00    60.32   
    640x480       75.00    59.94   
    720x400       70.08  
    
    [/FONT]

    #2
    Originally posted by TwoFistedJustice View Post
    I have found that settings in Kwin GUI have no effect whatsoever on anything ever.
    That's my experience, too, on 20.10. But window placement is not random, it depends on recent mouse clicks; if I click on the desktop, then start something, it starts on the monitor I clicked. Clicking on a window works, too, except that closing a window has no effect.
    Regards, John Little

    Comment


      #3
      Originally posted by jlittle View Post
      That's my experience, too, on 20.10. But window placement is not random, it depends on recent mouse clicks; if I click on the desktop, then start something, it starts on the monitor I clicked. Clicking on a window works, too, except that closing a window has no effect.
      I just tested this on my system and mouse clicks don't determine anything. And when I say random, I mean programs will open up on my right monitor, even when it is powered off and hasn't been in use. Or they won't. Or some will and some won't. Or they all will. Or none of them will. Random.

      Comment


        #4
        What works for me is

        right click the title bar of the program you want to affect>> more actions menu>>configure special windows settings

        In the size and position tab: Check the box next to "Screen" choose "Force" from the drop down menu and select the screen number you want the window to be on.

        Comment


          #5
          Originally posted by Bings View Post
          What works for me is

          right click the title bar of the program you want to affect>> more actions menu>>configure special windows settings

          In the size and position tab: Check the box next to "Screen" choose "Force" from the drop down menu and select the screen number you want the window to be on.
          Thanks!

          At first try, this solution seems to work.

          Comment


            #6
            I checked out the windows rules thing again (that's what you get with more actions menu>>configure special windows settings) and it works more than it did the last time I tried it. However, "force" is the only choice that did work, "apply initially" didn't, and with force you can't move the window off that monitor, it just snaps back.

            Another problem is that I typically have 5 firefox, 4 or 5 dolphin, and 3 or 4 konsole windows. I couldn't get a rule, or special window setting, to work for just one window; matching on the title didn't work.

            However, I did find out that the monitors become one big desktop. At work I have two 1920 by 1080 monitors, and a laptop also at 1920 by 1080, so that's a 5760 by 1080 desktop. So I can use wmctrl to move windows around the monitors, or if they support a geometry specification on the command line (as Qt apps do) the monitor can effectively be set. For examples, dolphin --geometry +2000+100 starts dolphin on the second monitor. This suits some of my use cases well.
            Regards, John Little

            Comment


              #7
              Originally posted by jlittle View Post
              I checked out the windows rules thing again (that's what you get with more actions menu>>configure special windows settings) and it works more than it did the last time I tried it. However, "force" is the only choice that did work, "apply initially" didn't, and with force you can't move the window off that monitor, it just snaps back.
              On my current install 'apply initially' is working as expected. It did not on my previous install of 18.04

              Comment

              Working...
              X