Choose style:

Author Topic: Dual Display Reverts to Mirrored Display Mode When monitor turned off and on.  (Read 333 times)

0 Members and 1 Guest are viewing this topic.

Offline bobert

  • nOOb
  • *
  • Posts: 7
  • Karma: 1
  • New Forum User
    • View Profile
  • Peppermint version(s): 10
Hi guys, I was using debian jessie before moving to peppermint os and have managed to get everything working like I was used to except that my dual monitor setup which I configured to extend to a secondary monitor will annoyingly revert to mirrored mode if I turn my monitors off to save power then turn it back on. This did not use to happen when I was using debian. I tried googling how to fix this issue but have not had any luck. I don't know what program is monitoring my display outputs and messing with the configs when i detects that I switched off my monitors. Anyone know what is causing this problem? Is it a setting in xorg or xfce? For now, I am using a shell script with xrandr which I have to run every time I turn my monitors back on to get the display back to normal. :(

Offline alynur

  • Trusted User
  • Veteran
  • *****
  • Posts: 1119
  • Karma: 72
  • Habitual Forum Browser
    • View Profile
  • Peppermint version(s): P 9R (64bit), P 10
Hi bobert, welcome to Peppermint. Go to Menu-Settings-Display and click on ?help, there may be info there for you.
What was I thinking?

Offline clatterfordslim

  • Trusted User
  • Member
  • *****
  • Posts: 512
  • Karma: 75
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 10, Nine Respin 2
Hi Bobert, If you bare with me tomorrow morning I will be doing a video on dual monitors in Peppermint and will link it here. I'm at work on night shift at the moment. I get home for just before nine so will get video recorded then and up on here for midday British Time. Monitors have always been a pain in Linux, though we have ARandr app which I will be using in tutorial tomorrow. The great thing about ARandr is that you can save your settings and load them up again whenever you need them.  ;) The unfortunate thing is by default Linux will not memorise your settings automatically and the display manager will mirror your displays, because it thinks that, that is the most logical way you the user would like them set at.
« Last Edit: January 30, 2020, 07:06:17 pm by clatterfordslim »
Not only is Peppermint an addictive OS to use.
But so is this Forum :)

Offline bobert

  • nOOb
  • *
  • Posts: 7
  • Karma: 1
  • New Forum User
    • View Profile
  • Peppermint version(s): 10
Found out that when I set xfce4-display-settings to "Configure new displays when connected"
it would launch a dialog allowing you to pick which screen configuration you wanted when it detected a new monitor was connected,
namely "Primary Only" or "Secondary Only" or "Mirrored" or "Extend to Right" but would default to Mirrored without any user input within a few seconds.
Disabling this setting would prevent the dialog from launching but the behavior is the same in that
it would set the configuration to Mirrored immediately. I tried find a setting to change the default behavior
but could not find any. After googling I stumbled onto a forum post which says the default settings are hard coded
into the source "xfce4-settings/dialogs/display-settings/main.c" and I am not prepared to build from source to solve
this. There is a bug report of this issue at :- "bugzilla.xfce.org/show_bug.cgi?id=13721".

Right now I am running a cron job to execute  xrandr script to set my current display settings
every 10 seconds. :-[


Offline clatterfordslim

  • Trusted User
  • Member
  • *****
  • Posts: 512
  • Karma: 75
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 10, Nine Respin 2
Why not save settings in ARandr anyway and load them up every time you boot into desktop? It'll then stay like that till you reboot or shutdown.
« Last Edit: January 30, 2020, 09:14:53 pm by clatterfordslim »
Not only is Peppermint an addictive OS to use.
But so is this Forum :)

Offline clatterfordslim

  • Trusted User
  • Member
  • *****
  • Posts: 512
  • Karma: 75
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 10, Nine Respin 2
Hi Bobert as promised the video I said I'll do.  :D

Not only is Peppermint an addictive OS to use.
But so is this Forum :)

