# Turn off just the display (Laptop)? NO XORG



## albertobsd (Aug 14, 2017)

Hi everybody!

I have FreeBSD 11.1-RELEASE in an old laptop (Dell Inspiron 710m). It works well.
Thread 51456

I don't have a desktop PC now. So I'm using that Laptop to running some programs in C and some others scripts in PHP and shellscript (Always working in something).

*There is a way to turn off just display?*

The laptop have some extra coolers but the display is always on, and its getting hotter.

I dont have X system now, just the base system, I found some  messages in a mail list but they are oldest, about twelve years:

https://lists.freebsd.org/pipermail/freebsd-questions/2005-April/084923.html

They taking about screen saver that doesn't turn it off the display.

So, Twelve years after there is way to turn off the display of a laptop without shutdown the system?

Regards!


----------



## Deleted member 30996 (Aug 14, 2017)

The screen on every one of my laptops times out after 10 minutes and goes blank without every having to do anything with a screensaver or any make adjustments,

I use x11-wm/fluxbox and it's that way from the first time I boot to a desktop. If you don't have X installed it will, however, stay on indefinitely and why I prefer to work with ports from the login terminal.


----------



## SirDice (Aug 14, 2017)

albertobsd said:


> They taking about screen saver that doesn't turn it off the display.


To make matters a little more difficult, those are all based on the 'old' sc(4) console. Newer FreeBSD versions use vt(4) by default.

https://wiki.freebsd.org/Newcons


----------



## aragats (Aug 14, 2017)

I would try loading _acpi_video_ module:
	
	



```
# kldload acpi_video
```
and then list available parameters:
	
	



```
$ sysctl hw.acpi
```
IMHO, the best candidate to adjust is
	
	



```
# sysctl hw.acpi.video.lcd0.brightness=0
hw.acpi.video.lcd0.brightness: 100 -> 0
```
If it works, a screensaver script can be written.


----------



## albertobsd (Aug 15, 2017)

Hi

I do `sysctl hw.acpi | grep video`


This is the output:


```
hw.acpi.video.out1.active: 0
hw.acpi.video.out0.active: 0
hw.acpi.video.lcd0.levels: 10 8 2 4 6 8 10 12 14 16
hw.acpi.video.lcd0.economy: 8
hw.acpi.video.lcd0.fullpower: 10
hw.acpi.video.lcd0.brightness: 10
hw.acpi.video.lcd0.active: 1
hw.acpi.video.ext0.active: 0
hw.acpi.video.tv0.active: 0
hw.acpi.video.crt0.active: 0
hw.acpi.reset_video: 0
```

When I set the brightness parameter always get Invalid


```
sysctl: hw.acpi.video.lcd0.brightness=0: Invalid argument
```

Btw the laptop have hardware button for Brightness in keyboard

I found other thread here Thread 53631 but they no post any solution

I found some other thread in another Forum (FreeNAS) where anyway they dont found solution
https://www.nas4free.org/forums/viewtopic.php?t=9964





Trihexagonal said:


> The screen on every one of my laptops times out after 10 minutes and goes blank without every having to do anything with a screensaver or any make adjustments,
> 
> I use x11-wm/fluxbox and it's that way from the first time I boot to a desktop. If you don't have X installed it will, however, stay on indefinitely and why I prefer to work with ports from the login terminal.



Hi, Your laptops all of then do that with X system or some o then do that without X?


----------



## aragats (Aug 15, 2017)

albertobsd said:


> When I set the brightness parameter always get Invalid


I guess you should use values from the list defined in `hw.acpi.video.lcd0.levels`, i.e. in your case the minimum is 2.


----------



## albertobsd (Aug 15, 2017)

aragats said:


> I guess you should use values from the list defined in `hw.acpi.video.lcd0.levels`, i.e. in your case the minimum is 2.


Ok, the values are valid, but I probe 2 for  brightness, economy and fullpower. But does not happen anything.


----------



## Deleted member 30996 (Aug 15, 2017)

albertobsd said:


> Hi, Your laptops all of then do that with X system or some o then do that without X?



They only time out at 10 minutes at the desktop when X has been invoked, but will do so every time.

That is not always advantageous for me. When I work with ports I like to do so from the login terminal, before ever invoking X, so I can see how things progress without having to move the mouse to bring back the display.


----------



## aragats (Aug 15, 2017)

albertobsd said:


> the values are valid, but I probe 2 for brightness, economy and fullpower. But does not happen anything.


In my ThinkPad T430 _*brightness*_ perfectly works, but not others...
Unfortunately, I don't see any Dell specific acpi module:
	
	



```
$ find /boot/kernel/ -name "*acpi*"
/boot/kernel/acpi_video.ko
/boot/kernel/acpi_asus_wmi.ko
/boot/kernel/acpi_dock.ko
/boot/kernel/acpi_wmi.ko
/boot/kernel/acpi_sony.ko
/boot/kernel/acpi_panasonic.ko
/boot/kernel/acpi_fujitsu.ko
/boot/kernel/acpi_hp.ko
/boot/kernel/acpi_ibm.ko
/boot/kernel/acpi_toshiba.ko
/boot/kernel/acpi_asus.ko
```


