# Automatic laptop brightness



## elimelech007 (Jan 15, 2022)

On Linux:

```
#crontab -e

0 08 * * * DISPLAY=:0 xbacklight =20
```



Since xbacklight does not work for me, I'm trying to do it through
brightness:

```
36 18 * * * root DISPLAY=:0.0 && /usr/local/bin/xbrightness 59501 1.3
```

But it doesn't work! Why?


----------



## fernandel (Jan 15, 2022)

On my T495 I am using with success accessibility/gammy

https://forums.freebsd.org/threads/brightness-lxqt-config-brightness-and-gammy.79960/


----------



## elimelech007 (Jan 15, 2022)

He does not use something for me under the user. 


```
$ gammy
2022-01-15 20:58:13.741 ERROR [100221] [config::read@53] Unable to open config
```


----------



## jbo (Jan 15, 2022)

elimelech007 said:


> Since xbacklight does not work for me


Starting with FreeBSD 13.0, there is backlight(8) if you wanna give that a shot. Works pretty well on my laptops.


----------



## grahamperrin@ (Jan 15, 2022)

> `… Unable to open config`



That's odd. Unfortunately no longer developed for FreeBSD, upstream. I'll take a quick look in VirtualBox.


----------



## elimelech007 (Jan 15, 2022)

jbodenmann said:


> Starting with FreeBSD 13.0, there is backlight(8) if you wanna give that a shot. Works pretty well on my laptops.




```
root@A9t:/home/luba # backlight -i
backlight: cannot open /dev/backlight/backlight0: No such file or directory
```


----------



## covacat (Jan 15, 2022)

try without && or with export DISPLAY=.. && /usr/...


----------



## Minbari (Jan 15, 2022)

$ `pkg install` graphics/intel-backlight

.config/scripts/backlight:


```
#!/bin/sh

if ! [ ${intel_backlight} -eq 100 ]; then
    intel_backlight 70
fi
```

/usr/local/etc/doas.conf:

```
permit nopass your_user as root cmd /home/your_user/.config/scrtipts/backlight
```


----------



## grahamperrin@ (Jan 15, 2022)

Run as root (not the norm, I simply haven't created a user account in this test environment):




elimelech007 is the Gammy window obscured, or maybe unexpectedly minimised to the system tray?


----------



## elimelech007 (Jan 15, 2022)

Minbari said:


> $ `pkg install` graphics/intel-backlight
> 
> .config/scripts/backlight:
> 
> ...


I have _SiS_ 315 integrated graphics, no INTEL!


----------

