Xfce Forum

Sub domains
 

You are not logged in.

#1 2025-11-06 19:00:22

blindfish
Member
Registered: 2025-11-06
Posts: 11
UbuntuFirefox 144.0

[SOLVED] Screen has max brightness after wake up

I love XUBUNTU since more than 10 years. Now I got a new Lenovo Yoga 7 2-in-1 16ILL10 with OLED screen that's giving me headaches. It took me some time to find out that I had to upgrade the kernel to 6.14 in order to get access to the brightness control. The function keys (F5 and F6) work now, I can use brightnessctl and the slider of the power managment icon works too. BUT:
The device boots with the last brightness level until I entered the password in the login screen. Then the screen switches to max brightness. Pushing one of the function keys sets the brightness to plus (F5) or minus (F6) one of the last brightness level. So the last brightness level is stored somewhere (/sys/class/backlight/intel_backlight/brightness contains the right value) but this level seems to be ignored then.
The screen also starts with max brightness when the power manager had switched off the screen, I used 'xset dpms force off' or the screensaver had turned the screen off.
Here is some information about my system:
xfce4-about

$ uname -a
Linux elke-Yoga 6.14.0-35-generic #35~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Oct 14 13:55:17 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
$ inxi -SMGxxxz --vs
inxi 3.3.34-00 (2024-04-13)
System:
  Kernel: 6.14.0-35-generic arch: x86_64 bits: 64 compiler: gcc v: 13.3.0
    clocksource: tsc
  Desktop: Xfce v: 4.18.1 tk: Gtk v: 3.24.41 wm: xfwm4 v: 4.18.0
    with: xfce4-panel tools: xfce4-screensaver vt: 7 dm: LightDM v: 1.30.0
    Distro: Xubuntu 24.04.3 LTS (Noble Numbat) base: Ubuntu
Machine:
  Type: Convertible System: LENOVO product: 83JT v: Yoga 7 2-in-1 16ILL10
    serial: <superuser required> Chassis: type: 31 v: Yoga 7 2-in-1 16ILL10
    serial: <superuser required>
  Mobo: LENOVO model: LNVNB161216 v: SDK0T76574 WIN
    serial: <superuser required> part-nu: LENOVO_MT_83JT_BU_idea_FM_Yoga 7
    2-in-1 16ILL10 uuid: <superuser required> UEFI: LENOVO v: QPCN13WW
    date: 02/19/2025
