2

When I run acpi_listen while running gnome-session or ubuntu-session, and press the Brightness Up/Down keys on the keyboard, I get output like this:

video/brightnessdown BRTDN 00000087 00000000
video/brightnessup BRTUP 00000086 00000000

from xev:

KeymapNotify event, serial 38, synthetic NO, window 0x0,
    keys:  4294967216 0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

FocusOut event, serial 38, synthetic NO, window 0x2000001,
    mode NotifyGrab, detail NotifyAncestor

FocusIn event, serial 38, synthetic NO, window 0x2000001,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 38, synthetic NO, window 0x0,
    keys:  2   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

And the brightness of the screen is adjusted correctly. However, when running i3wm, no output is shown from running acpi_listen or xev when pressing the keys.

In both environments, dmesg shows this:

[ 5237.752419] atkbd serio0: Unknown key pressed (translated set 2, code 0xab on isa0060/serio0).
[ 5237.752426] atkbd serio0: Use 'setkeycodes e02b <keycode>' to make it known.
[ 5237.763659] atkbd serio0: Unknown key released (translated set 2, code 0xab on isa0060/serio0).
[ 5237.763666] atkbd serio0: Use 'setkeycodes e02b <keycode>' to make it known.

What service would be running in the gnome-based session that is picking up the keypresses/triggering the acpi events, that is not running/configured in the i3wm session?

Another interesting thing is that in the gnome session, the button/lid LID close acpi_event fires on a lid close, but in i3wm the KEY_WLAN event is triggered.


Laptop: HP 15-cx0056wm (w/ Intel Integrated Graphics & Nvidia 1050Ti)

Nvidia Driver Version: nvidia-driver-418, Nvidia OPTIMUS profile is currently enabled

Ubuntu Version: 19.04

Gnome Version: 3.32.1

0

I've discovered that gnome-session has its own power management daemon that runs in the background once the session has started, and performs actions separate from acpi (such as managing the backlight, sending the system to sleep on the lid switch changes, etc.)

I've been unsuccessful in finding out how to intercept these events directly in i3, or finding a seperate utility to listen to them for me. However, I have found an acceptable solution for now in i3-gnome

It starts the gnome services in the background while allowing i3wm to run as the window manager. This results in my backlight and lid switch being handled by the gnome power daemon, and my windows being managed by i3wm.

0

The acpid can handle the acpi events video/brightnessup, video/brightnessdown and lid, power button, volume up/down etc without any window manager or desktop manager. I edited my /etc/acpi/handler.sh and the backlight and volume buttons work even in the console:

video/brightnessup)
        (echo $(( $(cat /sys/class/backlight/intel_backlight/brightness)+5 )) >/sys/class/backlight/intel_backlight/brightness )
        ;;
video/brightnessdown)
        (echo $(( $(cat /sys/class/backlight/intel_backlight/brightness)-5 )) >/sys/class/backlight/intel_backlight/brightness )
        ;;
button/screenlock)
        logger "screenlock Fn + F7 pressed"
        ;;
0B3CBB35-E3C2-)
        logger "acpi tag 0B3CBB35-E3C2- misc"
        ;;
button/mute)
        logger "mute Fn + f10 toggle pressed"
        (amixer -q sset Master,0 toggle)
        ;;
button/volumeup)
        logger "volumeup Fn + F12 pressed"
        (amixer -q sset Master,0 2dB+)
        ;;
button/volumedown)
        logger "volumedown Fn + F11 pressed"
        (amixer -q sset Master,0 2dB-)
        ;;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.