Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Fn keys not working in Debian 12 on Lenovo Thinkpad T450s

162 views
Skip to first unread message

Rodolfo Medina

unread,
Jan 11, 2024, 4:00:06 AM1/11/24
to
As my machine has a dual boot with MS Windows, F2 and F3 keyboard keys work
fine in Windows in lowering and increasing sound volume, and F1 for muting it
etcetera F4, F5, F6..., but in Debian they don't seem to work.

Please help who can, thanks in advance.

Rodolfo

Nicolas George

unread,
Jan 11, 2024, 4:10:06 AM1/11/24
to
Rodolfo Medina (12024-01-11):
> As my machine has a dual boot with MS Windows, F2 and F3 keyboard keys work
> fine in Windows in lowering and increasing sound volume, and F1 for muting it
> etcetera F4, F5, F6..., but in Debian they don't seem to work.

Hi.

Try testing them with xev. Show what you get if you cannot read it.

Regards,

--
Nicolas George

Rodolfo Medina

unread,
Jan 11, 2024, 4:10:06 AM1/11/24
to
Rodolfo Medina <rodolfo...@gmail.com> writes:

> As my machine has a dual boot with MS Windows, F2 and F3 keyboard keys work
> fine in Windows in lowering and increasing sound volume, and F1 for muting it
> etcetera F4, F5, F6..., but in Debian they don't seem to work.

Sorry, I forgot to say that Openbox is my graphical environment.

Thanks,

Rodolfo

to...@tuxteam.de

unread,
Jan 11, 2024, 4:20:06 AM1/11/24
to
On Thu, Jan 11, 2024 at 08:53:46AM +0000, Rodolfo Medina wrote:
> As my machine has a dual boot with MS Windows, F2 and F3 keyboard keys work
> fine in Windows in lowering and increasing sound volume, and F1 for muting it
> etcetera F4, F5, F6..., but in Debian they don't seem to work.

"In Debian" is a wide land :-)

OT1H...

A week ago I installed Debian's Bookworm with MATE on a friend's computer
(Thinkpad x270) and the loudness keys worked out of the box.

OTOH...

Myself -- I have no desktop environment (fvwm on X, *no* systemd, *no*
DBUS, so that would count as "exotic guy").

On my laptop (a Thinkpad x230) the background brightness wasn't working
(I don't know about the loudness things, since I never needed/used them).

Therefore I decided to catch ACPI events and set up this:

--- ---
tomas@trotzki:~$ cat /etc/acpi/events/briteup

event=video/brightnessup
action=/etc/acpi/actions/brite "%e"
--- ---
tomas@trotzki:~$ cat /etc/acpi/events/britedn

event=video/brightnessdown
action=/etc/acpi/actions/brite "%e"
--- ---
tomas@trotzki:~$ cat /etc/acpi/actions/brite

#!/bin/sh
logger "[ACPI] $@"
BASE="/sys/class/backlight/intel_backlight"
CURR=$(cat "$BASE/brightness")
MAX=$(cat "$BASE/max_brightness")
# MIN is some arbitrary "low" value. Note that for values
# of MIN below 6 (more precisely: 2/11 for our factor), the
# thing gets stuck at the low end: (13 * x) / 11 == x,
# in integer arithmetic, for x <= 5.
#
# The "exponential" algorithm is a bit long at the low
# end. We might consider stretching there. Or increasing
# MIN.

MIN=20
if [ "$CURR" -lt "$MIN" ] ; then CURR="$MIN" ; fi

# NOTE: 11/13 is approx the fourth root of 1/2:
# i.e. four steps are a doubling/halving
# of brightness (constant steps gave too
# coarse jumps in the low range)

case $1 in
video/brightnessdown* )
NEW=$(( (11 * CURR) / 13 ))
;;
video/brightnessup* )
NEW=$(( (13 * CURR) / 11 ))
;;
* )
exit 0
;;
esac

if [ "$NEW" -lt "$MIN" ] ; then NEW="$MIN" ; fi
if [ "$NEW" -gt "$MAX" ] ; then NEW="$MAX" ; fi
logger "[ACPI] brightness $CURR --> $NEW"
echo "$NEW" > $BASE/brightness
--- ---