Graphics:
  Device-1: Intel Lunar Lake [Intel Graphics] vendor: Lenovo driver: xe
    v: kernel arch: Gen-14 ports: active: DP-3,eDP-1 empty: DP-1, DP-2, DP-4,
    DP-5, HDMI-A-1 bus-ID: 00:02.0 chip-ID: 8086:64a0 class-ID: 0300
  Device-2: Chicony Integrated Camera driver: hid-sensor-hub,usbhid,uvcvideo
    type: USB rev: 2.0 speed: 480 Mb/s lanes: 1 bus-ID: 3-5:4 chip-ID: 04f2:b83c
    class-ID: fe01 serial: <filter>
  Display: x11 server: X.Org v: 21.1.11 compositor: xfwm4 v: 4.18.0 driver:
    X: loaded: modesetting unloaded: fbdev,vesa dri: iris gpu: xe
    display-ID: :0.0 screens: 1
  Screen-1: 0 s-res: 2560x1440 s-dpi: 96 s-size: 677x381mm (26.65x15.00")
    s-diag: 777mm (30.58")
  Monitor-1: DP-3 mapped: DP-1-1 pos: primary model: Lenovo R27qe
    serial: <filter> res: 2560x1440 hz: 60 dpi: 109
    size: 597x336mm (23.5x13.23") diag: 685mm (27") modes: max: 2560x1440
    min: 720x400
  Monitor-2: eDP-1 pos: primary model: Samsung ATNA60HR01-0 res: 2560x1440
    hz: 60 dpi: 191 size: 340x220mm (13.39x8.66") diag: 405mm (15.9")
    modes: 2880x1800
  API: EGL v: 1.5 hw: drv: intel iris platforms: device: 0 drv: iris
    device: 1 drv: swrast gbm: drv: iris surfaceless: drv: iris x11: drv: iris
    inactive: wayland
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: intel mesa
    v: 25.0.7-0ubuntu0.24.04.2 glx-v: 1.4 direct-render: yes renderer: Mesa
    Intel Graphics (LNL) device-ID: 8086:64a0
$ xfconf-query -c xfce4-power-manager -lv
/xfce4-power-manager/blank-on-ac                        1
/xfce4-power-manager/blank-on-battery                   2
/xfce4-power-manager/brightness-exponential             false
/xfce4-power-manager/brightness-level-on-ac             10
/xfce4-power-manager/brightness-level-on-battery        20
/xfce4-power-manager/brightness-on-ac                   9
/xfce4-power-manager/brightness-on-battery              120
/xfce4-power-manager/brightness-switch                  0
/xfce4-power-manager/brightness-switch-restore-on-exit  1
/xfce4-power-manager/critical-power-action              1
/xfce4-power-manager/critical-power-level               15
/xfce4-power-manager/dpms-enabled                       true
/xfce4-power-manager/dpms-on-ac-off                     0
/xfce4-power-manager/dpms-on-ac-sleep                   0
/xfce4-power-manager/dpms-on-battery-off                30
/xfce4-power-manager/dpms-on-battery-sleep              15
/xfce4-power-manager/handle-brightness-keys             true
/xfce4-power-manager/inactivity-on-ac                   60
/xfce4-power-manager/inactivity-on-battery              60
/xfce4-power-manager/inactivity-sleep-mode-on-ac        1
/xfce4-power-manager/inactivity-sleep-mode-on-battery   1
/xfce4-power-manager/lid-action-on-ac                   1
/xfce4-power-manager/lid-action-on-battery              1
/xfce4-power-manager/lock-screen-suspend-hibernate      false
/xfce4-power-manager/logind-handle-lid-switch           false
/xfce4-power-manager/power-button-action                3
/xfce4-power-manager/show-panel-label                   0
/xfce4-power-manager/show-tray-icon                     false
$lspci
00:00.0 Host bridge: Intel Corporation Device 6400 (rev 04)
00:02.0 VGA compatible controller: Intel Corporation Lunar Lake [Intel Graphics] (rev 04)
00:04.0 Signal processing controller: Intel Corporation Device 641d (rev 04)
00:07.0 PCI bridge: Intel Corporation Lunar Lake-M Thunderbolt 4 PCI Express Root Port #0 (rev 10)
00:07.2 PCI bridge: Intel Corporation Lunar Lake-M Thunderbolt 4 PCI Express Root Port #2 (rev 10)
00:0a.0 Signal processing controller: Intel Corporation Device 647d (rev 04)
00:0b.0 Processing accelerators: Intel Corporation Lunar Lake NPU (rev 04)
00:0d.0 USB controller: Intel Corporation Lunar Lake-M Thunderbolt 4 USB Controller (rev 10)
00:0d.2 USB controller: Intel Corporation Lunar Lake-M Thunderbolt 4 NHI #0 (rev 10)
00:0d.3 USB controller: Intel Corporation Lunar Lake-M Thunderbolt 4 NHI #1 (rev 10)
00:12.0 Serial controller: Intel Corporation Lunar Lake-M Integrated Sensor Hub (rev 10)
00:13.0 Communication controller: Intel Corporation Device a862 (rev 10)
00:14.0 USB controller: Intel Corporation Lunar Lake-M USB 3.2 Gen 2x1 xHCI Host Controller (rev 10)
00:14.2 RAM memory: Intel Corporation Device a87f (rev 10)
00:15.0 Serial bus controller: Intel Corporation Lunar Lake-M Serial IO I2C Controller #0 (rev 10)
00:16.0 Communication controller: Intel Corporation Device a870 (rev 10)
00:19.0 Serial bus controller: Intel Corporation Device a850 (rev 10)
00:19.1 Serial bus controller: Intel Corporation Device a851 (rev 10)
00:1c.0 PCI bridge: Intel Corporation Lunar Lake-M PCI Express Root Port #1 (rev 10)
00:1c.2 PCI bridge: Intel Corporation Lunar Lake-M PCI Express Root Port #3 (rev 10)
00:1c.4 PCI bridge: Intel Corporation Lunar Lake-M PCI Express Root Port #5 (rev 10)
00:1f.0 ISA bridge: Intel Corporation Device a807 (rev 10)
00:1f.3 Multimedia audio controller: Intel Corporation Lunar Lake-M HD Audio Controller (rev 10)
00:1f.4 SMBus: Intel Corporation Lunar Lake-M SMbus Controller (rev 10)
00:1f.5 Serial bus controller: Intel Corporation Lunar Lake-M SPI Controller (rev 10)
55:00.0 SD Host controller: O2 Micro, Inc. SD/MMC Card Reader Controller (rev 01)
56:00.0 Network controller: MEDIATEK Corp. Device 7925
57:00.0 Non-Volatile memory controller: SK hynix Device 1f69

What I tried so far:

  • Searched for similar topics in various forums. Most are quite old. Some are related to different graphic chips. None of the solutions does work in my case.

  • Exchanged xfce4-screensaver with xscreensaver -> same problem.

  • Tried various combinations of power manager settings -> no luck.

  • Tried to alter kernel parameters related to screen brightness -> no success.

In the past I got most problems solved by myself (with input from the web, of course) but now I'm stuck and need help from the gurus.

Offline

#2 2025-11-06 21:13:57

eriefisher
Wanderer
From: ON, Canada
Registered: 2008-10-25
Posts: 846
LinuxFirefox 144.0

Re: [SOLVED] Screen has max brightness after wake up

I don't know the syntax off hand but you could create a script to set the brightness and have it run at login. Place it in your autostart folder.


I AM CANADIAN!
Siduction
Debian Sid
Xfce 4.20 with Wayland/Labwc

Offline

#3 2025-11-06 22:12:30

blindfish
Member
Registered: 2025-11-06
Posts: 11
Windows 10Firefox 133.0

Re: [SOLVED] Screen has max brightness after wake up

Thanks for your proposal. This workaround would probably work, but I don't like the idea of having to login in each time the screensaver kicked in.There must be a smarter way, because the old status is present in the system and this status should be set instead of switching to the highest brightness....
Nevertheless, your proposal could serve as a preliminary solution if the script you have in mind could be executed not only after login but also whenever the screen changes from off to active. Xscreensaver provides a hook for that: https://forums.freebsd.org/threads/disp … ing.78236/
I'll try to find out if this could be done with XFCE-screensaver, too.

Offline

#4 2025-11-07 13:25:42

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 12,418
LinuxFirefox 144.0

Re: [SOLVED] Screen has max brightness after wake up

Thanks for your proposal. This workaround would probably work, but I don't like the idea of having to login in each time the screensaver kicked in.There must be a smarter way, because the old status is present in the system and this status should be set instead of switching to the highest brightness....

Are you saying that the brightness switches everytime you return from the screensaver? Your initial post indicated that this only happened at boot.

Monitor-1: DP-3 mapped: DP-1-1 pos: primary model: Lenovo R27qe
    serial: <filter> res: 2560x1440 hz: 60 dpi: 109
    size: 597x336mm (23.5x13.23") diag: 685mm (27") modes: max: 2560x1440
    min: 720x400
  Monitor-2: eDP-1 pos: primary model: Samsung ATNA60HR01-0 res: 2560x1440
    hz: 60 dpi: 191 size: 340x220mm (13.39x8.66") diag: 405mm (15.9")
    modes: 2880x1800

Also, you seem to have an external monitor plugged in. Does the brightness issue occur on just one of the screens or both? What happens if you boot with the external monitor disconnected?

Does your laptop have an "adaptive brightness" feature, and if so, are you able to disable it at the bios level?


Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2025-11-07 19:46:41

blindfish
Member
Registered: 2025-11-06
Posts: 11
UbuntuFirefox 144.0

Re: [SOLVED] Screen has max brightness after wake up

Thank you for having a look at my problem. Yes, every time the screen (OLED screen of the Notebook) switches on after it had gone black due to the screensaver, it switches to full brightness. The same happens after boot login (the login screen itself has still the right brightness) and after wakeup from supend.
Yes, I have a second monitor connected. The brightness of this monitor doesn't change at all. It is simply switched on or off. For the notebook it doesn't matter if the external monitor is connected or not. The issue remains the same with or without it. As far as I can see, the laptop doesn't have an "adaptive brightness". At least, I can't see any switch for such an option and I never used it with Windows. Installing XUBUNTU was my first action when I received the device.

Offline

#6 2025-11-07 19:58:52

eriefisher
Wanderer
From: ON, Canada
Registered: 2008-10-25
Posts: 846
LinuxFirefox 144.0

Re: [SOLVED] Screen has max brightness after wake up

I didn't catch that this was an OLED screen. This may complicate things.
https://wiki.archlinux.org/title/Backlight

Since OLED screens have no backlight, brightness cannot be controlled by changing backlight power on laptops equipped with an OLED screen. In this case, perceived screen brightness can be adjusted with a PWM control (not implemented in the Linux kernel) or via software color correction.

There is more in the wiki link and a link to a oled script on github.


I AM CANADIAN!
Siduction
Debian Sid
Xfce 4.20 with Wayland/Labwc

Offline

#7 2025-11-07 20:22:49

blindfish
Member
Registered: 2025-11-06
Posts: 11
Windows 10Firefox 133.0

Re: [SOLVED] Screen has max brightness after wake up

Thank you for the link. I know this content and I also tried the grub option "acpi_backlight=native". I got a second directory named "Ideapad" in /sys/class/backlight then and I couldn't change the brightness anymore with function keys or brightnessctl. I never tried the udev rule because solving the problem for boot alone is not enough. The links to github lead to tools for altering the brightness. I don't need that because brightnessctl works fine.

I made a mistake answering the questions from ToZ: If I boot the notebook without the second monitor, I get the right brightness. But as soon as the screensaver switched the screen off, I get the max brightness again.

When I started this thread I forgot to mention that I installed the newest driver for the graphics from the Intel homepage.That didn't change anything.

Offline

#8 2025-11-25 20:36:25

blindfish
Member
Registered: 2025-11-06
Posts: 11
UbuntuFirefox 145.0

Re: [SOLVED] Screen has max brightness after wake up

What I found out in the meantime:

The folder /sys/class/backlight/intel_backlight contains 5 files:
- actual_brightness
- bl_power
- brightness
- max_brightness
and 2 links:
- device -> ../../card1-eDP-1
- subsystem -> ../../../../../../../class/backlight

I set the brightness to 10 % using the function keys (brightnessctl worked too). The brightness files contained the following values:
- actual_brightness : 49
- brightness: 49
- max_brightness: 496

I rebooted the system. When reaching the login screen, the brightness was still right and the files contained the same values as before. After entering the login credentials the screen turned to max brightness and the files contained:
- actual_brightness : 0
- brightness: 49
- max_brightness: 496

I set the brightness back to 49 and let the system suspend. After waking up (I don't use a login screen then), the screen has full brightness again and the files contain:
- actual_brightness : 0
- brightness: 49
- max_brightness: 496

Which process or service might mess with the brightness and set the content of the actual_brightness file to zero when logging in or waking up from suspend? I'm ready to spend more effort in investigation but I don't have any clue where to start.

Btw: Changing the content of the brightness file using "echo" as proposed in https://wiki.archlinux.org/title/Backlight  doesn't work: Permission denied (even with sudo).

Offline

#9 2025-11-26 01:33:40

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 12,418
LinuxFirefox 145.0

Re: [SOLVED] Screen has max brightness after wake up

Which process or service might mess with the brightness and set the content of the actual_brightness file to zero when logging in or waking up from suspend? I'm ready to spend more effort in investigation but I don't have any clue where to start.

Try this test to see if its Xfce that is doing this or something else. Quit the power manager:

xfce4-power-manager -q

...then suspend your system and resume. If the problem continues to exist, the cause is somewhere else.

Btw: Changing the content of the brightness file using "echo" as proposed in https://wiki.archlinux.org/title/Backlight  doesn't work: Permission denied (even with sudo).

If you are not root, then run it like this:

echo VALUE | sudo tee /sys/class/backlight/intel_backlight/actual_brightness

Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#10 2025-11-26 14:47:06

blindfish
Member
Registered: 2025-11-06
Posts: 11
UbuntuFirefox 145.0

Re: [SOLVED] Screen has max brightness after wake up

The problem continues to exist. Even worse: the function keys don't work anymore. But brightnessctl does work. The command line you proposed does work with the brightness file but not with the actual_brightness file (still permission denied). Anyhow, the brightness file is the right place to change the brightness.

I found another link to the same problem:
https://bbs.archlinux.org/viewtopic.php?id=307614
Unfortunately upgrading the kernel doesn't help in my case. Nevertheless, the discussion also points to a kernel problem. So I was probably wrong, assuming a bug in Xfce. Sorry for that, but without your help I wouldn't have come to this conclusion. Thank you for that.

If I find a solution, I'll report it here in order to close this topic properly.

Offline

#11 2025-11-28 10:55:51

blindfish
Member
Registered: 2025-11-06
Posts: 11
UbuntuFirefox 145.0

Re: [SOLVED] Screen has max brightness after wake up

I'm giving up. Things are getting too complicated for me. A simple workaround will do for the moment:

I created a simple script /lib/systemd/system-sleep/restore-brightness with the following content:

#!/bin/sh
case $1 in
    pre)  ;;
    post)
        bright=`cat /sys/class/backlight/intel_backlight/brightness`
        echo $bright > /sys/class/backlight/intel_backlight/brightness
    ;;
esac

Thanks for helping me coming this far!

Added later 5 h 10 min 24 s:
Sorry, it's not over yet....
The script above works fine if the notebook is set to suspend manually (sudo systemctl suspend) but it doesn't  work if the system is suspended by the xfce power manager. My first guess was, that the power manager doesn't put the system into suspend at all, but only turns the screen black (suspend means s2idle, S3 or even S4 ist not available). Searching for help regarding this problem I found this thread: Xfce Power Manager doesn't put the computer to sleep
In the first step I got:

xfce4-power-manager --debug
TRACE[xfpm-main.c:210] xfpm_start(): Starting the power manager
TRACE[xfpm-xfconf.c:169] xfpm_xfconf_load(): Using default configuration for general-notification
TRACE[xfpm-xfconf.c:169] xfpm_xfconf_load(): Using default configuration for show-brightness-popup
TRACE[xfpm-xfconf.c:169] xfpm_xfconf_load(): Using default configuration for brightness-step-count
TRACE[xfpm-xfconf.c:169] xfpm_xfconf_load(): Using default configuration for sleep-button-action
TRACE[xfpm-xfconf.c:169] xfpm_xfconf_load(): Using default configuration for battery-button-action
TRACE[xfpm-xfconf.c:169] xfpm_xfconf_load(): Using default configuration for brightness-slider-min-level
TRACE[xfpm-xfconf.c:169] xfpm_xfconf_load(): Using default configuration for dpms-sleep-mode
TRACE[xfpm-xfconf.c:169] xfpm_xfconf_load(): Using default configuration for network-manager-sleep
TRACE[xfpm-xfconf.c:169] xfpm_xfconf_load(): Using default configuration for logind-handle-power-key
TRACE[xfpm-xfconf.c:169] xfpm_xfconf_load(): Using default configuration for logind-handle-suspend-key
TRACE[xfpm-xfconf.c:169] xfpm_xfconf_load(): Using default configuration for logind-handle-hibernate-key
TRACE[xfpm-xfconf.c:169] xfpm_xfconf_load(): Using default configuration for heartbeat-command
TRACE[xfpm-xfconf.c:169] xfpm_xfconf_load(): Using default configuration for show-presentation-indicator
TRACE[xfpm-polkit.c:289] xfpm_polkit_init_data(): Using unix session polkit subject
TRACE[xfpm-polkit.c:345] xfpm_polkit_check_auth_intern(): polkit request: (('unix-process', {'pid': <uint32 23761>, 'start-time': <uint64 1434793>}), 'org.freedesktop.login1.power-off', @a{ss} {}, uint32 0, '')
TRACE[xfpm-polkit.c:366] xfpm_polkit_check_auth_intern(): Action=org.freedesktop.login1.power-off is authorized=TRUE
TRACE[xfpm-polkit.c:345] xfpm_polkit_check_auth_intern(): polkit request: (('unix-process', {'pid': <uint32 23761>, 'start-time': <uint64 1434793>}), 'org.freedesktop.login1.reboot', @a{ss} {}, uint32 0, '')
TRACE[xfpm-polkit.c:366] xfpm_polkit_check_auth_intern(): Action=org.freedesktop.login1.reboot is authorized=TRUE
TRACE[xfpm-polkit.c:345] xfpm_polkit_check_auth_intern(): polkit request: (('unix-process', {'pid': <uint32 23761>, 'start-time': <uint64 1434793>}), 'org.freedesktop.login1.suspend', @a{ss} {}, uint32 0, '')
TRACE[xfpm-polkit.c:366] xfpm_polkit_check_auth_intern(): Action=org.freedesktop.login1.suspend is authorized=TRUE
TRACE[xfpm-polkit.c:345] xfpm_polkit_check_auth_intern(): polkit request: (('unix-process', {'pid': <uint32 23761>, 'start-time': <uint64 1434793>}), 'org.freedesktop.login1.hibernate', @a{ss} {}, uint32 0, '')
TRACE[xfpm-polkit.c:366] xfpm_polkit_check_auth_intern(): Action=org.freedesktop.login1.hibernate is authorized=FALSE
TRACE[xfpm-power.c:916] xfpm_power_get_power_devices(): Power device detected at : /org/freedesktop/UPower/devices/battery_BAT0
TRACE[xfpm-power.c:875] xfpm_power_add_device(): 'battery' device added
TRACE[xfpm-power.c:884] xfpm_power_add_device(): Battery device type 'battery' detected at: /org/freedesktop/UPower/devices/battery_BAT0
TRACE[xfpm-button.c:177] xfpm_button_xevent_key(): Grabbed key 124 : ((XfpmButtonKey) BUTTON_POWER_OFF)
TRACE[xfpm-button.c:170] xfpm_button_xevent_key(): could not map keysym 1008ffa8 to keycode
TRACE[xfpm-button.c:177] xfpm_button_xevent_key(): Grabbed key 213 : ((XfpmButtonKey) BUTTON_HIBERNATE)
TRACE[xfpm-button.c:177] xfpm_button_xevent_key(): Grabbed key 150 : ((XfpmButtonKey) BUTTON_SLEEP)
TRACE[xfpm-button.c:177] xfpm_button_xevent_key(): Grabbed key 233 : ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_UP)
TRACE[xfpm-button.c:177] xfpm_button_xevent_key(): Grabbed key 232 : ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_DOWN)
TRACE[xfpm-button.c:177] xfpm_button_xevent_key(): Grabbed key 244 : ((XfpmButtonKey) BUTTON_BATTERY)
TRACE[xfpm-button.c:177] xfpm_button_xevent_key(): Grabbed key 238 : ((XfpmButtonKey) BUTTON_KBD_BRIGHTNESS_UP)
TRACE[xfpm-button.c:177] xfpm_button_xevent_key(): Grabbed key 237 : ((XfpmButtonKey) BUTTON_KBD_BRIGHTNESS_DOWN)
TRACE[xfpm-power.c:916] xfpm_power_get_power_devices(): Power device detected at : /org/freedesktop/UPower/devices/line_power_ADP1
TRACE[xfpm-power.c:875] xfpm_power_add_device(): 'line-power' device added
TRACE[xfpm-power.c:206] xfpm_power_check_polkit_auth(): using logind suspend backend
TRACE[xfpm-polkit.c:345] xfpm_polkit_check_auth_intern(): polkit request: (('unix-process', {'pid': <uint32 23761>, 'start-time': <uint64 1434793>}), 'org.freedesktop.login1.suspend', @a{ss} {}, uint32 0, '')
TRACE[xfpm-polkit.c:366] xfpm_polkit_check_auth_intern(): Action=org.freedesktop.login1.suspend is authorized=TRUE
TRACE[xfpm-polkit.c:345] xfpm_polkit_check_auth_intern(): polkit request: (('unix-process', {'pid': <uint32 23761>, 'start-time': <uint64 1434793>}), 'org.freedesktop.login1.hibernate', @a{ss} {}, uint32 0, '')
TRACE[xfpm-polkit.c:366] xfpm_polkit_check_auth_intern(): Action=org.freedesktop.login1.hibernate is authorized=FALSE
TRACE[xfpm-power.c:1416] xfpm_update_blank_time(): Prev Timeout: 300 / New Timeout: 600
TRACE[xfpm-power.c:1416] xfpm_update_blank_time(): Prev Timeout: 600 / New Timeout: 300
TRACE[xfpm-manager.c:647] xfpm_manager_inhibit_sleep_systemd(): Inhibiting systemd sleep: handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch
TRACE[xfpm-manager.c:537] xfpm_manager_set_idle_alarm_on_ac(): setting inactivity sleep timeout on ac to 1
TRACE[xfpm-manager.c:561] xfpm_manager_set_idle_alarm_on_battery(): setting inactivity sleep timeout on battery to 20
TRACE[xfpm-brightness.c:240] xfpm_brightness_setup_xrandr(): No outputs have backlight property
TRACE[xfpm-brightness.c:301] xfpm_brightness_helper_get_value(): Executing command: /usr/sbin/xfpm-power-backlight-helper --get-max-brightness
TRACE[xfpm-brightness.c:333] xfpm_brightness_setup_helper(): xfpm_brightness_setup_helper: get-max-brightness returned 496
TRACE[xfpm-brightness.c:500] xfpm_brightness_setup(): xrandr not available, brightness controlled by sysfs helper; min_level=0 max_level=496
TRACE[xfpm-brightness.c:301] xfpm_brightness_helper_get_value(): Executing command: /usr/sbin/xfpm-power-backlight-helper --get-brightness-switch
TRACE[xfpm-brightness.c:415] xfpm_brightness_helper_set_switch(): Executing command: pkexec /usr/sbin/xfpm-power-backlight-helper --set-brightness-switch 0
TRACE[xfpm-backlight.c:516] xfpm_backlight_set_property(): Set kernel brightness switch to 0
TRACE[xfpm-brightness.c:301] xfpm_brightness_helper_get_value(): Executing command: /usr/sbin/xfpm-power-backlight-helper --get-brightness
TRACE[xfpm-brightness.c:360] xfpm_brightness_helper_get_level(): xfpm_brightness_helper_get_level: get-brightness returned 49
TRACE[xfpm-backlight.c:293] xfpm_backlight_brightness_on_ac_settings_changed(): Alarm on ac timeout changed 9
TRACE[xfpm-backlight.c:314] xfpm_backlight_brightness_on_battery_settings_changed(): Alarm on battery timeout changed 120
TRACE[xfpm-polkit.c:237] xfpm_polkit_free_data(): Destroying Polkit data
TRACE[xfpm-manager.c:492] xfpm_manager_alarm_timeout_cb(): Alarm inactivity timeout id 3
TRACE[xfpm-brightness.c:240] xfpm_brightness_setup_xrandr(): No outputs have backlight property
TRACE[xfpm-brightness.c:301] xfpm_brightness_helper_get_value(): Executing command: /usr/sbin/xfpm-power-backlight-helper --get-max-brightness
TRACE[xfpm-brightness.c:333] xfpm_brightness_setup_helper(): xfpm_brightness_setup_helper: get-max-brightness returned 496
TRACE[xfpm-brightness.c:500] xfpm_brightness_setup(): xrandr not available, brightness controlled by sysfs helper; min_level=0 max_level=496
TRACE[xfpm-brightness.c:301] xfpm_brightness_helper_get_value(): Executing command: /usr/sbin/xfpm-power-backlight-helper --get-brightness
TRACE[xfpm-brightness.c:360] xfpm_brightness_helper_get_level(): xfpm_brightness_helper_get_level: get-brightness returned 49
TRACE[xfpm-brightness.c:378] xfpm_brightness_helper_set_level(): Executing command: pkexec /usr/sbin/xfpm-power-backlight-helper --set-brightness 49

