You are not logged in.

#1 2022-06-29 17:40:01

MimiValsi
Member
Registered: 2022-02-14
Posts: 4

Manage multiples display in different places

Hey everyone,

I'm kinda new to archlinux and I just love it!

So I'm using 'mons' to manage 2 external display.
@ home I have a 1080p screen and a 1440p screen.
At the moment I set on my ~/.xinitrc:

xrandr --newmode "2560x1440R" ... // making it simple
xrandr --addmode ...
xrandr -- output ...

It works perfectly!
Now there's a catch... (Obviously)
I'm using my PC on a dock @ work, there I got two 1080p screen (They're the same)
I'm affraid that the cmd above will brake the setup, is there a way to activate only if it detects my 1440p screen?
like
if { ${DISPLAY} == <screen name>}
   xrandr ....
else
   xrandr ....
fi

Hope I was clear enough!

Cheers,

Offline

#2 2022-06-29 20:13:06

seth
Member
Registered: 2012-09-03
Posts: 51,017

Re: Manage multiples display in different places

DISPLAY is an X11 server variable and will be sth. like ":0"

add_output() {
xrandr --newmode "2560x1440R" ... // making it simple
xrandr --addmode ...
xrandr -- output ...
exit
}

for edid in /sys/class/drm/card0-*/edid; do
   edid-decode $edid | grep "Display Product Name" && add_output # replace "Display Product Name" w/ a unique identifier for your monitor
done

Offline

#3 2022-06-30 20:42:55

MimiValsi
Member
Registered: 2022-02-14
Posts: 4

Re: Manage multiples display in different places

Thank your for your reply.
Just to be sure, to replace "Display Product Name" with a unique identifier is a name I choose or it's a specific name from the display?

Offline

#4 2022-06-30 20:53:56

seth
Member
Registered: 2012-09-03
Posts: 51,017

Re: Manage multiples display in different places

it's a specific name from the display

Inspect the EDID decode, the monitor vendor/model will likely show up there.

Offline

#5 2022-06-30 21:37:20

MimiValsi
Member
Registered: 2022-02-14
Posts: 4

Re: Manage multiples display in different places

So did a xrandr --props and got a tone of info and for my monitor on output DP2-2 got this EDID:                 
                00ffffffffffff0010ace6a0554a3330
                2d1a010380351e780eee91a3544c9926
                0f505421080001010101010101010101
                010101010101565e00a0a0a029503020
                35000f282100001a000000ff00564747
                593436423230334a550a000000fd0018
                3c1e8c1e010a202020202020000000fc
                0044656c6c20533234313744470a014f
                02031ac147901f041303120123090701
                8301000065030c001000000000000000
                00000000000000000000000000000000
                00000000000000000000000000000000
                00000000000000000000000000000000
                00000000000000000000000000000000
                00000000000000000000000000000000
                000000000000000000000000000000c1
Is this the display name? Just installed edid-decode and still trying to find how to use it properly

Offline

#6 2022-06-30 21:55:00

seth
Member
Registered: 2012-09-03
Posts: 51,017

Re: Manage multiples display in different places

No, it's the EDID.
It says

Display Product Name: 'Dell S2417DG'

so grep for "Dell S2417DG"

Offline

#7 2022-07-01 07:39:33

MimiValsi
Member
Registered: 2022-02-14
Posts: 4

Re: Manage multiples display in different places

Oh ok I see.

add_output() {
xrandr --newmode "2560x1440R" ... // making it simple
xrandr --addmode ...
xrandr -- output ...
exit
}

for edid in /sys/class/drm/card0-*/edid; do
   edid-decode $edid | grep "Dell S2417DG" && add_output 
done

This should work inside my .xinitrc, will try it. Thx for the help

Offline

Board footer

Powered by FluxBB