Error on enabling dual monitors by script

Forum rules
Before you post please read how to get help

Error on enabling dual monitors by script

Postby svendster on Sat Nov 17, 2012 2:58 am

Hi,
I have Linux Mint 13 KDE 64-bit on a laptop and am trying to divide the screen across 2 monitors (i.e., the laptop screen & a montior).

I haven't been able to get it to divide the desktop across the 2 monitors using the SYSTEM SETTINGS.

I've experimented with the ARandR tool. When I tried to use it to create a new layout and then apply that layout, both screens turned black (in a weird way, with just the mouse cursor showing over the black background).

I tried saving that new layout and then ran it from the terminal. To my great surprise, that worked.
Code: Select all
#!/bin/sh
xrandr --output LVDS-1 --mode 1024x768 --pos 1024x0 --rotate normal --output DP-2 --off --output DP-1 --off --output VGA-1 --mode 1024x768 --pos 0x0 --rotate normal


However, when I rebooted and tried to run that shell script again, I got the following errors:
Code: Select all
mjolnir mjolnir # sh .screenlayout/new.sh
No protocol specified
No protocol specified
Can't open display :0



Now, so far as I know nothing has been changed since that 1st successful execution.

Any idea what I need to do to execute that script?

Thanks in advance.

Svend
svendster
Level 1
Level 1
 
Posts: 8
Joined: Mon Sep 10, 2012 11:17 pm

Linux Mint is funded by ads and donations.
 

Re: Error on enabling dual monitors by script

Postby svendster on Sun Nov 18, 2012 8:25 pm

I've made some major progress, but still have a problem.

I've found that this code works for me.
Code: Select all
export DISPLAY=:0
export XAUTHORITY=/home/[user]/.Xauthority
xrandr --auto --output VGA-1 --mode 1024x768 --right-of LVDS-1


However, my desk layout necessitates the monitor being to the left of the laptop.

When I execute
xrandr --auto --output VGA-1 --mode 1024x768 --left-of LVDS-1
I get a black screen.

Any idea what could be wrong?

Is the problem perhaps that the monitor needs to be designated the primary screen?

Thanks in advance.
svendster
Level 1
Level 1
 
Posts: 8
Joined: Mon Sep 10, 2012 11:17 pm


Return to KDE

Who is online

Users browsing this forum: No registered users and 5 guests