tty (console): disable monitor

5,259

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.

Share:
5,259

Related videos on Youtube

Emanuel Berg
Author by

Emanuel Berg

Emanuel Berg Hire me! Programmer, Swedish university degree in Computer Science. computer projects (includes CV, letters, code, screenshots) internet activity (where to find me) Check out some of my Unix & Linux tech writing.

Updated on September 18, 2022

Comments

  • Emanuel Berg
    Emanuel Berg over 1 year

    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".

    • Admin
      Admin over 11 years
      Does your laptop's display selecting key (Fn + F2 on my HP Mini 110) do anything?
    • Emanuel Berg
      Emanuel Berg over 11 years
      On my F8, it says (in Fn font and color) "CRT/LCD" which sounds as concerning monitors, but nothing happens when I press the keys. It could be that the Fn key is not configured (I never used it, and I have a keyboard configuration based on an external keyboard) -- unless the Fn stuff is completely in the hardware. In either case, I would like it more - like the xrandr solution for X: transparent, and automatically invoked.
    • Gilles 'SO- stop being evil'
      Gilles 'SO- stop being evil' over 11 years
      I'm not sure if that's possible. The console video driver is pretty basic. There's little point in not booting into X nowadays: I recommend booting into xdm/gdm/kdm/….
    • Emanuel Berg
      Emanuel Berg over 11 years
      Yes, I'm not going to stop using X. The first command I give is xinit in 95 out of 100 cases. Still, I'd like to examine if it is possible to disable the monitor.
  • Emanuel Berg
    Emanuel Berg over 11 years
    100% correct: sudo vbetool dpms off shuts my laptop monitor off, but doesn't affect the projector.
  • Emanuel Berg
    Emanuel Berg over 11 years
    @user1129682: Do you know how to make this option default? Or maybe how to always run it before you get to the tty login prompt? I put it in .profile - it works, but requires the super user password each time.
  • Emanuel Berg
    Emanuel Berg over 11 years
    @user1129682: Never mind, found it: /etc/rc.local