Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
automating xrandr
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
avdb
n00b
n00b


Joined: 16 Aug 2020
Posts: 65
Location: Netherlands

PostPosted: Sun Dec 12, 2021 4:25 pm    Post subject: automating xrandr Reply with quote

Hi, I have a laptop connected to an external display. Whenever I login Gentoo assumes that I want to use both my external display (HDMI-1) and my laptop's screen (eDP-1). This is frustrating because I have to turn it off manually every time, I would disable the laptop screen with a line in .xinitrc but that would make it impossible to use the laptop when it's not hooked up to another display. A friend of mine recommended me autorandr and I also tried an if-statement in .xinitrc but it didn't work at all. Any solutions for this?
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 21722

PostPosted: Sun Dec 12, 2021 5:53 pm    Post subject: Reply with quote

I would expect that xrandr -q | grep -e 'expr-that-matches-HDMI-1-active' should detect whether the external device is present. You can then inspect the return code to decide whether to do nothing or to run the command to disable the onboard display. If you still need help, show us what you tried, and the output of xrandr -q both with and without the HDMI-1 display connected.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum