<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 11/11/2016 10:37 AM, Aere Greenway
      wrote:<br>
    </div>
    <blockquote
      cite="mid:c6af44b8-a323-3556-6866-4c9a9ef94bfa@Dvorak-Keyboards.com"
      type="cite">
      <meta content="text/html; charset=windows-1252"
        http-equiv="Content-Type">
      <div class="moz-cite-prefix">On 11/11/2016 01:43 AM, Ben Coleman
        wrote:<br>
      </div>
      <blockquote
        cite="mid:0e98053f-f783-54e3-2595-94690b323d4c@benshome.net"
        type="cite">
        <pre wrap="">I've just upgraded one of my machines from Lubuntu 16.04 to Lubuntu
16.10, and find that my resolution has gone from 1600x900 to 1280x1024.
The video adapter is an Nvidia Geforce 6200, and the monitor is an Acer
K222HQL, attached via DVI.  The monitor was correctly detected under
16.04, but I now find that the Monitor Settings dialog shows it as a
'Default Monitor'.  This failure to detect the monitor occurs whether
I'm using the Nvidia binary driver or using the Nouveau driver.  Any
idea if this is a know bug, or if there is anything I can do to fix it?

Ben

</pre>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <br>
      </blockquote>
      <br>
      Ben:<br>
      <br>
      This problem has affected me too.  <br>
      <br>
      At least two of the monitors in my test bed are now treated as
      default monitors - including a fairly modern Samsung SyncMaster
      2220 WM.  <br>
      <br>
      There is a complicated way, using a command-line interface, that
      allows you to overcome this.  <br>
      <br>
      Unfortunately, as is typical of command-line interfaces, it
      requires you to remember a lot of detailed information, and I have
      already forgotten how to fix it, and can't find the e-mails from
      this list that enabled me to work-around the problem.  <br>
      <br>
      It would be good if under "Preferences", the "Monitor Settings"
      tool, would let you set the display to parameters you knew worked
      before upgrading to the new system level, but it does not provide
      this.  <br>
      <br>
      I hope there is a good reason so much currently working hardware
      is being abandoned by Linux.  <br>
      <br>
      On the other hand, if this abandonment is accidental (and some
      list was accidentally left out), that the problem could possibly
      be corrected.  <br>
      <pre class="moz-signature" cols="72">-- 
Sincerely,
Aere</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
    </blockquote>
    <br>
    <p>arandr is a good program for testing out different resolutions
      (much better than the default Lubuntu program IMO)</p>
    <p>You could use that to set things up.  It will make a script for
      you, and if need be you can manually run that script.</p>
    <p>There is a long way to make it automatic.  I use one for HDMI
      displays that might help (it is from the archlinux wiki:
<a class="moz-txt-link-freetext" href="https://wiki.archlinux.org/index.php/PulseAudio/Examples#HDMI_output_configuration">https://wiki.archlinux.org/index.php/PulseAudio/Examples#HDMI_output_configuration</a>)<br>
    </p>
    <p>Here are the three files:<br>
    </p>
    <p>/etc/udev/rules.d/99-hdmi_sound.rules</p>
    <p><tt>KERNEL=="card0", SUBSYSTEM=="drm", ACTION=="change",
        RUN+="/usr/bin/systemctl start hdmi_sound_toggle.service"</tt></p>
    <p>/etc/systemd/system/hdm_sound_toggle.service</p>
    <p><tt>[Unit]</tt><tt><br>
      </tt><tt>Description=hdmi sound hotplug</tt><tt><br>
      </tt><tt><br>
      </tt><tt>[Service]</tt><tt><br>
      </tt><tt>Type=simple</tt><tt><br>
      </tt><tt>RemainAfterExit=no</tt><tt><br>
      </tt><tt>ExecStart=/usr/bin/hdmi_sound_toggle.sh</tt><tt><br>
      </tt><tt><br>
      </tt><tt>[Install]</tt><tt><br>
      </tt><tt>WantedBy=multi-user.target</tt></p>
    <p>And the script: /usr/bin/hdmi-switch</p>
    <p><tt>#!/bin/bash</tt><tt><br>
      </tt><tt>USER_NAME=$(w -hs | awk -v vt=tty$(fgconsole) '$0 ~ vt
        {print $1}')</tt><tt><br>
      </tt><tt>USER_ID=$(id -u "$USER_NAME")</tt><tt><br>
      </tt><tt>HDMI_STATUS=$(</sys/class/drm/card0/*HDMI*/status)</tt><tt><br>
      </tt><tt><br>
      </tt><tt>export
        PULSE_SERVER="unix:/run/user/"$USER_ID"/pulse/native"</tt><tt><br>
      </tt><tt><br>
      </tt><tt>if [[ $HDMI_STATUS == connected ]]</tt><tt><br>
      </tt><tt>then</tt><tt><br>
      </tt><tt>   sudo -u "$USER_NAME" pactl --server "$PULSE_SERVER"
        set-card-profile 0 output:hdmi-stereo+input:analog-stereo</tt><tt><br>
      </tt><tt>else</tt><tt><br>
      </tt><tt>   sudo -u "$USER_NAME" pactl --server "$PULSE_SERVER"
        set-card-profile 0 output:analog-stereo+input:analog-stereo</tt><tt><br>
      </tt><tt>fi</tt></p>
    <p>This obviously has more than you need (you don't need the pulse
      portion).</p>
    <p>But you could check for the external display being plugged in and
      run the code in the script arandr generates, and similarly run one
      generated by arandr when it is unplugged.</p>
    <p>That said, it would be really nice to do this automatically, even
      to the point that you could have a one size fits all approach
      (using output from xrandr and getting values to plug into your
      script without need for the user needing to know what any of that
      stuff means).</p>
    <p><br>
    </p>
    <p>This should get you started (the hard way), or give you a simple
      solution (arandr) for manually changing it, or allow you to copy
      the arandr scripts to /usr/local/bin/ (rename them to something
      like monitor-plugged-in.sh and laptop-display.sh) and then just
      run them, OR make desktop files and save them to your desktop, or
      put them in /usr/share/applications/</p>
    <p>If anything I have said sounds too complicated, please do ask and
      we would be glad to go into detail about things.  Even simple
      questions are welcome.  Do not think any question you ask is
      'silly'.  We are here to help :D<br>
    </p>
    <pre class="moz-signature" cols="72">-- 
Regards</pre>
  </body>
</html>