(The charm of using ACPI is that it works independently of X).

To find which events to wait on, just run acpi_listen on a
terminal and hit your dream's key.

> Please help who can, thanks in advance.

The appropriate medication will depend on your microbiome ;-)

Cheers
--
t
signature.asc

to...@tuxteam.de

unread,
Jan 11, 2024, 4:30:06 AM1/11/24
to
See my other post: I did start with xev, but I like things working on
the Linux console too, that's why I moved to ACPI events (but this is
special to special keys and won't catch regular keys. Alas.)

Cheers
--
t
signature.asc

Rodolfo Medina

unread,
Jan 11, 2024, 5:40:06 AM1/11/24
to
<to...@tuxteam.de> writes:

> On Thu, Jan 11, 2024 at 08:53:46AM +0000, Rodolfo Medina wrote:
>> As my machine has a dual boot with MS Windows, F2 and F3 keyboard keys work
>> fine in Windows in lowering and increasing sound volume, and F1 for muting it
>> etcetera F4, F5, F6..., but in Debian they don't seem to work.
>
> "In Debian" is a wide land :-)

It's Bookworm with Openbox.
Following your example, I aptitude-installed acpid and created
/etc/apt/events/briteup and /etc/acpi/actions/brite and filled them with the
stuff you reported; and then I did `chmod +x brite'... Then?

Thanks,

Rodolfo

to...@tuxteam.de

unread,
Jan 11, 2024, 6:00:06 AM1/11/24
to
On Thu, Jan 11, 2024 at 10:29:37AM +0000, Rodolfo Medina wrote:

[...]

> Following your example, I aptitude-installed acpid and created
> /etc/apt/events/briteup and /etc/acpi/actions/brite and filled them with the
> stuff you reported; and then I did `chmod +x brite'... Then?

...you might be able to change your screen's brightness by hitting your
brightness keys (here they are Fn+F8, Fn+F9).

Note that you might have to adjust the events to listen to or the paths
to the backlight system files (my "/sys/class/backlight/intel_backlight"
and companions).

Some tinkering possibly needed :-)

Cheers
--
t
signature.asc

Rodolfo Medina

unread,
Jan 11, 2024, 3:10:06 PM1/11/24
to
Thanks. Here's the whole output:

Outer window is 0x2200001, inner window is 0x2200002

PropertyNotify event, serial 8, synthetic NO, window 0x2200001,
atom 0x27 (WM_NAME), time 33946030, state PropertyNewValue

PropertyNotify event, serial 9, synthetic NO, window 0x2200001,
atom 0x22 (WM_COMMAND), time 33946030, state PropertyNewValue

PropertyNotify event, serial 10, synthetic NO, window 0x2200001,
atom 0x28 (WM_NORMAL_HINTS), time 33946030, state PropertyNewValue

CreateNotify event, serial 11, synthetic NO, window 0x2200001,
parent 0x2200001, window 0x2200002, (10,10), width 50, height 50
border_width 4, override NO

PropertyNotify event, serial 14, synthetic NO, window 0x2200001,
atom 0x167 (WM_PROTOCOLS), time 33946030, state PropertyNewValue

MapNotify event, serial 15, synthetic NO, window 0x2200001,
event 0x2200001, window 0x2200002, override NO

PropertyNotify event, serial 18, synthetic NO, window 0x2200001,
atom 0x186 (_NET_WM_VISIBLE_NAME), time 33946031, state PropertyNewValue

PropertyNotify event, serial 18, synthetic NO, window 0x2200001,
atom 0x188 (_NET_WM_VISIBLE_ICON_NAME), time 33946031, state PropertyNewValue

PropertyNotify event, serial 18, synthetic NO, window 0x2200001,
atom 0x1c1 (_OB_APP_ROLE), time 33946031, state PropertyNewValue

PropertyNotify event, serial 18, synthetic NO, window 0x2200001,
atom 0x1c3 (_OB_APP_NAME), time 33946031, state PropertyNewValue

PropertyNotify event, serial 18, synthetic NO, window 0x2200001,
atom 0x1c4 (_OB_APP_CLASS), time 33946031, state PropertyNewValue

