Omarchy Hardware Detection Commands (hw-*): Complete Reference
Omarchy ships lightweight Bash utilities prefixed with omarchy-hw- that probe hardware via cached sysfs data, exiting with status 0 when hardware is present and 1 otherwise.
The omacom/omarchy repository maintains a comprehensive suite of hardware detection scripts in the bin/ directory. These Omarchy hardware detection commands identify specific hardware capabilities—from NVIDIA GPUs to laptop lid states—enabling dynamic system configuration without invoking expensive tools like lspci.
Complete List of Omarchy Hardware Detection Commands
All detection scripts follow the naming convention omarchy-hw-* and reside in the bin/ directory of the quattro branch. Each script includes an omarchy:summary header describing its specific detection target.
Laptop and Vendor Detection
omarchy-hw-asus-rog– Detects Asus ROG laptops including ROG Strix G14omarchy-hw-asus-zenbook-ux5406aa– Detects Asus ZenBook UX5406AAomarchy-hw-asus-expertbook-b9406– Detects Asus ExpertBook B9406omarchy-hw-dell-xps13-sidecar-amps– Detects Dell XPS 13 Sidecar AMPs configurationomarchy-hw-dell-xps-oled– Detects Dell XPS OLED panelomarchy-hw-dell-xps-haptic-touchpad– Detects Dell XPS haptic touchpadomarchy-hw-framework16– Detects Framework Laptop 16 for special RGB key handlingomarchy-hw-surface– Detects Microsoft Surface devicesomarchy-hw-laptop– Detects any portable laptop deviceomarchy-hw-laptop-closed– Detects when the laptop lid is currently closedomarchy-hw-clamshell– Detects clamshell mode operation (lid closed)
GPU and Display Detection
omarchy-hw-nvidia– Detects NVIDIA GPU presenceomarchy-hw-nvidia-gsp– Detects NVIDIA GPUs with GSP firmware (Turing or newer)omarchy-hw-nvidia-without-gsp– Detects NVIDIA GPUs without GSP firmware (pre-Turing)omarchy-hw-hybrid-gpu– Detects laptops with both integrated and discrete GPUsomarchy-hw-intel– Detects Intel CPUs for generic Intel-specific tweaksomarchy-hw-intel-ptl– Detects Intel P-state TL performance-tuning logicomarchy-hw-vulkan– Detects Vulkan support availability (GPU driver and loader)omarchy-hw-display– Identifies the primary display device used by the UIomarchy-hw-external-monitors– Detects external monitors connected via HDMI or DisplayPort
Input Devices and Peripherals
omarchy-hw-touchscreen– Detects touch-capable screensomarchy-hw-touchpad– Prints the Hyprland touchpad device name when availableomarchy-hw-fingerprint– Detects fingerprint sensors on modern laptopsomarchy-hw-webcam– Checks webcam availability viaomarchy-capture-webcam-listomarchy-hw-elgato-camlink-4k– Detects Elgato Cam Link 4K capture devices
Audio and System State
omarchy-hw-intel-sof– Detects Intel Sound Open Firmware (SOF) audio devicesomarchy-hw-recover-internal-monitor– Detects whether the internal monitor needs recovery after suspendomarchy-hw-match– Generic helper script used by other hardware detection routines
How Omarchy Hardware Detection Works
The detection scripts are designed for minimal overhead. Rather than invoking expensive enumeration tools like lspci, they read cached sysfs information whenever possible. This approach ensures rapid execution during system initialization or hotplug events.
Each command follows a consistent exit code contract:
- Exit
0– Hardware is present or condition is true (some scripts print values to stdout) - Exit
1– Hardware is absent or condition is false
For example, omarchy-hw-touchpad returns the Hyprland device name on stdout when a touchpad is detected, while omarchy-hw-laptop-closed simply returns a boolean state via exit code.
Practical Usage Examples
Use these detection utilities in shell scripts to conditionally apply hardware-specific configurations.
Conditional GPU Configuration
if omarchy-hw-nvidia; then
echo "NVIDIA GPU detected – applying driver optimisations"
# Insert NVIDIA-specific configuration here
fi
Enable Touchscreen Mode
if omarchy-hw-touchscreen; then
omarchy-toggle-touchscreen enable
fi
Capture Touchpad Device Name
touchpad=$(omarchy-hw-touchpad)
[[ -n $touchpad ]] && echo "Touchpad device: $touchpad"
Hybrid GPU Laptop Detection
if omarchy-hw-laptop && omarchy-hw-hybrid-gpu; then
omarchy-toggle-hybrid-gpu switch
fi
Webcam-Dependent Operations
if omarchy-hw-webcam; then
omarchy-capture-webcam-snapshot /tmp/webcam.png
fi
Implementation and Testing
The hardware detection suite is implemented as individual Bash scripts located at bin/omarchy-hw-*. According to the repository structure documented in docs/file-layout.md, these scripts are grouped under the bin/ directory alongside other Omarchy utilities.
Automated test coverage ensures reliability across different hardware configurations. Test suites reside in test/shell.d/hw-*.sh and verify that each command returns the correct exit status under various mock environments. The docs/testing.md file describes the shell-testing framework used to validate these scripts.
For developers working with the Omarchy codebase, AGENTS.md documents the agent-based development workflow that governs how these hw-* scripts are maintained and extended.
Summary
- Omarchy hardware detection commands use the
omarchy-hw-*naming prefix and live in thebin/directory - Commands probe sysfs directly rather than using expensive tools like
lspci, ensuring fast execution - Exit code
0indicates hardware presence or true condition; exit code1indicates absence - The suite covers laptops, GPUs (NVIDIA/Intel), displays, input devices, and system states like clamshell mode
- Automated tests in
test/shell.d/hw-*.shvalidate detection logic across mock environments
Frequently Asked Questions
What exit codes do Omarchy hardware detection commands return?
The commands return standard Unix exit codes: 0 when the target hardware is detected or the condition is true, and 1 when absent or false. Some commands like omarchy-hw-touchpad additionally print the device name to stdout on success.
Where are the hardware detection scripts located in the Omarchy repository?
All detection scripts are located in the bin/ directory of the quattro branch, following the naming pattern bin/omarchy-hw-*. Documentation regarding the repository layout is available in docs/file-layout.md.
Can I use these commands in my own shell scripts?
Yes, the commands are designed for composability. You can use them directly in if statements or command substitution, as shown in the examples above. They require no arguments and depend only on standard sysfs entries available in the Linux kernel.
Do these detection scripts require root privileges?
Most scripts read from sysfs and typically do not require root privileges when accessed by a user with standard hardware enumeration permissions. However, specific hardware or security policies may restrict access to certain sysfs nodes.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →