This is surprisingly easy...basically following Arch Wiki:
https://wiki.archlinux.org/index.php/Howdy
After some investigation, here is step by step and preferences
https://github.com/boltgolt/howdy
https://aur.archlinux.org/packages/howdy/
yay -S --editmenu howdyyay is an AUR helper
on 2019/10/30, I need to edit PKGBUILD, removing --yes USE_AVX_INSTRUCTIONS to get it compiled
mpv /dev/video2
# see if this device is IR camera
# it might be /dev/video0, /dev/video1, /dev/video{N}...mpv is a video playback application
sudo vim /lib/security/howdy/config.ini[core]
# Print that face detection is being attempted
detection_notice = true
# ...
[video]
# The certainty of the detected face belonging to the user of the account
# On a scale from 1 to 10, values above 5 are not recommended
certainty = 4.5
# ...
# The path of the device to capture frames from
# Should be set automatically by an installer if your distro has one
device_path = /dev/video2
# ...
# Because of flashing IR emitters, some frames can be completely unlit
# Skip the frame if the lowest 1/8 of the histogram is above this percentage
# of the total
# The lower this setting is, the more dark frames are ignored
dark_threshold = 100where device_path = /dev/video{N} is the IR camera device we found using mpv above
sudo howdy add # follow its instructionsexplore by
sudo howdy --help, you will learn to list, remove faces
sudo vim /etc/pam.d/kde # for KDE lock screen
sudo vim /etc/pam.d/sudo # for sudo, obviouslyadd this line to kde and sudo files before system-auth line:
auth sufficient pam_python.so /lib/security/howdy/pam.py
# original system-auth setting
auth include system-auth
detection_notice = trueabove will make lock screen showingAttempting face detectiondismiss_lockscreen =above will prevent IR camera from keeping scanning after unlock (kind of loop?)
And run this to allow using howdy:
sudo chmod -R 755 /lib/security/howdyReboot to ensure PAM setting is taking place
https://wiki.archlinux.org/index.php/Howdy#GStreamer_warnings_in_shell
vim ~/.xprofileadd this line:
export OPENCV_LOG_LEVEL=ERRORThen reboot or re-login
Just sudo ..., howdy will start
Leave password empty and press enter, howdy should start
SDDM is display manager that authenticates only when laptop just boots up and login, while lock screen asks for authentication much more often
add auth sufficient pam_python.so /lib/security/howdy/pam.py to /etc/pam.d/sddm will make it to authenticate using howdy, leave password empty and press enter
But this will result some drawbacks:
- when failed, SDDM's password input box seems to be freezed..
- will be unable to unlock KDE Wallet automatically on login and ask password to unlock KDE Wallet for Wifi credentials...Arch Wiki Link