I was quite surprised to see the command "pkexec /usr/sbin/xfpm-power-backlight-helper --set-brightness 49". I got curious, deleted ḿy own script and repeated the last step. The screen turned on with max brightness. I therefore assumed, that there might be something wrong with "pkexec /usr/sbin/xfpm-power-backlight-helper --set-brightness 49". The funny thing is that the brightness returns to the right value (49 in this case) after executing this command manually (e.g. in another terminal). Perhaps a timing problem?

Offline

#12 2025-11-28 17:58:18

Misko_2083
Member
Registered: 2015-10-13
Posts: 232
Website
LinuxFirefox 140.0

Re: [SOLVED] Screen has max brightness after wake up

blindfish wrote:

I
The script above works fine if the notebook is set to suspend manually (sudo systemctl suspend) but it doesn't  work if the system is suspended by the xfce power manager.

I suspect it's a timing issue with backlight restoration between systemd and XFCE power manager.
You can try to add a delay.

#!/bin/sh
case $1 in
    post)
        sleep 2
        bright=`cat /sys/class/backlight/intel_backlight/brightness`
        echo $bright > /sys/class/backlight/intel_backlight/brightness
    ;;
esac

But it wouldn't be 100% reliable solution,


Do you want to exit the Circus?
https://www.youtube.com/watch?v=ZJwQicZHp_c

