In .xinitrc, I use
xrandr --output LVDS1 --off
to disable the monitor of my laptop (I always use a projector at school).
But, before I log in with xinit, or when I temporary go to the console (Linux virtual terminal, for example tty2 with Ctrl+Alt+F2) — simply put, then the monitor is on, and I’d like it to be off.
I suppose it is logical that it only works during X as xrandr is an X tool. So, I need to find the console “xrandr”.
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
I don’t think that’s possible, as the driver(s) used for the virtual consoles are not that flexible. Once the *fb kernel driver is loaded its settings cannot be changed and once the fbcon module is loaded the *fb wouldn’t unload (for me).
However, you just want to enable/disable a monitor and not a full equivalent to xrandr on the console, I think. There is the program vbetool which can interact with hardware a little. Depending on your hardware this tool can enable/disable your lcd panel.
The Linux kernel documentation knows a little about this. In Documentation/power/video.txt lists some alternative tools as well.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0