PropertyNotify event, serial 18, synthetic NO, window 0x2200001,
atom 0x1c5 (_OB_APP_GROUP_NAME), time 33946031, state PropertyNewValue

PropertyNotify event, serial 18, synthetic NO, window 0x2200001,
atom 0x1c6 (_OB_APP_GROUP_CLASS), time 33946031, state PropertyNewValue

PropertyNotify event, serial 18, synthetic NO, window 0x2200001,
atom 0x1c2 (_OB_APP_TITLE), time 33946031, state PropertyNewValue

PropertyNotify event, serial 18, synthetic NO, window 0x2200001,
atom 0x1c7 (_OB_APP_TYPE), time 33946031, state PropertyNewValue

PropertyNotify event, serial 18, synthetic NO, window 0x2200001,
atom 0x18e (_NET_WM_ICON), time 33946031, state PropertyNewValue

ReparentNotify event, serial 18, synthetic NO, window 0x2200001,
event 0x2200001, window 0x2200001, parent 0x40169d,
(0,0), override NO

PropertyNotify event, serial 21, synthetic NO, window 0x2200001,
atom 0x18b (_NET_WM_STATE), time 33946031, state PropertyNewValue

ConfigureNotify event, serial 21, synthetic NO, window 0x2200001,
event 0x2200001, window 0x2200001, (0,0), width 178, height 178,
border_width 0, above 0x4016e9, override NO

ConfigureNotify event, serial 21, synthetic NO, window 0x2200001,
event 0x2200001, window 0x2200001, (1,22), width 178, height 178,
border_width 0, above 0x4016e9, override NO

PropertyNotify event, serial 21, synthetic NO, window 0x2200001,
atom 0x195 (_NET_FRAME_EXTENTS), time 33946031, state PropertyNewValue

PropertyNotify event, serial 21, synthetic NO, window 0x2200001,
atom 0x194 (_KDE_NET_WM_FRAME_STRUT), time 33946031, state PropertyNewValue

PropertyNotify event, serial 22, synthetic NO, window 0x2200001,
atom 0x191 (_NET_WM_ALLOWED_ACTIONS), time 33946031, state PropertyNewValue

ConfigureNotify event, serial 22, synthetic YES, window 0x2200001,
event 0x2200001, window 0x2200001, (1045,20), width 178, height 178,
border_width 2, above 0x0, override NO

PropertyNotify event, serial 22, synthetic NO, window 0x2200001,
atom 0x189 (_NET_WM_DESKTOP), time 33946032, state PropertyNewValue

MapNotify event, serial 39, synthetic NO, window 0x2200001,
event 0x2200001, window 0x2200001, override NO

VisibilityNotify event, serial 39, synthetic NO, window 0x2200001,
state VisibilityFullyObscured

PropertyNotify event, serial 39, synthetic NO, window 0x2200001,
atom 0x168 (WM_STATE), time 33946033, state PropertyNewValue

VisibilityNotify event, serial 39, synthetic NO, window 0x2200001,
state VisibilityUnobscured

Expose event, serial 39, synthetic NO, window 0x2200001,
(0,0), width 178, height 10, count 3

Expose event, serial 39, synthetic NO, window 0x2200001,
(0,10), width 10, height 58, count 2

Expose event, serial 39, synthetic NO, window 0x2200001,
(68,10), width 110, height 58, count 1

Expose event, serial 39, synthetic NO, window 0x2200001,
(0,68), width 178, height 110, count 0

FocusIn event, serial 40, synthetic NO, window 0x2200001,
mode NotifyNormal, detail NotifyNonlinear

KeymapNotify event, serial 40, synthetic NO, window 0x0,
keys: 4294967238 0 0 0 16 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

KeyRelease event, serial 44, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33946056, (71,312), root:(1118,334),
state 0x0, keycode 36 (keysym 0xff0d, Return), same_screen YES,
XLookupString gives 1 bytes: (0d) ""
XFilterEvent returns: False

KeyPress event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33949629, (71,312), root:(1118,334),
state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False