Offline

#13 2025-11-28 19:13:41

blindfish
Member
Registered: 2025-11-06
Posts: 11
UbuntuFirefox 145.0

Re: [SOLVED] Screen has max brightness after wake up

Hey, that was a good idea. Now the screen wakes up with full brightness and after 2 seconds my script kicks in and reduces the brightness to the right value. Thanks, that's good enough for me as a workaround. Nevertheless I'm wondering what could be done in order to let the power manager do its work "correctly". It uses the right commands, but obviously at the wrong time. Or should I better say: The power manager works correctly but other processes are not fast enough?

Offline

#14 2025-11-28 20:06:02

Misko_2083
Member
Registered: 2015-10-13
Posts: 232
Website
LinuxFirefox 140.0

Re: [SOLVED] Screen has max brightness after wake up

You can use a systemd service hooked to suspend.target or sleep.target after XFCE.

[Unit]
Description=Restore backlight
After=suspend.target

[Service]
Type=oneshot
ExecStart=/usr/local/bin/restore-backlight.sh

[Install]
WantedBy=suspend.target
[Unit]
Description=Restore backlight brightness after resume
After=sleep.target
Requires=sleep.target

[Service]
Type=oneshot
ExecStart=/usr/local/bin/restore-backlight.sh

[Install]
WantedBy=sleep.target

