Announcement

Collapse
No announcement yet.

Notebook screen and external monitor show different images

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

    #16
    Your first command has a typo. It should be eDP1 not DP1. ​I suspect if you try it again, it will work. We need to verify that the opposite command works so try xrandr --auto --output DP2 --off and see if works. We also need to verify that xrandr --auto turns both on at once. Assuming these both work try this:

    Open kate and copy this into it:

    Code:
    #!/bin/bash
    # setmon 
    # valid arguments = both main dock
    
    case "$1" in
      both) xrandr --auto ;;
      dock) xrandr --auto --output eDP1 --off ;;
      main) xrandr --auto --output DP2 --off ;;
      *) echo $"Usage: $0 {both|main|dock}" ;;
    esac
    
    exit 0
    then save it as "setmon" in your home directory (or anywhere - just remember where!). Now open a terminal console (konsole) and navigate to where ever you saved setmon and make it executable with: chmod +x setmon then, with both monitos on and the laptop docked, run it with ./setmon and any option after it. You can see from the file that "both" "main" and "dock" should switch back and forth. For example ./setmon main should turn off the external and leave the laptop monitor on. Try all the options several times in different orders so we know this works. Then we'll figure out how to invoke it automatically.

    NOTE: Be sure and have a final empty line in the above file when you save it. The forum CODE tags strip off the trailing empty lines, but in most cases with Linux you need a final carriage return at the end of a file.
    Last edited by oshunluvr; Apr 03, 2015, 05:46 AM.

    Please Read Me

    Comment


      #17
      Thank you very much for your ongoing help!!!


      As I made the typo I repeated the command and run "xrandr -q".


      Code:
      rost@rost-ThinkPad-X240:~$ xrandr --output DP2 --mode 1440x900 --output eDP1 --off
      rost@rost-ThinkPad-X240:~$ xrandr -q
      Screen 0: minimum 320 x 200, current 1440 x 900, maximum 32767 x 32767
      eDP1 connected (normal left inverted right x axis y axis)
         1920x1080      60.0 +   59.9  
         1680x1050      60.0     59.9  
         1600x1024      60.2  
         1400x1050      60.0  
         1280x1024      60.0  
         1440x900       59.9  
         1280x960       60.0  
         1360x768       59.8     60.0  
         1152x864       60.0  
         1024x768       60.0  
         800x600        60.3     56.2  
         640x480        59.9  
      DP1 disconnected (normal left inverted right x axis y axis)
      HDMI1 disconnected (normal left inverted right x axis y axis)
      DP2 connected 1440x900+0+0 (normal left inverted right x axis y axis) 408mm x 255mm
         1440x900       59.9*+   75.0  
         1280x1024      75.0     60.0  
         1152x864       75.0  
         1024x768       75.1     70.1     60.0  
         832x624        74.6  
         800x600        72.2     75.0     60.3     56.2  
         640x480        75.0     72.8     66.7     60.0  
         720x400        70.1  
      HDMI2 disconnected (normal left inverted right x axis y axis)
      VIRTUAL1 disconnected (normal left inverted right x axis y axis)
      and


      Code:
      rost@rost-ThinkPad-X240:~$ xrandr --auto --output eDP1 --off
      rost@rost-ThinkPad-X240:~$ xrandr -q
      Screen 0: minimum 320 x 200, current 1440 x 900, maximum 32767 x 32767
      eDP1 connected (normal left inverted right x axis y axis)
         1920x1080      60.0 +   59.9  
         1680x1050      60.0     59.9  
         1600x1024      60.2  
         1400x1050      60.0  
         1280x1024      60.0  
         1440x900       59.9  
         1280x960       60.0  
         1360x768       59.8     60.0  
         1152x864       60.0  
         1024x768       60.0  
         800x600        60.3     56.2  
         640x480        59.9  
      DP1 disconnected (normal left inverted right x axis y axis)
      HDMI1 disconnected (normal left inverted right x axis y axis)
      DP2 connected 1440x900+0+0 (normal left inverted right x axis y axis) 408mm x 255mm
         1440x900       59.9*+   75.0  
         1280x1024      75.0     60.0  
         1152x864       75.0  
         1024x768       75.1     70.1     60.0  
         832x624        74.6  
         800x600        72.2     75.0     60.3     56.2  
         640x480        75.0     72.8     66.7     60.0  
         720x400        70.1  
      HDMI2 disconnected (normal left inverted right x axis y axis)
      VIRTUAL1 disconnected (normal left inverted right x axis y axis)
      rost@rost-ThinkPad-X240:~$
      Results at external monitor
      - Elements in the default pannel where shifted down (I have the default pannel not at botton but a the left edge of the screen.
      - Activity bar is too high.
      - Monitor resolution and refreshment rate (checked at Monitor): 1440x900 60Hz


      ************************************************** *****
      Test
      xrandr --auto --output DP2 --off

      Code:
      rost@rost-ThinkPad-X240:~$ xrandr --auto --output DP2 --off
      rost@rost-ThinkPad-X240:~$ xrandr -q
      Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 32767 x 32767         
      eDP1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 276mm x 156mm                                                                           
         1920x1080      60.0*+   59.9                                                 
         1680x1050      60.0     59.9                                                 
         1600x1024      60.2                                                          
         1400x1050      60.0                                                          
         1280x1024      60.0                                                          
         1440x900       59.9  
         1280x960       60.0  
         1360x768       59.8     60.0  
         1152x864       60.0  
         1024x768       60.0  
         800x600        60.3     56.2  
         640x480        59.9  
      DP1 disconnected (normal left inverted right x axis y axis)
      HDMI1 disconnected (normal left inverted right x axis y axis)
      DP2 connected (normal left inverted right x axis y axis)
         1440x900       59.9 +   75.0  
         1280x1024      75.0     60.0  
         1152x864       75.0  
         1024x768       75.1     70.1     60.0  
         832x624        74.6  
         800x600        72.2     75.0     60.3     56.2  
         640x480        75.0     72.8     66.7     60.0  
         720x400        70.1  
      HDMI2 disconnected (normal left inverted right x axis y axis)
      VIRTUAL1 disconnected (normal left inverted right x axis y axis)
      rost@rost-ThinkPad-X240:~$
      Results:
      External monitor is off
      Internal monitor opened and works
      - Default pannel shows icons at bottom
      - Activity bar is higher than normal


      ************************************************** ***************
      Test
      Switching external monitor on and keep internal monitor open (=lid open)

      Code:
      rost@rost-ThinkPad-X240:~$ xrandr --output DP2 --mode 1440x900 --output eDP1 --off  
      rost@rost-ThinkPad-X240:~$ xrandr -q
      Screen 0: minimum 320 x 200, current 1440 x 900, maximum 32767 x 32767              
      eDP1 connected (normal left inverted right x axis y axis)                           
         1920x1080      60.0 +   59.9                                                     
         1680x1050      60.0     59.9                                                     
         1600x1024      60.2  
         1400x1050      60.0  
         1280x1024      60.0  
         1440x900       59.9  
         1280x960       60.0  
         1360x768       59.8     60.0  
         1152x864       60.0  
         1024x768       60.0  
         800x600        60.3     56.2  
         640x480        59.9  
      DP1 disconnected (normal left inverted right x axis y axis)
      HDMI1 disconnected (normal left inverted right x axis y axis)
      DP2 connected 1440x900+0+0 (normal left inverted right x axis y axis) 408mm x 255mm
         1440x900       59.9*+   75.0  
         1280x1024      75.0     60.0  
         1152x864       75.0  
         1024x768       75.1     70.1     60.0  
      
      
      rost@rost-ThinkPad-X240:~/Documents/MonitorRelatedScripts$ ./setmon both
      
      Both monitor are on,
      External monitor has layout differences: Default pannel 5 icons from bottom (sytem tray icons) are not visible 
      Internal monitor: Widgets on various activities are positioned to high  or too much left (it seems the system remmber coordinates in pixels and  uses left bottom corner as base point (0,0)
      
      rost@rost-ThinkPad-X240:~/Documents/MonitorRelatedScripts$ ./setmon both
      
      Extrernal monitor off
      Internal monitor on; layout as described under "both"
      
      rost@rost-ThinkPad-X240:~/Documents/MonitorRelatedScripts$ ./setmon dock
      
      Internal monitor off
      External monitor on, layout as described under "both"
      
      option test
      - main
      - both
      - dock
      - main./setmon both
      
      ./setmon main
      ./setmon dock
      - dock
      - both
      - main
      - main
      - dock
      - main
      - dock
      
      All options delivered consitently the correct results includig the layout errors described above.
      
      After the last "dock" option I closed the lid and external monitor went  black, pressing a key at the keyboard did not evoke the PC or screen.  Pressing the power button at the docking station activated the screen  and allow unlocking with password. System behaved normal thereafter.
         832x624        74.6  
         800x600        72.2     75.0     60.3     56.2  
         640x480        75.0     72.8     66.7     60.0  
         720x400        70.1  
      HDMI2 disconnected (normal left inverted right x axis y axis)
      VIRTUAL1 disconnected (normal left inverted right x axis y axis)
      rost@rost-ThinkPad-X240:~$
      Result:
      Internal monitor is open and off


      ************************************************
      Test of the script

      Kate created (copy & paste) script "setmon" located in /home/rost/Documents/MonitorRelatedScripts/

      Navigation in terminal into folder MonitorRelatedScripts

      Code:
      rost@rost-ThinkPad-X240:~/Documents/MonitorRelatedScripts$ ./setmon both
      Results:
      Both monitor are on,
      External monitor has layout differences: Default pannel 5 icons from bottom (sytem tray icons) are not visible
      Internal monitor: Widgets on various activities are positioned to high or too much left (it seems the system remmber coordinates in pixels and uses left bottom corner as base point (0,0)

      Code:
      rost@rost-ThinkPad-X240:~/Documents/MonitorRelatedScripts$ ./setmon main
      Results:
      Extrernal monitor off
      Internal monitor on; layout as described under "both"

      Code:
      rost@rost-ThinkPad-X240:~/Documents/MonitorRelatedScripts$ ./setmon dock
      Results:
      Internal monitor off
      External monitor on, layout as described under "both"


      Option test, sequence of test as listed below
      - main
      - both
      - dock
      - dock
      - both
      - main
      - main
      - dock
      - main
      - dock

      Results:
      All options delivered consistently the correct results including the layout errors described above.

      ************************************************** ***
      After the last "dock" option I closed the lid and external monitor went black, pressing a key at the keyboard did not evoke the PC or screen. Pressing the power button at the docking station activated the screen and allow unlocking with password. System behaved normal thereafter.
      Last edited by 52ROSt; Apr 03, 2015, 06:11 PM.

      Comment


        #18
        Closing the lid triggers an ACPI event, which I would guess is set to "sleep" at the moment. If you look in System Settings /Power Management you should find options there. I don't have any dockable laptops running Linux, so I can't tell you what you might find.

        As far as your widgets moving around - I suspect this is caused by (as you also suspected) widgets being positioned from a reference to the screen. I believe it's upper-left corner is 0,0 and widgets are positioned from there.
        Panel changing is because the bottom edge of the panel is shifting when switching from monitor to monitor - the heights are different. BTW - not that it matters much - but this same type of shifting behavior occurs with any desktop including windows.

        The only solution I can suggest is to adjust the panel size and widget locations to fit within the smallest resolution monitor and accept that unless your monitors are identical - As I pointed out several posts back: The desktop will look different on different resolution monitors.

        So now you need to determine the conditions for each set up you want.

        Example:

        Undocked
        Docked lid open
        Docked lid closed

        and the events you might want, like:

        sleep
        extended desktop
        mirrored desktop
        external monitor only desktop
        internal monitor only desktop

        If you have more than one setup in mind for a single condition - like docked lid open - both monitors, and docked lid open - one monitor. - that will likely be best done manually. The computer won't read your mind. However, likely in this case, simply having the external monitor powered off would change the behavior, so maybe the list would be:

        Undocked, lid closed
        Undocked, lid open
        Docked lid open, external monitor on
        Docked lid open, external monitor off
        Docked lid closed, external monitor on
        Docked lid closed, external monitor off

        I might consider events to be like this:

        Undocked, lid closed = sleep
        Undocked, lid open = internal monitor only desktop
        Docked lid open, external monitor on = extended or mirrored desktop
        Docked lid open, external monitor off = internal monitor only desktop
        Docked lid closed, external monitor on = external monitor only desktop
        Docked lid closed, external monitor off = sleep

        Using the above ideas, the only additional variable would be Mirrored or Extended desktop.

        I don't know enough about Activities to know if you could auto-launch an Activity based on a configuration, but that would make it easy to control the desktop layouts.

        Please Read Me

        Comment


          #19
          Thanks for your kind and detailed explanations and sorry for not replying earlier. I was too busy with a project, and where I live there are no Easter holidays...

          Closing the lid - is set to sleep

          Widgets moving around - I regards it now like the icons in Windows; they move around when changing screens with different solutions. I found so far a an alternative for the activity bar widget; middle click on the desktop enables selection of another acitivty. Nice function. Problem solved.
          BTW your are right the (0,0) point it top left corner.
          others

          The commands and script we added last time remain even if the PC is switched on. I expected that this all gets lost when I switch the power off.
          Currently the little script is in my home directory but I would like to have it somewhere under in the root directory as I only want to keep data on the home directory. However, I can also can imagine that you have something like this in mind.

          Activities - I understand them a bit better in the meantime and they work as I want them to work. I hope it remains like this....



          You used some words, which I am not sure if I understand them right, thus I will give you my understanding to avoid misunderstandings:
          - desktop = my notebook PC, typically I only write "PC"
          - extended monitor = 2 monitors, which are combined to a larger monitor (e.g. side by side)
          - mirrored monitor = 2 monitors, which display the same content.

          Scenarios for monitors and docking, which I would like to use:

          Undocked
          - Lid open => internal monitor of notebook is on. This works fine.
          - Lid open + 1 external monitor connected and on => using the "projector" key I can toggle 4 situations:
          1 - This situation starts when I connect the external monitor to the PC. The external monitor shows my default desktop, but with the default KDE wallpaper and the default launcher in the middle of the screen - the internal monitor shows the normal desktop with my personalized wallpaper. The external monitor is NOT an extension of the internal monitor.
          2 - External monitor shows the same content as the internal, external uses full resolution, internal has a reduced screen in the middle of the physical screen.
          3 - The external monitor shows my default desktop but with the default KDE wallpaper and the default launcher in the middle of the screen - the internal monitor shows the normal desktop with my personalized wallpaper. The external monitor IS an extension of the internal monitor. I can move windows from one screen to the other.
          4 - Only the external monitor is on and runs under maximum resolution.

          Thereafter it returns to situation 1.

          When I assume that I get the same behaviour when I connect a projector this is fine. I need to test this once with a projector.


          Docked
          - Lid open (<1% situation)
          ---------- External monitor off => internal monitor only ==> automatically is a nice to have, thus I can run a script
          ---------- External monitor on => extended monitor ==> automatically is a nice to have, thus I can run a script

          - Lid closed (this is the >99% normal sitothersuation)
          ---------- 1 external monitor only => automatically the external monitor shall run under its maximum resolution = must. This works fine already.
          ---------- 2 external monitors connected, 1 (= main external monitor) is on and 1 (= sub external monitor) is off => automatically the main external monitor should run under its maximum resolution = must.
          ---------- 2 external monitors connected and both are on => automatically both monitors should function as an extended monitor (sub monitor left of the main monitor) = must

          I would like to work with 2 external monitors as soon as the remaining set-ups (others than monitor) are done and I can switch to my x240 Linux PC as my working horse PC. Currently I cannot yet test 2 external monitors on my Linux PC. Therefore, we can shift the 2 external monitors also to later time.

          All the "a nice to have" cases can be switched on with a script. No much time should be wasted to automate them.

          The "must" should be automatically switched on. However, what does not work automatically can be switched on with script.

          I really appreciate your help!!!!

          BTW, in the meantime I understand your forum name!
          Last edited by 52ROSt; Apr 07, 2015, 10:07 PM.

          Comment


            #20
            Re: terminology; "desktop" when I write it means "your working area on the PC" as in: KDE = "K Desktop Environment" or "Virtual desktops." A "desktop" computer obviously means something else. Since we're working with your software, I assume the word "desktop" to refer to the former. Your operating system, any graphical operating system, has a "desktop" whether it's installed to a Desktop PC or a laptop or whatever. Thus two monitors connected to a single PC creates the possibility of two desktops or a larger single (extended) desktop or a single desktop view-able in two locations (mirrored).

            BTW, delays in responding are assumed to mean you're busy or working on the issue or you've lost interest or any other reason. Any reason is fine as we're both here for free and out of personal interest and have no obligation. I too work and have a family so I may disappear for a week or two from time to time. Here in this forum, I think the best tactic is to post to your thread whenever you have more information or added questions. You never know who's reading and who'll jump in with more or different help than I'm giving.This would include posting any solutions you discover on your own so that others may benefit. And yes, my forum name came from where you suspect. Specifically: When I was sailing often I purchased a new car. In California, you can get personal licence plates with four symbols on them; star, hand, heart, or plus-sign. My personalized plate was "OSHUN" heart (as in "love") "R" - phonetically "Ocean Lover." Seemed a good fit for a forum name so I used it here too. Look around enough in other places and you'll see me elsewhere as well. The odd spelling sticks out.

            Back to your situation:

            Re. the third monitor, you mentioned a "splitter" to connect it. I assume you've researched your system enough to verify this actually will produce an additional desktop. In any case it seems better to forge ahead with these two monitors and worry about the third after.

            As far as the script itself: at this point we're testing. Having it "handy" will make things easier IMO, but you can put it anywhere you want. BTW, at this point, the commands in the script will only work when executed as your user - not as root or when using "sudo". If you move it somewhere else, be sure it's in a directory you can access and that you have permission to run it. If you do decide to relocate it to a system location, /usr/local/bin would be appropriate. Then you could execute it without the dot-slash.

            More questions: When your external monitor in on and you state the desktop is not an "extension" does the mouse travel to it and it is usable? In other words, can you move the mouse left or right off the main desktop and it appears on the second desktop and you can launch things there? Or does it appear to be un-reachable?

            So I'm clear, the four undocked scenarios via the "Projector" key you listed are:
            1. Separate (two) desktops
            2. Mirrored desktop at external resolution
            3. Extended desktop
            4. External desktop only

            The "Projector" key is so named by Lenovo because they assumed this is how it would be used. The behavior will (or should) not change with the type of monitor attached - a projector will work the same as your 2nd monitor, just at a different resolution. Does the projector key have different results when docked?

            It would be interesting and possible useful to know what event or keycode is being generated when you use this key. You should be able to capture that info using "xev" which is in the xorg-utils package I believe. Launch xev from a terminal window, click on the xev window with your mouse, and press the projector key a few times and copy the output to a post.

            So as I see it, there are four conditions which should have default behavior:
            A: Docked, lid open, external monitor on
            B: Docked, lid open, external monitor off
            C: Docked, lid closed, external monitor on
            D: Docked , lid closed, external monitor off (sleep mode)
            Honestly, these should occur automatically now if you change your lid closed behavior. What options are there in system settings under the power events?
            Last edited by oshunluvr; Apr 08, 2015, 02:40 AM.

            Please Read Me

            Comment


              #21
              Responding to an answer is showing the appreciation for the efforts a supporter - in this case you - does to help me to solve my problem. Sometimes I even write a summary for others who might encounter the same problem. Good summaries are rare. As I am providing support in the AskLibreOffice forum and I have also a view from your side.
              The support forums for open source SW are great. I came in touch with open source SW about 3 years ago through my brother; he also was the one who brought me to Linux and to kubuntu because of the KDE activities. He "smelled" that this is what I will need/love.

              OSHUN - the Californian licence plate - good idea. Knowing your forum name once it will stick.

              Desktop - Now I understand why I see in some situations on both screens (internal and external) the tag "default desktop rost" but I see 2 different wallpapers (the KDE default and my personalized one). One day I will - hopefully - understand the difference between desktops and activities.

              Third monitor - Accoring to my brother there is a beam splitter available. I just need to buy it. But I also need to remove my current working horse PC from its monitor and this is what I want to avoide untilk other problems of my x240-linux machine are solved.

              Moving the script - Currently it is perfectly fine with me leaving the script where it is. Only at the end I would like to move it. So let's leave it for the time being.

              Your comments made me looking into the situation again and tested the situation several time. Please find the results in below table


              docking situation external monitor connection toggle
              projector1
              internal monitor external monitor mouse and application window comment
              undocked at PC direct start-up
              no toggle
              mirrored image of external
              goes off after PW entry
              • full resolution
              • default desktop rost
              • rost wallpaper
              • only at external
              1
              • width approx 2/3,
              • height full
              • reduced resolution2
              • mirrored monitors
              2
              • default desktop rost
              • full resolution
              • rost wallpaper
              • rost widgets
              • default desktop rost
              • KDE wall paper
              • no rost widgets
              • default launcher centered
              • monitor to the left of internal
              • travel freely, extended
              • apps can be started at both monitors
              3
              • black
              • full resolution
              • mouse travel limite to external monitor
              • 4
              • normal
              • black
              • no signal
              • limited to internal monitor
              • 5
              • normal
              • default desktop rost
              • KDE wall paper
              • no rost widgets
              • default launcher centered
              • monitor to the right of internal
              • travel freely, extended
              • apps can be started at both monitors
              docked3 at PC direct start-up
              no toggle
              • normal
              • black
              • no signal
              • limited to internal monitor
              • 1
              • normal
              • black
              • no signal
              • limited to internal monitor
              projector key has not function
              • 2
              • normal
              • black
              • no signal
              • limited to internal monitor
              projector key has not function
              docked at docking station
              • start-up ater PW entry
              • black
              • full resolution
              • limited to external
              • 1
              • width approx 2/3,
              • height full
              • black
              • no signal
              • limited to internal
              not really needed configuration
              • 2
              • default desktop rost
              • full resolution
              • rost wallpaper
              • rost widgets
              • black
              • no signal
              • limited to internal
              not really needed configuration

              • 3
              • black
              • black
              • no signal
              • limited to internal
              not really needed configuration

              • 3
              • default desktop rost
              • full resolution
              • rost wallpaper
              • rost widgets
              • black
              • no signal
              • limited to internal
              not really needed configuration

              • 5
              • default desktop rost
              • full resolution
              • rost wallpaper
              • rost widgets
              • black
              • no signal
              • limited to internal
              not really needed configuration


              • After above test, PC was shut down, lid closed and started up again
              • External monitor did show the start up screen (KDE wall paper and pass word entry window) and after entering the pass word external monitor turned black, no signal
              • Opening the lid the command “xrandr --auto –output eDP1 --off” (docking situation) turned PC back to normal behavior (= docked, lid closed, external monitor full resolution.

              1“projector” key of note book

              2reduced resolution of external monitor always 1280x1024 instead of full resolution 1440x900

              3Lid open, external monitor connected and on


              Although I expect that the behavior is the same, I will try to test with a real projector during the weekend and compare with the results above. I inform you on the results.


              Event test - I started the xev program. A window titled Event Tester opens with a white screen and black square at top right corner. I clicked on it, bar color show the window is the active one, pressed the "projector" key fist once and thereafter several times However, there was no information in the Event Tester window to be seen. What did I make wrong?

              Lid close behaviors are the following
              For:
              - On AC Power
              - On Batterie
              - On Low Batterie

              the Lid close behaviors are all the same:
              - Do nothing
              - Sleep
              - Shut down
              - Lock screen
              - Turn of screen

              If you need more information please let me know.

              Comment


                #22
                A lot to read through here, but I'll make a couple quick comments for now: Set the lid event to "Turn Off Screen" for "On AC Power" as I assume you have a power supply hooked to your dock. See how this effects the external monitor behavior.

                Since you would want it to sleep when not on AC power (with the lid closed) leave that one alone. We could still create a lid-closed-no-power script if needed.

                Re. xev - no results usually means it's a hard-wired button. In other words, it's a switch not a button so we can't do anything with it. However, the output from xev will be in the terminal window you launched it from, not in the xev window. Try one more time to be sure.

                Please Read Me

                Comment


                  #23
                  Today I saw that the table I pasted into my last answer is difficult to read. As I cannot attach a file to an answer, I created a cloud folder where you can download files. The folder contains

                  x240_MonitorAnalysis.odt
                  xev-Recordings.odt

                  As you use Linux I assume that you can open odt-files.

                  LInk: https://cloud.tsij.org:60522/public....42d3124752d8cc

                  The file "xev-Recordings.odt" contains also information on which steps I took to record the event information. I envy you for being able to decifer this information. Anmd thanks for pointing out the the information is in the terminal window.

                  Turn off screen - I had a look at this matter and found:
                  - PC docked, lid closed,external monitor connected to docking station and on and switch the PC power on => external monitor runs with full resolution and normal
                  - When I keep the PC running as described in the line above and open the lid, the internal monitor is black
                  - When I keep the PC running as described in the line above and switch of the external monitor the internal monitor stays black
                  - When I keep the PC running as described in the line above and remove the external monitor from the docking station, the internal monitor starts up and runs normally.
                  - When I close the lid while the internal monitor is black, the PC goes into sleep mode. A short press on the power button of the docking station makes the external monitor running again and I can unlock the PC.
                  From above test I conclude that the PC recognizes that it is docked and turns the internal monitor off when the lid is closed.


                  Thus I feel that we don't need to change the lid to "Turn Of Screen" when lid is closed and PC runs with AC power. Which gives me "sleep" for the case that the PC is undocked and runs with AC power. .

                  When the PC is undocked and runs under AC power and I close the lid, I want the PC to go to sleep and thus locked. Reason. When I working at a clients place I normally run the PC with AC power and closing the lid is a reduction of energy consumption and a simple access protection. I tested this as well an it works fine.

                  Comment


                    #24
                    Based on what I could tell from the xev ouput, the projector toggle isn't using a keycode so that's not going to help - kind of what I expected anyway.

                    At this point we need to decide what works correctly and does not need changing and what doesn't work and needs changing. Then we can move forward with the hows and whens.

                    The original issue was one of resolution during various combinations of of screens and docking/undocking and/or lid opening and closing. If the behavior is satisfactory (opening/closing, docking/undocking) and just the resolution suffers, a proper xorg.conf file might be all that's needed. If the behavior is unsatisfactory - then scripting or new udev rules will be in order. By now you should have a pretty good idea of what works and what doesn't.

                    You can create an initial xorg.conf file by doing this:

                    1. Dock laptop with lid open and both monitors on and in use and correctly configured.
                    2. Switch to console mode: Alt+Ctrl+F1
                    3. Kill x server: sudo service lightdm stop
                    4. Generate new xorg.conf file: sudo X -configure -- this will create xorg.conf.new file in your current dir
                    5. Rename and move to correct location: sudo mv xorg.conf.new /etc/X11/xorg.conf
                    6. Return to GUI:sudo start lightdm

                    Then post the contents of the xorg.conf file.



                    Seems to me we have these physical conditions:

                    Docked or Undocked
                    Lid Open or Lid Closed
                    External Monitor Connected/On or External Monitor Disconnected/Off

                    Then we have logical conditions:

                    Single Desktop (either monitor)
                    Dual Desktop
                    Mirrored Desktop
                    Extended Desktop

                    Mirrored Desktop will run at the main (internal) display settings. You can change that by using a larger-than-physical virtual Desktop on the internal monitor that matched the external monitor resolution.

                    Mostly, you need to decide on and describe which logical conditions you need/want and during which physical conditions.

                    Please Read Me

                    Comment


                      #25
                      Thanks for the inforamtion. I will look into it in detail on Sunday or Monday. Have a nice weekend.

                      Comment


                        #26
                        With the implementation of the "setmon" script in home/rost/documents/MonitorRelatedScripts the system runs fine. Thus, from my newbie point of view, the only thing, which still needs be done, is to replace the "setmon" script by another one, the xorg.conf script you mentioned.


                        Physical and logical conditions
                        Only the following are needed:

                        1st condition
                        Physical:
                        - PC dockedCreating the xorg.conf file
                        - External monitor connected and on
                        - Lid closed
                        Logical:
                        - external monitor runs under full resolution.
                        (Once a 2nd monitor is connected via VGA signal splitter, the 2nd monitor should extend the the 1st external monitor.)
                        => no need for change

                        2nd condition
                        Physical:
                        - PC undocked
                        - Lid open
                        - external monitor connected and on
                        Logical:
                        - "project" key toggles all logical conditions needed

                        => no need for change but one question or problem(?) is remaining when the internal monitor on and the external monitor is connected as well. This is the presentation configuration I am always using.

                        The external monitor runs in this configuration always in reduced resolution of 1280x1024 instead of full resolution 1440x900. I could not find and prove the root cause. However, I consider this as being caused by the PC 's assumption that it is connected to a real projector with possible resolutions:


                        • XGA = 1024X768 => 1:1.33
                        • SVAG = 800x600 => 1: 1.33
                        • XWGA = 1280x800 => 1:1.6

                        External monitor resolution:
                        • reduced resolution = 1280x1024 => 1:1.25
                        • max resolution = 1440x900 => 1:1.6

                        Reduced resolution of the external monitor is closer to XGA or SVAG resolution of a projector than maximal resolution of external monitor.

                        If my assumption is correct, connecting a real projector should solve the problem.

                        What is your opinion on this topic?

                        All other possibilities are not needed, thus we don't need to think about it.

                        I summarized all information in a short file x240_MonitorAnalysis_150426.odt, which is again in the cloud folder:
                        https://cloud.tsij.org:60522/public....42d3124752d8cc
                        The file reports on each possible configuration with and statements: needed or nice to have.
                        being located somewhere under / but not /home. (I hope I am not wrong with my last sentence.)



                        Creating the xorg.conf file

                        1. Dock laptop with lid open and both monitors on and in use and correctly configured.
                        It is not possible to have the PC docked, lid open, external monitor connected and have both monitors running.
                        For this see larger table in x240_MonitorAnalysis.odt or the summary in x240_MonitorAnalysis_150426.odt.

                        3. Kill x server: sudo service lightdm stop
                        What does this command do? Is this needed if configuration mentioned under 1. is not possible?

                        Is is possible to write an xorg.conf script based on the information which is in the setmon script?

                        Here I appreciate your support because my knowledge of Linux is to low.



                        Additional information:
                        Sometimes when PC is docked, lid closed, external monitor connected, the PC is started, the external monitor runs only with reduced resolution. Logging out and in again, lets the external monitor run again with full resolution. I tried to find out the root cause but could not. I assume it has to do with the location of the "setmon" script. What is your opinion?
                        Should we not able to solve this bug, I don't mind because the logout-login procedure takes only about 30 sec.

                        Comment


                          #27
                          Ok, so it appears you're hardware (PC and dock) force certain conditions. So to get the xorg.conf file try the list of commands while UNdocked and both monitors running:

                          1. Laptop undocked with lid open and both monitors on and in use and correctly configured.
                          2. Switch to console mode: Alt+Ctrl+F1
                          3. Kill x server: sudo service lightdm stop
                          4. Generate new xorg.conf file: sudo X -configure-- this will create xorg.conf.new file in your current dir
                          5. Rename and move to correct location: sudo mv xorg.conf.new /etc/X11/xorg.conf
                          6. Return to GUI:sudo start lightdm

                          Command 3 kills X (the GUI) because you can't use configure option with X running. Post a copy of the xorg created before trying step 5, just do step 6 and then copy it here.

                          I don't think it's going to matter what type of monitor is connected to the port - in other words, having an actual "projector" isn't going to change any behavior. The system won't know the difference, other than it will have a different resolution.

                          Here, I have a Dell and a Dell dock connected to an external monitor. When I have the lid closed, the external monitor uses it's native resolution. When I open the laptop lid, the laptop monitor comes on and the external monitor changes to the laptop's lower resolution. This is because I have it set to Mirror rather than Extended desktop. When I close the lid, the external monitor goes back to it's native res.

                          Please Read Me

                          Comment


                            #28
                            @ oshunluvr - Thanks for the advice. I will get back to you ASAP.

                            Comment


                              #29
                              Thanks again for your continous support and the explanation of the commands.

                              I UNdocked the PC, connected the external monitor and the external monitor was the extension of the internal to left.

                              In previous answers I always used the term "projector key" here I write "F7" and this means "projector key".

                              - alt+ctrl+f1
                              - logged in with username and password
                              1 entered:
                              Code:
                              sudo service lighdm stop
                              response:
                              Code:
                              lightdm/waiting
                              2 entered:
                              Code:
                              sudo X configure
                              response: a bit longer at the end
                              Code:
                              ...your xorg.conf file is /home/rost/xorg.conf.new
                              3 entered:
                              Code:
                              sudo mv xorg.confnew /etc/X11/xorg.conf
                              respones: none
                              4 entered:
                              Code:
                              sudo start lightdm
                              response: machine went back to graphical loggin screen.
                              - logged in
                              - used F7 => no reaction
                              - restarted the machine
                              - clikcing F7 several times and the screens behave like they did before and their behaviour is fine

                              I unfortunately forgot to take a copy of the xorg.conf.new file before I moved it to /etc/X11 folder using command 3.
                              I actually should also have made a copy to the original xorg-file.

                              Should it be important or just interesting for you, I can repeat the procedure because I took an image of my root and boot partitions just before starting with this procedure. Please advice because I will wait with doing other things on my machine. (need to configure the track pointer and get some applications writing in Japanese).

                              I now wonder if the machine is already using the new xorg.conf file or if the setmon file is still working and overruling the xorg.conf file. Can I now delete the setmon file in /home/rost/Documents/MonitorRelatedScripts/ just with the mouse and move to trash or do I need a special command?

                              xorg.conf file after it was created, moved and renamed:

                              Code:
                              Section "ServerLayout"
                                  Identifier     "X.org Configured"
                                  Screen      0  "Screen0" 0 0
                                  InputDevice    "Mouse0" "CorePointer"
                                  InputDevice    "Keyboard0" "CoreKeyboard"
                              EndSection
                              
                              Section "Files"
                                  ModulePath   "/usr/lib/xorg/modules"
                                  FontPath     "/usr/share/fonts/X11/misc"
                                  FontPath     "/usr/share/fonts/X11/cyrillic"
                                  FontPath     "/usr/share/fonts/X11/100dpi/:unscaled"
                                  FontPath     "/usr/share/fonts/X11/75dpi/:unscaled"
                                  FontPath     "/usr/share/fonts/X11/Type1"
                                  FontPath     "/usr/share/fonts/X11/100dpi"
                                  FontPath     "/usr/share/fonts/X11/75dpi"
                                  FontPath     "built-ins"
                              EndSection
                              
                              Section "Module"
                                  Load  "glx"
                              EndSection
                              
                              Section "InputDevice"
                                  Identifier  "Keyboard0"I tested the display of the 
                                  Driver      "kbd"
                              EndSection
                              
                              Section "InputDevice"
                                  Identifier  "Mouse0"
                                  Driver      "mouse"
                                  Option        "Protocol" "auto"
                                  Option        "Device" "/dev/input/mice"
                                  Option        "ZAxisMapping" "4 5 6 7"
                              EndSection
                              
                              Section "Monitor"
                                  Identifier   "Monitor0"
                                  VendorName   "Monitor Vendor"
                                  ModelName    "Monitor Model"
                              EndSection
                              
                              Section "Device"
                                      ### Available Driver options are:-
                                      ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
                                      ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
                                      ### <percent>: "<f>%"
                                      ### [arg]: arg optional
                                      #Option     "NoAccel"                # [<bool>]
                                      #Option     "AccelMethod"            # <str>
                                      #Option     "Backlight"              # <str>
                                      #Option     "DRI"                    # <str>
                                      #Option     "ColorKey"               # <i>
                                      #Option     "VideoKey"               # <i>
                                      #Option     "Tiling"                 # [<bool>]
                                      #Option     "LinearFramebuffer"      # [<bool>]
                                      #Option     "VSync"                  # [<bool>]
                                      #Option     "PageFlip"               # [<bool>]
                                      #Option     "SwapbuffersWait"        # [<bool>]
                                      #Option     "TripleBuffer"           # [<bool>]
                                      #Option     "XvPreferOverlay"        # [<bool>]
                                      #Option     "HotPlug"                # [<bool>]
                                      #Option     "ReprobeOutputs"         # [<bool>]
                                      #Option     "XvMC"                   # [<bool>]
                                      #Option     "ZaphodHeads"            # <str>
                                      #Option     "VirtualHeads"           # <i>
                                      #Option     "TearFree"               # [<bool>]
                                      #Option     "PerCrtcPixmaps"         # [<bool>]
                                      #Option     "FallbackDebug"          # [<bool>]
                                      #Option     "DebugFlushBatches"      # [<bool>]
                                      #Option     "DebugFlushCaches"       # [<bool>]
                                      #Option     "DebugWait"              # [<bool>]
                                      #Option     "BufferCache"            # [<bool>]
                                  Identifier  "Card0"
                                  Driver      "intel"
                                  BusID       "PCI:0:2:0"
                              EndSection
                              
                              Section "Screen"
                                  Identifier "Screen0"
                                  Device     "Card0"
                                  Monitor    "Monitor0"
                                  SubSection "Display"
                                      Viewport   0 0
                                      Depth     1
                                  EndSubSection
                                  SubSection "Display"
                                      Viewport   0 0
                                      Depth     4
                                  EndSubSection
                                  SubSection "Display"as
                                      Viewport   0 0
                                      Depth     8
                                  EndSubSection
                                  SubSection "Display"
                                      Viewport   0 0
                                      Depth     15
                                  EndSubSection
                                  SubSection "Display"
                                      Viewport   0 0
                                      Depth     16
                                  EndSubSection
                                  SubSection "Display"
                                      Viewport   0 0I tested the display of the 
                                      Depth     24
                                  EndSubSection
                              EndSection
                              What is the important part in respect to the monitors in this xorg.conf file and what does it do?

                              Putting the machine back into the docking station, lid closed, and restarting it, shows the external monitor at full resolution.

                              Now I was curious to see how the machine behaves being docked and lid opened and using F7

                              Status definition
                              1 = external monitor: full resolution, extension of internal to the left
                              (start up condition and the same as 3
                              2 = internal monitor limited in width but full height, external at 1280x1024 (normal for a projector; see some answers above)
                              3 = external monitor: full resolution, extension of internal to the left
                              4 = external: full resolution; internal: black
                              5 = external: black; internal: normal
                              6 = external: full resolution, extension of internal to the right.

                              In the first test series clicking F7 went once trought the sequence from 1-5 and then the external monitor stayed black while the internal monitior seemed to got through the sequnce of 2-6. This I could verify by counting the clicks and seeing in the righ sequence status 2

                              I shut down with no note on what the actual status should be, the external monitor just was black.

                              Closed lid and restarted machine. Loggin screen was normally to be seen at external monitor. However after loggin the external monitor went black. Forced shutdown (pressed power button until shutdown) and restarted. The same situation. Forced shutdown)

                              Opened lid but kept machine in docking base. Loggin screen displayed on both monitors. After loggin, external monitor went black. Clicking F7 and the monitors went through the sequence 2-6 serveral times. Different to before the external monitor never stayed black.

                              I shut down the machine in normal way at monitor status 4. Restarting with lid closed showed normal external screen at full resolution.

                              My conclusion is that the latest status of the monitors is saved. I will test all configurations again when the setmon file is removed. Here I will wait for your reply to my question above.
                              Last edited by 52ROSt; May 22, 2015, 07:36 AM.

                              Comment

                              Working...
                              X