Permanently change the brightness

Forum rules
Before you post please read this
Post Reply
svprdga
Level 1
Level 1
Posts: 8
Joined: Wed Mar 30, 2022 10:07 am

Permanently change the brightness

Post by svprdga »

Since I installed the latest version of Mint (21) the brightness of the built-in display of my laptop always starts with value 66 when I have an external monitor connected.

No matter how much I try to change the brightness through the interface or by changing the `/sys/class/backlight/nvidia_0/brightness` file the brightness always resets to 66 the next time I start the machine.

How can I change that value to be permanent even after reboots?
Last edited by SMG on Sat Oct 01, 2022 9:22 pm, edited 1 time in total.
Reason: Moved from Beginner Questions to Graphics Cards & Monitors.
Cosmo.
Level 24
Level 24
Posts: 22055
Joined: Sat Dec 06, 2014 7:34 am

Re: Permanently change the brightness

Post by Cosmo. »

It is a long time ago, when I had a NVidia card, but as far as I can remember there is a SAVE button in the settings. Did you click it?
Gotcha!
svprdga
Level 1
Level 1
Posts: 8
Joined: Wed Mar 30, 2022 10:07 am

Re: Permanently change the brightness

Post by svprdga »

Cosmo. wrote:
Thu Sep 29, 2022 4:25 am
It is a long time ago, when I had a NVidia card, but as far as I can remember there is a SAVE button in the settings. Did you click it?
Do you mean in Mint settings? No, there's no SAVE button there.
User avatar
Dhela Frank
Level 1
Level 1
Posts: 30
Joined: Sun Sep 12, 2021 5:16 pm
Location: Uyo, Nigeria
Contact:

Re: Permanently change the brightness

Post by Dhela Frank »

svprdga wrote:
Thu Sep 29, 2022 12:28 pm
Cosmo. wrote:
Thu Sep 29, 2022 4:25 am
It is a long time ago, when I had a NVidia card, but as far as I can remember there is a SAVE button in the settings. Did you click it?
Do you mean in Mint settings? No, there's no SAVE button there.
cofirm that your power management settings are not conflicting with the brightness
Linux is only Free, if your time has no Value
»Zawinski's

Image

~Flutter Dev
Cosmo.
Level 24
Level 24
Posts: 22055
Joined: Sat Dec 06, 2014 7:34 am

Re: Permanently change the brightness

Post by Cosmo. »

No, I talked about the NVidia settings.
Gotcha!
User avatar
SMG
Level 23
Level 23
Posts: 18808
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Permanently change the brightness

Post by SMG »

svprdga wrote:
Thu Sep 29, 2022 4:09 am
Since I installed the latest version of Mint (21) the brightness of the built-in display of my laptop always starts with value 66 when I have an external monitor connected.
Please open the System Reports app and click the System Information tab on the left. Your computer's information should come up in the right pane. Then click Copy, and paste the results into a reply window here so we can see how Linux Mint views your hardware when the external monitor is attached.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
svprdga
Level 1
Level 1
Posts: 8
Joined: Wed Mar 30, 2022 10:07 am

Re: Permanently change the brightness

Post by svprdga »

Cosmo. wrote:
Thu Sep 29, 2022 3:26 pm
No, I talked about the NVidia settings.
I have reviewed the NVidia settings but there's no brightness option there.
SMG wrote:
Thu Sep 29, 2022 3:35 pm
svprdga wrote:
Thu Sep 29, 2022 4:09 am
Since I installed the latest version of Mint (21) the brightness of the built-in display of my laptop always starts with value 66 when I have an external monitor connected.
Please open the System Reports app and click the System Information tab on the left. Your computer's information should come up in the right pane. Then click Copy, and paste the results into a reply window here so we can see how Linux Mint views your hardware when the external monitor is attached.

Code: Select all

System:
  Kernel: 5.15.0-48-generic x86_64 bits: 64 compiler: gcc v: 11.2.0 Desktop: Cinnamon 5.4.12
    tk: GTK 3.24.33 wm: Mutter dm: LightDM Distro: Linux Mint 21 Vanessa base: Ubuntu 22.04 jammy
Machine:
  Type: Laptop System: HP product: OMEN by HP Laptop v: N/A serial: <superuser required> Chassis:
    type: 10 serial: <superuser required>
  Mobo: HP model: 846A v: 68.21 serial: <superuser required> UEFI: AMI v: F.09 date: 04/24/2019
Battery:
  ID-1: BAT0 charge: 0% condition: 39.2/39.2 Wh (100.0%) volts: 13.5 min: 14.4 model: HP Primary
    serial: N/A status: N/A
