Automating Xorg RandR turning laptop screen off if external monitor is connected
Hi all,
I have a netbook (Acer Aspire One) I'm running Slackware 13. and usually, I prefer to connect an external monitor. When I switch my machine on with the monitor connected, the display is duplicated on both screens and since I just want the netbook's screen to be off and only see the display on the external monitor, I can do xrandr --output LVDS --off Great! However, it's a hassle to do this every time I log in and I'd like to automate the process if possible. I did some googling and I found that if you want to automate xrandr commands, you can put a script in /etc/X11/Xsession.d/ (see this). I wrote the following script to automate my xrandr commands and since the Xsession.d directory didn't exist, I tried creating it. The script was called 45custom-xrandr_settings, as the one on the RandR wiki is called the same. Code:
#!/bin/bash So, what is the correct way to automate xrandr commands under Slack? |
I'm not sure that this is quite the answer you're looking for, but I've run into the same problem with my main laptop and the only automatic solution I found was to have the external monitor listed as the first monitor in xorg.conf. The console displays in both monitors, but X displays in just the external when it is attached. When unattached, the laptop monitor is used.
|
I myself have to run xrandr to adjust my monitors
resolution / color depth...(or the machine starts in a higher resolution and lower color depth than I want) I start in init 4 and am using kde. I ended up putting the commands in the /etc/kde/kdm/Xsetup file. And my screens resolution is set to what I want while kdm is starting. If you are using kdm/kde, maybe you could try and run your script from this file? HTH Cheers |
Exactly where you put it depends on how you get into X in the first place. In my case I boot to console and use startx. My xinitrc has this in it at the bottom:
xrandr --output LVDS --off --output VGA --mode 1920x1080 # Start the window manager: startlxde |
Quote:
Quote:
Quote:
Thanks everyone! |
First I want to thank Nylex for posting the script - I am on Ubuntu and experienced the same issue - and more difficult - after login I already saw everything fine and something switched away again after a ~ 5 seconds delay.
So for me this topic was a great help but not sufficient. Anybody still experiencing the issue after trying what has been posted above, have a look at http://it-tactics.blogspot.com/2010/...g-station.html |
All times are GMT -5. The time now is 05:42 PM. |