Ultra-lightweight biometric facial authentication for resource-constrained Linux systems.
I am poor. That is the simple, unvarnished, mathematical truth.
I cannot afford a brand new two-thousand-dollar laptop equipped with vertical-cavity surface-emitting lasers, structured infrared dot projectors, or dedicated neural silicon. I am typing this on a battle-scarred potato laptop. Its battery health is held together by pure spite, its thermal paste turned into dry chalk years ago, and its dual-core CPU begins to thermal throttle if someone looks at it with intense emotional energy. It has 8GB of RAM, an integrated visible-light webcam that looks like it was salvaged from a 2008 flip phone, and it runs Arch Linux with Hyprland on Omarchy.
Yet, despite being broke, I demanded an Apple-tier biometric unlock experience. I wanted to sit in front of my machine, run a privileged command, have a sleek little pill slide out below the clock, verify my face in milliseconds, and let me get straight back to work without typing my password fifty times an hour.
The modern software industry has lost its collective mind. If you ask a modern software architect how to achieve facial authentication in 2026, they will unironically instruct you to:
- Spin up a four-gigabyte Docker container running Python 3.12 and PyTorch.
- Download an 800MB pre-trained transformer model trained on half the internet.
- Allocate three gigabytes of VRAM to calculate embeddings across seventy-two hidden attention layers.
- Cook your CPU to 99 degrees Celsius while your cooling fans scream like a Boeing 747 preparing for emergency takeoff.
- Wait three and a half seconds for an inference pass just to tell sudo that yes, you are indeed the person sitting in this chair.
No. Absolutely not. That is architectural blasphemy.
PotatoFace was built out of righteous frustration and extreme hardware poverty. It abandons modern bloated neural garbage in favor of classic, ruthless, mathematically elegant computer vision: Haar Cascades for multi-scale face detection and Local Binary Pattern Histograms (LBPH) for facial texture classification. It captures 320x240 grayscale video, executes in milliseconds using pure integer arithmetic, takes fourteen megabytes of RAM, and hooks straight into the jugular of Linux PAM via pam_exec.so.
| Metric | Modern "AI" Biometric Solutions | PotatoFace Engine |
|---|---|---|
| Memory Footprint | 2.5 GB to 4.5 GB (PyTorch/TensorFlow) | ~14 MB resident memory |
| Startup Overhead | 2.0s to 5.0s (CUDA/Runtime load) | 12 milliseconds |
| Inference Time | 400ms to 1200ms per frame | 8ms per frame (CPU integer math) |
| Thermal Penalty | Instant thermal throttling | 0.0 degrees Celsius temperature change |
| Camera Hardware | Structured IR laser grid required | Five-dollar visible-light potato webcam |
| Window System | Tiled window conflicts or no UI | Native Wayland layer-shell dynamic pill |
This project stands upon the shoulders of giants who understood engineering discipline:
- Omarchy and Arch Linux: For providing an operating system that respects human intellect. No telemetry, no background advertisements, no forced cloud telemetry. Just pure POSIX sovereignty.
- Hyprland (Vaxry and contributors): For building a Wayland compositor so mathematically sublime and disgustingly fluid that it makes commercial proprietary operating systems look like a PowerPoint presentation running on Windows Vista.
- Quickshell: For proving that modern, reactive desktop shells and status bars can exist without stuffing an entire Chromium browser instance into memory.
- OpenCV Pioneers: Viola, Jones, Ahonen, Hadid, and Pietikainen. You proved decades ago that simple 3x3 pixel neighborhood math and integral images can run rings around massive multi-gigabyte neural networks on budget hardware.
- Linux PAM Architects: The silent guardians of UNIX security who gave us
pam_exec.soand the sacred ability to authenticate anything with an exit code of zero.
- 320x240 Low-Resolution Capture: Captures at QVGA to reduce per-frame pixel processing by 75 percent compared to 480p, saving memory bandwidth and battery power.
- Zero Kernel Buffering: Enforces
CAP_PROP_BUFFERSIZE = 1to bypass V4L2 queue latency. Stale frames are dumped instantly. - Lighting Normalization: Applies Contrast Limited Adaptive Histogram Equalization (CLAHE) to maintain recognition precision across dramatic lighting changes without heavy filters.
- Microsecond Recognition: Uses LBPH (
radius=1, neighbors=8). Feature prediction takes under 10 milliseconds on legacy dual-core silicon. - On-Demand Camera Activation: The webcam turns on strictly during authentication (sudo, lockscreen, login) and terminates immediately upon verification. The hardware LED never lingers.
- 3.5-Second Hard Cutoff: If no face is recognized within 3.5 seconds, the camera releases hardware locks and seamlessly drops back to your password prompt.
- Top-Center Floating Hello Toast: Floats a sleek, minimal biometric toast pill directly in the top center of your display right beneath your webcam and clock via Wayland layer-shell protocol (
zwlr_layer_shell_v1). Never tiles, never steals focus, and never disrupts your terminal. - SDDM Login Screen Face ID Trigger: Seamlessly integrates a dedicated "Face Unlock" button into your SDDM greeter (Omarchy theme). Automatically scans on startup, and if you step away and hit the timeout, re-trigger Face ID instantly with one click or by hitting
Enteron an empty password input. - Dynamic User Identity: Automatically extracts your system username and friendly display name from the system user database without any hardcoded configurations.
- Audio Feedback: Optional subtle auditory feedback on authentication success and failure using the desktop sound theme.
Install the required packages using pacman:
sudo pacman -S --needed python-opencv python-numpy v4l-utils gtk4-layer-shell python-gobject pipewire sound-theme-freedesktopClone the repository and run the installer as root:
git clone https://github.com/kisalnelaka/potatoFace.git
cd potatoFace
sudo ./install.shThe installer locks down the biometric model directory at /etc/security/potato_face with root ownership, installs binaries to /usr/local/bin, and registers autostart hooks.
Launch the Control Center:
potato-faceClick Scan Face to record your face profile. The engine captures 40 normalized frames, trains the histogram model, and locks it into your secure local configuration and system vault.
We love speed, but let us be painfully, brutally honest about what this is and what it is not.
Commercial Face ID hardware projects 30,000 structured infrared laser dots onto your skull, measures sub-millimeter topological contours, and processes three-dimensional depth maps inside dedicated secure enclaves.
PotatoFace uses a cheap visible-light webcam shooting 320x240 grayscale pixels into a histogram matrix from the late 1990s running on a potato laptop.
- The High-Resolution Photo Attack: There is no 3D depth sensor and no infrared liveness detection. If someone holds up a crisp, high-resolution photo or an iPad displaying your face under matching lighting conditions, there is a non-zero probability it will unlock your machine.
- The Evil Twin Attack: If you have an identical twin, congratulations: they are now a co-administrator of your computer.
- Pitch Darkness (Vampire Mode): In pitch darkness, standard visible-light webcams capture pure static noise. LBPH cannot extract gradients from black pixels. The 3.5-second timeout will fire and drop you back to password authentication.
This tool was engineered strictly for convenience. It stops coffee shop snoopers, shoulder surfers, and curious coworkers from watching your fingers type your master sudo password. It is not designed to protect state secrets, bank vaults, or nuclear launch facilities from determined physical adversaries.
This software was engineered specifically by and for Kisal Nelaka's personal machine. If you choose to install or execute this software on your system, you assume 100 percent of all risk, consequence, and liability.
- AS-IS Software: THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT.
- Zero Liability: UNDER NO CIRCUMSTANCES SHALL THE AUTHOR BE HELD LIABLE FOR ANY CLAIM, DAMAGES, DATA LOSS, SYSTEM BRICKING, UNINTENDED SUDO ELEVATIONS, COMPROMISED PASSWORDS, ACCIDENTAL ROOT PURGES, LOSS OF EMPLOYMENT, THERMONUCLEAR WAR, CORRUPTED PARTITIONS, OR LOSS OF ROOT PRIVILEGES.
- Do Not Cry If You Break PAM: If you bypass safety instructions, edit PAM files blindly, lock yourself out of your system, and have to chroot from an archiso USB drive at 3:00 AM while crying into your keyboard, I will not help you and I assume zero responsibility.
- Fallback Design: All hooks are registered with
sufficientso standard password prompts remain active if the camera fails. If you changesufficienttorequiredand lock yourself out, that is natural selection at work.
MIT License. Copyright (c) 2026 Kisal Nelaka. See LICENSE for details.