xrandr – is laptop display always "eDP-1"

I want to write myself some help scripts targeting the laptop monitor
and I want to make it generic.

I’ve noticed that on 3 different laptops with Ubuntu 22 the laptop display is always marked in xrandr as "eDP-1".

Is this always the case?

If not – what are the conditions that affect this generated display name?

I found somewhere that eDP should mean "embedded display port" so I would assume that if the laptop doesn’t have more embedded display ports, it will be always marked as eDP-1. But then I found this question – eDP-1-1 to eDP-1 – for Ubuntu 20 and this archive https://lists.x.org/archives/xorg/2017-March/058634.html that mentions "eDP-1-1" in the initial state – which worries me a bit. I also failed to find the documentation describing what eDP means and what are the rules.

Asked By: jave.web


No, it won’t always be that way. On my laptop, for example, it is eDP1 not eDP-1. And, anyway, I imagine it is possible for laptops, especially older ones, to use something other than Display Port. However, there is no need for this. You can rely on the laptop’s screen being the first output. For instance, I have a script I use to toggle between different screen setups, and I use:

screens=( $(xrandr | awk '$2=="connected"{print $1}') )

And then just use "$laptopScreen" anywhere I would use eDP1.

Answered By: terdon