sleep.target is the generic stage for all sleep types: suspend (S3) suspend-to-idle (s2idle, many modern laptops!), hybrid sleep, hibernate, suspend-then-hibernate
suspend.target is the specific one for “Suspend-to-RAM (S3)” only.


Do you want to exit the Circus?
https://www.youtube.com/watch?v=ZJwQicZHp_c

Offline

#15 2025-11-28 21:56:01

blindfish
Member
Registered: 2025-11-06
Posts: 11
UbuntuFirefox 145.0

Re: [SOLVED] Screen has max brightness after wake up

Thank you for this nice idea. I'm still struggling with the implementation. I never dared to mess with systemd before and still have problems understanding what I'm doing. The service is active but doesn't alter the brightness. My first thought was that I should use ExecStop instead of ExecStart, but then systemd is complaining that ExecStart is missing. It's late in my timezone. I'll try to solve this challenge tomorrow.

Offline

#16 2025-11-29 18:56:03

lvsl
Member
Registered: 2024-08-22
Posts: 17
LinuxChrome 142.0

Re: [SOLVED] Screen has max brightness after wake up

I happen to come to a point where I need to frequently set brightness below the level of the available brightness from the brightness bar. Maybe give this a quick try?

Note: X11 only for xrandr. Use gammastep for wayland, which is another separate program