Offline clatterfordslim

  • Trusted User
  • Member
  • *****
  • Posts: 512
  • Karma: 75
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 10, Nine Respin 2
Found out that when I set xfce4-display-settings to "Configure new displays when connected"
it would launch a dialog allowing you to pick which screen configuration you wanted when it detected a new monitor was connected,
namely "Primary Only" or "Secondary Only" or "Mirrored" or "Extend to Right" but would default to Mirrored without any user input within a few seconds.
Disabling this setting would prevent the dialog from launching but the behavior is the same in that
it would set the configuration to Mirrored immediately. I tried find a setting to change the default behavior
but could not find any. After googling I stumbled onto a forum post which says the default settings are hard coded
into the source "xfce4-settings/dialogs/display-settings/main.c" and I am not prepared to build from source to solve
this. There is a bug report of this issue at :- "bugzilla.xfce.org/show_bug.cgi?id=13721".

Right now I am running a cron job to execute  xrandr script to set my current display settings
every 10 seconds. :-[

I wonder if with Arandr you could set it to start your saved settings at startup by opening
Code: [Select]
Menu/Settings/Default Applications for LXSession

As you can see in the picture I have given it the path it needs to read the sh file saved in ARandr, just going to test this out and I'll post back as soon as.
Not only is Peppermint an addictive OS to use.
But so is this Forum :)

Offline clatterfordslim

  • Trusted User
  • Member
  • *****
  • Posts: 512
  • Karma: 75
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 10, Nine Respin 2
I just found this on line to get it going properly.
https://www.maketecheasier.com/how-to-setup-dual-monitors-with-xrandr/
Not only is Peppermint an addictive OS to use.
But so is this Forum :)

Offline clatterfordslim

  • Trusted User
  • Member
  • *****
  • Posts: 512
  • Karma: 75
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 10, Nine Respin 2
I have sussed it out,
Create a folder in hidden folders in your home directory pushing
Code: [Select]
Ctrl+H together will bring hidden folders up
Code: [Select]
Right Click empty space in home directory Left click Create New Folder
call it
Code: [Select]
.xsessionrc
The file you originally made in ARandr rename it to
Code: [Select]
xsession.sh
Pop that
Code: [Select]
xsession.sh into .xsessionrc folder you just created

Open
Code: [Select]
Menu/Settings/Default applications for LXSession

When it opens left click
Code: [Select]
Autostart
Then in the box next to Add type
Code: [Select]
.xsessionrc/xsession.sh then left click add
After pushing Add it should look like this.

Finally reboot or logout for this to initialize  ;) Also switching off monitors does not reset them back to mirror mode, it stays with xsession.sh.  :D This has been a pleasure to work on thank you.
« Last Edit: January 31, 2020, 11:13:06 pm by clatterfordslim »
Not only is Peppermint an addictive OS to use.
But so is this Forum :)

Offline alynur

  • Trusted User
  • Veteran
  • *****
  • Posts: 1119
  • Karma: 72
  • Habitual Forum Browser
    • View Profile
  • Peppermint version(s): P 9R (64bit), P 10
Why not save settings in ARandr anyway and load them up every time you boot into desktop? It'll then stay like that till you reboot or shutdown.

Hi clatterfordslim, will this setup survive a turning off of a monitor and then turning it back on? I was reading in the xfcexfce4 help that under advanced you could enable "automatically enable profiles when new display is detected". I know ArandR works as you suggest when I used to keep my TV connected to my desktop but I don't do that any more since I purchased a laptop.
What was I thinking?

Offline bobert

  • nOOb
  • *
  • Posts: 7
  • Karma: 1
  • New Forum User
    • View Profile
  • Peppermint version(s): 10
Hi alynur, thanks for the very informative video on the subject. Your solution is very handy
for setting up dual monitors in a visually intuitive way without having to manually craft xrandr
commands and also to create shortcuts for conveniently switching between setups on the fly
plus automating this when logging on to your system.

The problem I was trying to solve is slightly different where I never logout of m y system
when I step away from my computer, I only turn off both monitors. The problem is that
when I turn the monitors back on to resume work, xfce-display-settings will automatically
revert my setup back to the hard coded default mirrored mode settings. I was using the method you
described in your video of using arandr to save the desired config in the form of a xrandr script
which I would have to manually run when I turned my monitors back on,
setting this script to run on autostart would not help as I was not logged off in the first place.

