View previous topic :: View next topic |
Author |
Message |
avdb n00b
Joined: 16 Aug 2020 Posts: 65 Location: Netherlands
|
Posted: Sun Dec 12, 2021 4:25 pm Post subject: automating xrandr |
|
|
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 |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 21722
|
Posted: Sun Dec 12, 2021 5:53 pm Post subject: |
|
|
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 |
|
|
|