First get your monitor name:

$ xrandr --current
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
eDP-1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 309mm x 174mm
   1920x1080     60.00*+  60.00 +  59.97    59.96    59.93    40.00


Then use this to set the brightness. Brightness goes from 0-1. Careful else you will end up with a black/white monitor. Best for scripts though

xrandr --output eDP-1  --brightness 0.5  --gamma 1

Or for wayland:

PS: the -O is the letter O
gammastep -l <lattutude:longitude> -b day:night -g <red:green:blue> -O <temperature> -P (reset everything) -r (no fading animation)

Example below
gammastep -l 22:101 -b 1:1 -g 0.7 -O 6500 -P -r


----------------

Edit: I recall when I tried to put the script I've done with Xubuntu, pasting the script in the Application Autostart using xfce settings will not always work. I cannot even tell whether it was run. And that has to do with the brightness as well. Anything I set up seem to  just get "forgotten" at some point even after hibernation and was a real headache. For example. The brightness resets to max again

Back then I had a script on the desktop and I click on it and manually adjust everything for me. And if I don't do so, my eyes will sore at no time - the monitor was not only too bright, but off-color too. Here (github link) was my old work. It was meant to be a quick fix only

But when I decided to change to Arch linux the script problem just dissappeared. It starts faithfully and the color problem was no longer there, and everything else behaves well, with no more max brightness. So your case might not be weird at all. Xubuntu "misbehaves" from time to time (at 20.0x Lts back then) while Arch on Xfce was rock hard stable.