Right now all I am doing is scheduling a cron job to run the saved config script every 10 seconds
which seems to be a workable interval for my purposes. I was about to revert back to my old debian
setup running open box and lxpanel but peppermint os seems to be less laggy than all the other
lightweight distros I have tried when shopping about for a replacement so I decided to stick it out
after kludging together a work around for the only annoyance I have found on this distro.

Thanks very much for all your help.
 :) ;D

Offline clatterfordslim

  • Trusted User
  • Member
  • *****
  • Posts: 512
  • Karma: 75
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 10, Nine Respin 2
Why not save settings in ARandr anyway and load them up every time you boot into desktop? It'll then stay like that till you reboot or shutdown.

Hi clatterfordslim, will this setup survive a turning off of a monitor and then turning it back on? I was reading in the xfcexfce4 help that under advanced you could enable "automatically enable profiles when new display is detected". I know ArandR works as you suggest when I used to keep my TV connected to my desktop but I don't do that any more since I purchased a laptop.

The tutorial with xsession.sh I posted survives turning off of monitors as I switched mine off for an hour and they stayed with the xsession.sh config.  :) but you must logout to get it running, then you can switch off monitors for two years come back and it'll still be there in the xsession.sh you left it running two years previously, unless of course you had not paid your bill or a power cut.  :D
« Last Edit: January 31, 2020, 11:05:53 pm by clatterfordslim »
Not only is Peppermint an addictive OS to use.
But so is this Forum :)

Offline clatterfordslim

  • Trusted User
  • Member
  • *****
  • Posts: 512
  • Karma: 75
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 10, Nine Respin 2
Hi alynur, thanks for the very informative video on the subject. Your solution is very handy
for setting up dual monitors in a visually intuitive way without having to manually craft xrandr
commands and also to create shortcuts for conveniently switching between setups on the fly
plus automating this when logging on to your system.

The problem I was trying to solve is slightly different where I never logout of m y system
when I step away from my computer, I only turn off both monitors. The problem is that
when I turn the monitors back on to resume work, xfce-display-settings will automatically
revert my setup back to the hard coded default mirrored mode settings. I was using the method you
described in your video of using arandr to save the desired config in the form of a xrandr script
which I would have to manually run when I turned my monitors back on,
setting this script to run on autostart would not help as I was not logged off in the first place.

Right now all I am doing is scheduling a cron job to run the saved config script every 10 seconds
which seems to be a workable interval for my purposes. I was about to revert back to my old debian
setup running open box and lxpanel but peppermint os seems to be less laggy than all the other
lightweight distros I have tried when shopping about for a replacement so I decided to stick it out
after kludging together a work around for the only annoyance I have found on this distro.

Thanks very much for all your help.
 :) ;D

You don't have to do a cron job the tutorial that I done above works and you can switch off your monitors come back a year later and they'll still be reading xsession.sh file, without going back to mirrored.
Not only is Peppermint an addictive OS to use.
But so is this Forum :)

Offline bobert

  • nOOb
  • *
  • Posts: 7
  • Karma: 1
  • New Forum User
    • View Profile
  • Peppermint version(s): 10
Hi clatterfordslim, I already tried it and the reason that the method you described
does not work for me is that the file is only read when logging in .I never log off when I turn off my
monitors so when I turn them off I am used to just working without having to log in again.
XFCE monitors when a new display is connected and defaults to configuring the dual monitor layout to
mirrored mode by default which I do not want. The resolutions remain the same but the
dual monitor layout changes.

Offline clatterfordslim

  • Trusted User
  • Member
  • *****
  • Posts: 512
  • Karma: 75
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 10, Nine Respin 2
I turned off my monitors for an hour to test this and it comes back as is, without going back to mirror mode. I have Peppermint logo to the right of me and my main desktop to the left. I don't log out of the computer it's on just monitors switched off. What you have to remember is Peppermint is not just XFCE it is Lubuntu too LXDE and the tutorial with the xsession.sh file I done is for LXDE which still at it's heart Peppermint is. You are going to have to log out to get this running, it's the only way. Then you'll be able to just switch off your monitors only.
« Last Edit: January 31, 2020, 10:59:56 pm by clatterfordslim »
Not only is Peppermint an addictive OS to use.
But so is this Forum :)