CPU:
  Info: 6-core model: Intel Core i7-8750H bits: 64 type: MT MCP arch: Coffee Lake rev: A cache:
    L1: 384 KiB L2: 1.5 MiB L3: 9 MiB
  Speed (MHz): avg: 3982 high: 4001 min/max: 800/4100 cores: 1: 4000 2: 4000 3: 3960 4: 3994
    5: 4001 6: 3999 7: 3998 8: 3946 9: 3959 10: 3981 11: 3959 12: 3998 bogomips: 52799
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3
Graphics:
  Device-1: NVIDIA GP104BM [GeForce GTX 1070 Mobile] vendor: Hewlett-Packard driver: nvidia
    v: 515.65.01 pcie: speed: 8 GT/s lanes: 8 ports: active: none off: DP-2,eDP-1
    empty: DP-1,HDMI-A-1 bus-ID: 01:00.0 chip-ID: 10de:1be1
  Device-2: Chicony HP Wide Vision HD Camera type: USB driver: uvcvideo bus-ID: 1-6:2
    chip-ID: 04f2:b5d6
  Display: x11 server: X.Org v: 1.21.1.3 driver: X: loaded: nvidia
    unloaded: fbdev,modesetting,nouveau,vesa gpu: nvidia display-ID: :0 screens: 1
  Screen-1: 0 s-res: 4480x1440 s-dpi: 96
  Monitor-1: DP-0 pos: bottom-l res: 1920x1080 dpi: 128 diag: 437mm (17.2")
  Monitor-2: DP-3 pos: primary,top-right res: 2560x1440 dpi: 107 diag: 699mm (27.5")
  OpenGL: renderer: NVIDIA GeForce GTX 1070/PCIe/SSE2 v: 4.6.0 NVIDIA 515.65.01
    direct render: Yes
Audio:
  Device-1: Intel Cannon Lake PCH cAVS vendor: Hewlett-Packard driver: snd_hda_intel v: kernel
    bus-ID: 00:1f.3 chip-ID: 8086:a348
  Device-2: NVIDIA GP104 High Definition Audio vendor: Hewlett-Packard driver: snd_hda_intel
    v: kernel pcie: speed: 8 GT/s lanes: 8 bus-ID: 01:00.1 chip-ID: 10de:10f0
  Sound Server-1: ALSA v: k5.15.0-48-generic running: yes
  Sound Server-2: PulseAudio v: 15.99.1 running: yes
  Sound Server-3: PipeWire v: 0.3.48 running: yes
Network:
  Device-1: Intel Cannon Lake PCH CNVi WiFi driver: iwlwifi v: kernel bus-ID: 00:14.3
    chip-ID: 8086:a370
  IF: wlo1 state: up mac: <filter>
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Hewlett-Packard
    driver: r8169 v: kernel pcie: speed: 2.5 GT/s lanes: 1 port: 3000 bus-ID: 3c:00.0
    chip-ID: 10ec:8168
  IF: eno1 state: down mac: <filter>
Bluetooth:
  Device-1: Intel Bluetooth 9460/9560 Jefferson Peak (JfP) type: USB driver: btusb v: 0.8
    bus-ID: 1-14:3 chip-ID: 8087:0aaa
  Report: hciconfig ID: hci0 rfk-id: 0 state: up address: <filter> bt-v: 3.0 lmp-v: 5.1
    sub-v: 100
RAID:
  Hardware-1: Intel 82801 Mobile SATA Controller [RAID mode] driver: ahci v: 3.0 bus-ID: 00:17.0
    chip-ID: 8086:282a
Drives:
  Local Storage: total: 704.24 GiB used: 154.41 GiB (21.9%)
  ID-1: /dev/nvme0n1 vendor: Samsung model: MZVLB256HAHQ-000H1 size: 238.47 GiB speed: 31.6 Gb/s
    lanes: 4 serial: <filter> temp: 31.9 C
  ID-2: /dev/sda vendor: Crucial model: CT500MX500SSD1 size: 465.76 GiB speed: 6.0 Gb/s
    serial: <filter>
Partition:
  ID-1: / size: 233.18 GiB used: 77.2 GiB (33.1%) fs: ext4 dev: /dev/nvme0n1p2
  ID-2: /boot/efi size: 511 MiB used: 5.2 MiB (1.0%) fs: vfat dev: /dev/nvme0n1p1
Swap:
  ID-1: swap-1 type: file size: 2 GiB used: 0 KiB (0.0%) priority: -2 file: /swapfile
USB:
  Hub-1: 1-0:1 info: Hi-speed hub with single TT ports: 16 rev: 2.0 speed: 480 Mb/s
    chip-ID: 1d6b:0002
  Device-1: 1-6:2 info: Chicony HP Wide Vision HD Camera type: Video driver: uvcvideo rev: 2.0
    speed: 480 Mb/s chip-ID: 04f2:b5d6
  Device-2: 1-14:3 info: Intel Bluetooth 9460/9560 Jefferson Peak (JfP) type: Bluetooth
    driver: btusb rev: 2.0 speed: 12 Mb/s chip-ID: 8087:0aaa
  Hub-2: 2-0:1 info: Super-speed hub ports: 8 rev: 3.1 speed: 10 Gb/s chip-ID: 1d6b:0003
  Hub-3: 3-0:1 info: Hi-speed hub with single TT ports: 2 rev: 2.0 speed: 480 Mb/s
    chip-ID: 1d6b:0002
  Hub-4: 4-0:1 info: Super-speed hub ports: 2 rev: 3.1 speed: 10 Gb/s chip-ID: 1d6b:0003
Sensors:
  System Temperatures: cpu: 50.0 C pch: 47.0 C mobo: N/A gpu: nvidia temp: 53 C
  Fan Speeds (RPM): N/A
Repos:
  Packages: 2463 apt: 2448 flatpak: 15
  No active apt repos in: /etc/apt/sources.list
  Active apt repos in: /etc/apt/sources.list.d/brave-browser-release.list
    1: deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] https: //brave-browser-apt-release.s3.brave.com/ stable main
  Active apt repos in: /etc/apt/sources.list.d/danielrichter2007-grub-customizer-jammy.list
    1: deb http: //ppa.launchpad.net/danielrichter2007/grub-customizer/ubuntu jammy main
  Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list
    1: deb https: //mirror.airenetworks.es/linuxmint/packages vanessa main upstream import backport
    2: deb http: //mirror.tedra.es/ubuntu jammy main restricted universe multiverse
    3: deb http: //mirror.tedra.es/ubuntu jammy-updates main restricted universe multiverse
    4: deb http: //mirror.tedra.es/ubuntu jammy-backports main restricted universe multiverse
    5: deb http: //security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
  Active apt repos in: /etc/apt/sources.list.d/slack.list
    1: deb https: //packagecloud.io/slacktechnologies/slack/debian/ jessie main
  Active apt repos in: /etc/apt/sources.list.d/vscode.list
    1: deb [arch=amd64,arm64,armhf] http: //packages.microsoft.com/repos/code stable main
  Active apt repos in: /etc/apt/sources.list.d/yannubuntu-boot-repair-jammy.list
    1: deb http: //ppa.launchpad.net/yannubuntu/boot-repair/ubuntu jammy main
Info:
  Processes: 340 Uptime: 9m Memory: 15.5 GiB used: 2.38 GiB (15.3%) Init: systemd v: 249
  runlevel: 5 Compilers: gcc: 11.2.0 alt: 11 clang: 14.0.0-1ubuntu1
  Client: Unknown python3.10 client inxi: 3.3.13
Cosmo.
Level 24
Level 24
Posts: 22055
Joined: Sat Dec 06, 2014 7:34 am

Re: Permanently change the brightness

Post by Cosmo. »

svprdga wrote:
Fri Sep 30, 2022 2:40 am
I have reviewed the NVidia settings but there's no brightness option there.
Reread my post. I wrote: SAVE button.
Gotcha!
User avatar
SMG
Level 23
Level 23
Posts: 18808
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Permanently change the brightness

Post by SMG »

svprdga wrote:
Thu Sep 29, 2022 4:09 am
Since I installed the latest version of Mint (21) the brightness of the built-in display of my laptop always starts with value 66 when I have an external monitor connected.
So when you do not have the external monitor attached, this does not happen? You can change it and it stays to whatever you changed it if the external monitor is not attached?
Image
A woman typing on a laptop with LM20.3 Cinnamon.
svprdga
Level 1
Level 1
Posts: 8
Joined: Wed Mar 30, 2022 10:07 am

Re: Permanently change the brightness

Post by svprdga »

SMG wrote:
Fri Sep 30, 2022 2:52 pm
svprdga wrote:
Thu Sep 29, 2022 4:09 am
Since I installed the latest version of Mint (21) the brightness of the built-in display of my laptop always starts with value 66 when I have an external monitor connected.
So when you do not have the external monitor attached, this does not happen? You can change it and it stays to whatever you changed it if the external monitor is not attached?
No, the same happens if the external monitor is not connected. Both external monitor connected or disconnected, the built-in display always starts at value 66.
User avatar
SMG
Level 23
Level 23
Posts: 18808
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Permanently change the brightness

Post by SMG »

svprdga wrote:
Sat Oct 01, 2022 4:38 am
Both external monitor connected or disconnected, the built-in display always starts at value 66.
I am going to move your topic to the Graphics Cards & Monitors section of the forum because I think this may relate to either the graphics driver or options for the driver.

Often, people have issues being able to change the brightness so it is good that you can change it after the system boots.

Did you have Mint 20 installed on this computer before changing to Mint 21? Or is Mint 21 the first version you tried on it?
Image
A woman typing on a laptop with LM20.3 Cinnamon.
User avatar
roblm
Level 15
Level 15
Posts: 5502
Joined: Sun Feb 24, 2013 2:41 pm

Re: Permanently change the brightness

Post by roblm »

When you open Nvidia Settings, are both the DP-0 and DP-3 screens listed on the left side? If yes, you should be able to select the laptop screen and then select Color Correction on the right side to change the brightness. After clicking the Confirm Current Changes, the setting should be saved.
svprdga
Level 1
Level 1
Posts: 8
Joined: Wed Mar 30, 2022 10:07 am

Re: Permanently change the brightness

Post by svprdga »

svprdga wrote:
Sat Oct 01, 2022 4:38 am
Did you have Mint 20 installed on this computer before changing to Mint 21? Or is Mint 21 the first version you tried on it?
This is a fresh install of Mint 21. I had previously Mint 20 but I installed 21 by doing a full disk partitioning (not upgrading from version 20 I mean).
roblm wrote:
Sun Oct 02, 2022 10:52 am
When you open Nvidia Settings, are both the DP-0 and DP-3 screens listed on the left side? If yes, you should be able to select the laptop screen and then select Color Correction on the right side to change the brightness. After clicking the Confirm Current Changes, the setting should be saved.
I tryied and yes, I have both options and I can set the level of brightness listed there. But the output is not the same as changing the brightness from the system power management settings. The screen starts to turn white...this is not exactly what I want.
User avatar
Termy
Level 10
Level 10
Posts: 3100
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: Permanently change the brightness

Post by Termy »

My approach would be to simply automate the editing of that pseudo-file using a command within '/etc/rc.local', because that file (an awesome relic of SysV, but fully supported now in SystemD) is executed a bit before the Display Manager under the 'root' user. In that way, whenever you boot up, the brightness will be set to what you want.

A simpler but not as elegant approach can be found at the end of this post.

That being said, since it's before the Display Manager, or at least very soon after, you may need to postpone the command with sleep(1), but doing so in the background (IE: { sleep 10s; YOUR_COMMAND; } &). This way, the brightness is adjusted when sleep(1) is finished, but the system is not halted at boot-time. This is only relevant if you need to use sleep(1), which you may not.

Note that the '/etc/rc.local' file needs to be executable by at least 'root', who should also be its owner, and the file's group should be 'root'. A suitable mode would be 700 or 744, with user and group both being 0. It's critical that nobody else can write to the file. This can, after creating the file, be set with:

Code: Select all

sudo chown 0:0 /etc/rc.local
sudo chmod 744 /etc/rc.local
The file should be a shell script, so at the start, you will want #!/bin/sh (the shebang), followed by the desired command on the next line. If you provide a syntax error or otherwise make a mistake within the file, the OS will almost certainly not boot, at which point you'll need to edit and correct the file from something like a Live CD/USB (IE: the Linux Mint installation medium). In that event, you may actually be able to edit it via another TTY. The script should exit with a status of 0, unless a predictable error occurs. Here's a template:

Code: Select all

#!/bin/sh

{
	# Your command(s) would go here, without the prepended hash.
} 1> /dev/null

exit 0
The STDOUT of the braced block will be ignored, leaving only errors, to avoid any clutter when booting up. Code placed within a braced block is grouped together within the same shell instance.

However, that's for a global setting. If you wish, you could have the desired command executed at user login, via whichever GUI you have for that, which would be a much simpler approach. Every non-system user (IE: you) will need to make that change after logging in, though.
I'm also Terminalforlife on GitHub.
User avatar
SMG
Level 23
Level 23
Posts: 18808
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Permanently change the brightness

Post by SMG »

svprdga wrote:
Mon Oct 03, 2022 3:12 am
This is a fresh install of Mint 21. I had previously Mint 20 but I installed 21 by doing a full disk partitioning (not upgrading from version 20 I mean).
Do you know that your computer has the most recent BIOS/UEFI installed?
Image
A woman typing on a laptop with LM20.3 Cinnamon.
Post Reply

Return to “Graphics Cards & Monitors”