Last edited by lvsl (2025-11-29 19:33:01)

Offline

#17 2025-11-30 09:16:54

blindfish
Member
Registered: 2025-11-06
Posts: 11
UbuntuFirefox 145.0

Re: [SOLVED] Screen has max brightness after wake up

The systemd unit does work now. But I have to use the sleep command in the script again. (That was the reason why it didn't work immediately.) I'm wondering now what is the advantage over putting the script to the folder /lib/systemd/system-sleep/. This workaround doesn't fix the problem with the screen switching to full brightness after the screensaver turned it black. But I configured the power manager to use suspend only and newver turn the screen off. So I've reached a status now, where I can live with it.

@lvsl: Yes I can change the brightness with xrandr. But I somehow missed what should be the advantage of this trick. I can use the function keys für brightness control and with the script described above I can even restore the former brightness level. Furthermore I don't need to set the brightness below the level of the available brightness from the brightness bar. But it's very interesting that you got rid of your problem in Arch linux. I'll keep that in my mind. But right now I shy away from switching to another linux distribution. I feel very comfortable with Xubuntu and I'm very used to it. Switching to Arch linux will probably lead to other new quirks. I need my notebook for working with it, not for spending my time trying to solve or circumvent bugs. Nevertheless, thank you for sharing your knowledge!

Offline

#18 2025-11-30 16:26:57

lvsl
Member
Registered: 2024-08-22
Posts: 17
LinuxChrome 142.0

Re: [SOLVED] Screen has max brightness after wake up

blindfish wrote:

@lvsl: Yes I can change the brightness with xrandr. But I somehow missed what should be the advantage of this trick. I can use the function keys für brightness control and with the script described above I can even restore the former brightness level. Furthermore I don't need to set the brightness below the level of the available brightness from the brightness bar. But it's very interesting that you got rid of your problem in Arch linux. I'll keep that in my mind. But right now I shy away from switching to another linux distribution. I feel very comfortable with Xubuntu and I'm very used to it. Switching to Arch linux will probably lead to other new quirks. I need my notebook for working with it, not for spending my time trying to solve or circumvent bugs. Nevertheless, thank you for sharing your knowledge!

You are welcome! So long as you have any way to easily rid of the brightness problem I think anything is ok. Generally I don't think you need to go below the available brightness. It's just a bonus because I sometimes can't turn on the light with others asleep around me :D

If you have quick fix in your mind, you can even set a keyboard shortcut for that command. Here's a screenshot for you on how to do it. Right click on an empty area to bring out the menu. In keyboard, go to the tab Applications shortcut. Press add. Paste in the xrandr command (or any favorite command that works for you), and then press ok. Then press in the desired keyboard shortcut you want.

So every time when your screen goes too bright. For example, if you set the shortcut Ctrl-Alt-B for the xrandr command, then all you need to do is to press Ctrl-Alt-B

Screenshot_2025-12-01_00-20-59.png?raw=true

If your script happens to get too long. Save it in a file, and then paste the command "sh /your/full/file/path/script.sh" the same way you run the script, but full file path. More edit: if you edit the /sys/class/backlight/intel_backlight/brightness file by using the echo command. You will need sudo permission to do so, otherwise it will return permission denied. For xrandr you don't need such permission. So it depends what you found convenient

If you are using the script you have written it will be like this. Every time you use it via keyboard shortcut, it should ask for your password. pkexec is the graphic version of sudo. It means a graphical dialog will pop up. In Xubuntu case, it will usually be your user password. Otherwise, your root password

Command for the keyboard shortcut:
pkexec sh /full/file/path/script.sh

And the file below you already had, save it as a script. I added some comments and removed outer case-esac

#!/bin/sh
# Line after hash from this line onward are comments, 
# This file *need* root permission to run

# Save the value of the computer brightness into the value bright
bright=`cat /sys/class/backlight/intel_backlight/brightness`

# Write the original brightness value again into the /sys/class/.../brightness again
echo $bright > /sys/class/backlight/intel_backlight/brightness

If it works or not work, please put a note so someone else can help later if it doesn't. Or if it does, anyone after you can follow any working methods listed here. Even best is tell us how you ended up solving it. Good luck :)

Last edited by lvsl (2025-11-30 18:22:14)

Offline

#19 2025-12-01 07:52:50

blindfish
Member
Registered: 2025-11-06
Posts: 11
UbuntuFirefox 145.0

Re: [SOLVED] Screen has max brightness after wake up

Thank you. It does work. I'm using the systemd unit proposed by Misko_2083 (see above) which restores the brightness after resume automatically and created the applications shortcut you proposed as a fallback which I can use, if the screen had been turned off for other reasons (e.g. triggered by the screensaver).

How could I close this subject?

Offline

#20 2025-12-01 11:24:35

eriefisher
Wanderer
From: ON, Canada
Registered: 2008-10-25
Posts: 846
LinuxFirefox 145.0

Re: [SOLVED] Screen has max brightness after wake up

If you have found a solution you can edit the first post and add [SOLVED] to the beginning of the title.


I AM CANADIAN!
Siduction
Debian Sid
Xfce 4.20 with Wayland/Labwc

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.020 seconds, 7 queries executed - Memory usage: 770.77 KiB (Peak: 835.61 KiB) ]