----------



## Deleted member 9563 (Aug 15, 2017)

Is there nothing in the BIOS? I think there often is, and that's OS independent.


----------



## albertobsd (Aug 15, 2017)

I check the bios, there is nothing related with the display behavior.

The laptop comes with keyboard button to increase and decrease brightness and that is SO indepedent. But dont have any button to turn it off.


----------



## SirDice (Aug 15, 2017)

getopt said:


> How many FreeBSD terminals waste energy without a screensaver?


I have a fairly low-tech solution, I actually switch the screen off when I don't need it 

Seriously, servers are mostly managed remotely. In the rare occasion I need to be at the console I switch on the screen, do my thing, log off and turn off the screen.


----------



## Beastie (Aug 15, 2017)

Trihexagonal said:


> They only time out at 10 minutes at the desktop when X has been invoked, but will do so every time.
> 
> That is not always advantageous for me.


When having a xorg.conf file was the way to do things, you could add the right option to disable DPMS. Now you use xset(1) instead.

As you can see with `xset q`, it defaults on 600 seconds for everything:


> Screen Saver:
> [...]
> timeout:  0    cycle:  600
> [...]
> ...



As I've always been a fan of "low-tech solutions" myself (ahem!), I turn off the monitor and don't rely on anything like that. I disable it right in my ~/.xinitrc file, first thing before loading the window manager:

```
xset -dpms
xset s off
xset s noblank
[...]
```


----------



## tankist02 (Aug 15, 2017)

Instead of one monolithic xorg.conf you can have smaller config files in /usr/local/etc/X11/xorg.conf.d (https://www.freebsd.org/doc/handbook/x-config.html). I guess you can put the option to disable DPMS there.


----------



## aragats (Aug 15, 2017)

tankist02 said:


> Instead of one monolithic xorg.conf you can have smaller config files in /usr/local/etc/X11/xorg.conf.d


This thread is not about Xorg. The OP wants to control backlight in console.


----------



## SirDice (Aug 16, 2017)

I'm going to have a look tonight, I have one machine I switched back to sc(4) just so I could run the beastie_saver 

But I can't remember if it switches off the monitor, it's difficult enough to get the screensaver to activate when my cats think that keyboard is nice place to sleep on. (I have plenty of "login" failures for 'bmbbmvvvvvvvvvvvvvvvvvvvvvvvvv' for example).


----------



## aragats (Aug 16, 2017)

albertobsd , correct me if I'm wrong, I believe your laptop is equipped with Intel Extreme Graphics 855 GM graphic card.
I've experimented with mine and found that the _acpi_*_ module is not enough to control the backlight in console. You should also load Intel KMS driver:
	
	



```
# kldload i915kms
```
In my case (Thinkpad T430) the keyboard brightness keys work after that. Maybe that's why your `hw.acpi.video.lcd0.brightness` values don't work.


----------



## albertobsd (Aug 18, 2017)

Yes, the laptop have the  "Intel 82855GME (855GME GMCH) SVGA controller"


`dmesg | grep vga`


```
VT(vga): resolution 640x480
vtvga0: <VT VGA driver> on motherboard
vgapci0: <VGA-compatible display> port 0x1800-0x1807 mem 0xe8000000-0xefffffff,0xe0000000-0xe007ffff irq 11 at device 2.0 on pci0
agp0: <Intel 82855GME (855GME GMCH) SVGA controller> on vgapci0
vgapci0: Boot video device
vgapci1: <VGA-compatible display> mem 0xf0000000-0xf7ffffff,0xe0080000-0xe00fffff at device 2.1 on pci0
```

The laptop have keyboard buttons for brightness and works well, those buttons work even in the BIOS screen.

I've been seriously considering disconnecting the display from the wire.


----------



## Amooti (Feb 19, 2022)

Although I'm almost five years late, I just wanted to share that

```
xset dpms force off
```
which I found  here in a post from 17 years ago worked for me an a Lenovo c440 with FreeBSD 13.0-RELEASE-p6.

I have it bound to a key combination in my i3 config file.  The screen turns off immediately and wakes up  on a keystroke or mouse movement.

This is additional background to mention that I am still in transition from Linux and have just discovered that I had been using this command in linux, but in a bash script named "blank":

```
#!/usr/local/bin/bash
sleep 1; xset dpms force off
```
I had been running that script from my i3 config on Linux.  I also have bash installed on freeBSD and the script shown was edited to adjust the bash location to that on freeBSD.  So, one can either use the xset command above directly or use it in a script.


----------



## aragats (Feb 19, 2022)

Amooti said:


> I also have bash installed on freeBSD and the script shown was edited to adjust the bash location


There is no need to install bash() just for that. Simply use `#!/bin/sh` ― this is a portable solution for *any* OS.
Another thing is that the OP *does not* use Xorg.


----------



## Amooti (Feb 20, 2022)

Thanks, aragats !  Not a big deal, but I didn't install bash just for that, but because of the many scripts I'd been using in Linux before taking a leap into freeBSD!

I also see your point about "OP", although being new, it took me time to figure out what (or who) "OP" referred to.  I am learning!


----------