FocusOut event, serial 47, synthetic NO, window 0x2200001,
mode NotifyGrab, detail NotifyAncestor

FocusIn event, serial 47, synthetic NO, window 0x2200001,
mode NotifyUngrab, detail NotifyNonlinear

KeymapNotify event, serial 47, synthetic NO, window 0x0,
keys: 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 0

FocusOut event, serial 47, synthetic NO, window 0x2200001,
mode NotifyNormal, detail NotifyNonlinear

VisibilityNotify event, serial 47, synthetic NO, window 0x2200001,
state VisibilityFullyObscured

FocusIn event, serial 47, synthetic NO, window 0x2200001,
mode NotifyNormal, detail NotifyNonlinear

KeymapNotify event, serial 47, 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

VisibilityNotify event, serial 47, synthetic NO, window 0x2200001,
state VisibilityUnobscured

Expose event, serial 47, synthetic NO, window 0x2200001,
(0,0), width 178, height 10, count 3

Expose event, serial 47, synthetic NO, window 0x2200001,
(0,10), width 10, height 58, count 2

Expose event, serial 47, synthetic NO, window 0x2200001,
(68,10), width 110, height 58, count 1

Expose event, serial 47, synthetic NO, window 0x2200001,
(0,68), width 178, height 110, count 0

EnterNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33952869, (116,162), root:(1163,184),
mode NotifyNormal, detail NotifyNonlinear, same_screen YES,
focus YES, state 0

KeymapNotify event, serial 47, synthetic NO, window 0x0,
keys: 68 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

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33952870, (116,162), root:(1163,184),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33952878, (126,137), root:(1173,159),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33952888, (136,113), root:(1183,135),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33952898, (144,93), root:(1191,115),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33952908, (152,80), root:(1199,102),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33952917, (158,71), root:(1205,93),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953220, (158,69), root:(1205,91),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953230, (158,66), root:(1205,88),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953240, (159,63), root:(1206,85),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953249, (159,60), root:(1206,82),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953259, (160,57), root:(1207,79),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953269, (161,52), root:(1208,74),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953279, (162,48), root:(1209,70),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953288, (163,44), root:(1210,66),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953298, (164,40), root:(1211,62),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953308, (164,37), root:(1211,59),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953318, (164,35), root:(1211,57),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953327, (164,32), root:(1211,54),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953337, (164,29), root:(1211,51),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953347, (164,27), root:(1211,49),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953357, (163,25), root:(1210,47),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953366, (163,24), root:(1210,46),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953376, (162,22), root:(1209,44),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953386, (162,21), root:(1209,43),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953396, (162,21), root:(1209,43),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953406, (161,19), root:(1208,41),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953415, (161,18), root:(1208,40),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953425, (161,17), root:(1208,39),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953435, (161,16), root:(1208,38),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953445, (161,15), root:(1208,37),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953454, (161,13), root:(1208,35),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953464, (161,11), root:(1208,33),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953474, (161,9), root:(1208,31),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953484, (161,8), root:(1208,30),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953493, (161,6), root:(1208,28),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953503, (161,5), root:(1208,27),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953513, (161,4), root:(1208,26),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953532, (161,3), root:(1208,25),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953542, (162,2), root:(1209,24),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953552, (162,1), root:(1209,23),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953562, (162,1), root:(1209,23),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953581, (162,0), root:(1209,22),
state 0x0, is_hint 0, same_screen YES

MotionNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953591, (162,0), root:(1209,22),
state 0x0, is_hint 0, same_screen YES

LeaveNotify event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33953611, (162,-1), root:(1209,21),
mode NotifyNormal, detail NotifyNonlinear, same_screen YES,
focus YES, state 0

KeyPress event, serial 47, synthetic NO, window 0x2200001,
root 0x67b, subw 0x0, time 33955495, (165,-8), root:(1212,14),
state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False

FocusOut event, serial 47, synthetic NO, window 0x2200001,
mode NotifyGrab, detail NotifyAncestor

ClientMessage event, serial 47, synthetic YES, window 0x2200001,
message_type 0x167 (WM_PROTOCOLS), format 32, message 0x16a (WM_DELETE_WINDOW)
0 new messages