вторник, ноября 19, 2024

FreeBSD14 and ThinkPad X1 Carbon Gen9. Brightness with a keyboard

 acpi_ibm(4) provides support for multiple hotkeys on ThinkPad X1 Carbon Gen9, so:

# echo acpi_ibm_load=\"YES\" >> /boot/loader.conf

or it's possible to load that kernel driver on a running system:

# kldload acpi_ibm

Now try to run the following command to see ACPI events:

# cat /var/run/devd.pipe

press brightness up/down keys (those are combined with the F6/F5 keys correspondingly), and see events:

!system=ACPI subsystem=IBM type=\_SB_.PC00.LPCB.EC__.HKEY notify=0x10
!system=ACPI subsystem=IBM type=\_SB_.PC00.LPCB.EC__.HKEY notify=0x11

Moving ahead and creating a configuration file for the devd(8) in /usr/local/etc/devd directory,
let's name it x1cg9.conf:

notify 0 {
        match "system"          "ACPI";
        match "subsystem"       "IBM";
        match "notify"          "0x10";
        action                  "backlight +";
};

notify 0 {
        match "system"          "ACPI";
        match "subsystem"       "IBM";
        match "notify"          "0x11";
        action                  "backlight -";
};

вторник, октября 15, 2024

ThinkPad X1 Carbon Gen9. Important useful sound settings

I've found the following important useful settings for the /boot/device.hints on the FreeBSD forum:

hint.hdaa.0.nid19.config="as=1 seq=0"

hint.hdaa.0.nid20.config="as=1 seq=2"

hint.hdaa.0.nid23.config="as=1 seq=1"

hint.hdaa.0.nid24.config="as=1 seq=2"

hint.hdaa.0.nid26.config="as=1 seq=1"

hint.hdaa.0.nid27.config="as=1 seq=2"

hint.hdaa.0.nid30.config="as=1 seq=1"

hint.hdaa.0.nid33.config="as=1 seq=15 device=Headphones"


i3 and sound control from keyboard on FreeBSD

bindsym XF86AudioRaiseVolume exec --no-startup-id mixer vol=+10% && $refresh_i3status

bindsym XF86AudioLowerVolume exec --no-startup-id mixer vol=-10% && $refresh_i3status

bindsym XF86AudioMute exec --no-startup-id "mixer vol.mute | grep on; [ $? -eq 0 ] && mixer vol.mute=off || mixer vol.mute=on && $refresh_i3status"

bindsym XF86AudioMicMute exec --no-startup-id "mixer mic.mute | grep on; [ $? -eq 0 ] && mixer mic.mute=off || mixer mic.mute=on && $refresh_i3status"



суббота, сентября 21, 2024

OpenBSD ports maintainer cheat sheet

Here's the list of most important commands for an OpenBSD ports maintainer:

  • cd /usr/ports && cvs -z3 up -dP -A
  • doas pkg_add -Dsnap -uU
  • doas sysupgrade -s

and last but not least:

  •  doas vi /etc/myname