Skip to content

OmenLinux/omen-rgb-keyboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HP OMEN RGB Keyboard Driver

Linux kernel driver for HP OMEN laptop RGB keyboard lighting. Controls 4-zone RGB lighting with brightness control.

Inspired by the original hp-omen-linux-module by James Churchill (@pelrun).

Features

  • 4-Zone RGB Control - Individual control over each keyboard zone
  • All-Zone Control - Set all zones to the same color at once
  • Brightness Control - Adjust brightness from 0-100%
  • 10 Animation Modes - Complete animation system with CPU-efficient timer-based updates
  • Real-time Updates - Changes apply immediately
  • Hex Color Format - Use standard RGB hex values

Supported Hardware

  • HP OMEN laptops with 4-zone RGB keyboard lighting
  • Tested on Omen 16 u0000sl

Installation

Prerequisites

# Install kernel headers and build tools
sudo pacman -S linux-headers base-devel  # Arch Linux
# or
sudo apt install linux-headers-$(uname -r) build-essential  # Ubuntu/Debian

Build and Install

# Clone the repository
git clone https://github.com/alessandromrc/omen-rgb-keyboard.git
cd omen-rgb-keyboard

# Build and install
sudo make install

The module will be built and installed using DKMS, which will automatically rebuild it on kernel updates.

Automatic Loading on Boot

The driver is configured to load automatically on boot. If you need to set this up manually:

# Create modprobe configuration (for module options)
sudo cp hp-wmi.conf /etc/modprobe.d/

# Create systemd module loading configuration
echo "hp-wmi" | sudo tee /etc/modules-load.d/hp-wmi.conf

# Create state directory
sudo mkdir -p /var/lib/omen-rgb-keyboard

Alternatively, use the provided installation script:

sudo ./install.sh

Usage

Loading the Module

# Load the module
sudo modprobe hp_wmi

# Check if it loaded successfully
lsmod | grep hp_wmi

Controlling RGB Lighting

The driver creates sysfs attributes in /sys/devices/platform/omen-rgb-keyboard/rgb_zones/:

Individual Zone Control

# Set zone 0 to red
echo "FF0000" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/zone00

# Set zone 1 to green  
echo "00FF00" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/zone01

# Set zone 2 to blue
echo "0000FF" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/zone02

# Set zone 3 to purple
echo "FF00FF" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/zone03

All-Zone Control

# Set all zones to the same color
echo "FFFFFF" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/all

Brightness Control

# Set brightness to 50%
echo "50" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/brightness

# Set brightness to 100% (maximum)
echo "100" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/brightness

# Turn off lighting (0% brightness)
echo "0" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/brightness

Reading Current Values

# Check current brightness
cat /sys/devices/platform/omen-rgb-keyboard/rgb_zones/brightness

# Check current animation mode
cat /sys/devices/platform/omen-rgb-keyboard/rgb_zones/animation_mode

# Check current animation speed
cat /sys/devices/platform/omen-rgb-keyboard/rgb_zones/animation_speed

# Check current zone colors
cat /sys/devices/platform/omen-rgb-keyboard/rgb_zones/zone00
cat /sys/devices/platform/omen-rgb-keyboard/rgb_zones/zone01
# etc...

Color Format

Colors are specified in RGB hex format:

  • FF0000 = Red
  • 00FF00 = Green
  • 0000FF = Blue
  • FFFFFF = White
  • 000000 = Black (off)

Brightness Range

Brightness is specified as a percentage (0-100):

  • 0 = Completely off
  • 50 = 50% brightness
  • 100 = Maximum brightness

Animation Modes

The driver supports 10 different animation modes:

Basic Modes:

  • static - No animation, static colors (default)
  • breathing - Smooth breathing effect that fades in and out
  • rainbow - Rainbow wave that cycles through all colors
  • wave - Wave effect that moves across the zones
  • pulse - Pulsing effect with varying intensity

Advanced Modes:

  • chase - Lights follow each other in sequence across zones
  • sparkle - Random sparkle effect with bright white flashes
  • candle - Warm flickering candle effect with orange/red colors
  • aurora - Aurora borealis effect with flowing green/blue waves
  • disco - Disco strobe effect with bright multi-colored flashes

Animation Speed

Animation speed is controlled by a value from 1-10:

  • 1 = Slowest animation
  • 5 = Default speed
  • 10 = Fastest animation

Examples

Gaming Setup

# Red gaming theme
echo "FF0000" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/all
echo "75" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/brightness

Rainbow Effect

echo "FF0000" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/zone00  # Red
echo "FF8000" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/zone01  # Orange
echo "FFFF00" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/zone02  # Yellow
echo "00FF00" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/zone03  # Green

Subtle White Lighting

echo "FFFFFF" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/all
echo "25" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/brightness

Animation Examples

# Breathing red effect
echo "FF0000" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/all
echo "breathing" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/animation_mode
echo "3" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/animation_speed

# Rainbow wave
echo "rainbow" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/animation_mode
echo "5" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/animation_speed

# Chase effect
echo "00FF00" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/all
echo "chase" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/animation_mode
echo "4" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/animation_speed

# Sparkle effect
echo "FFFFFF" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/all
echo "sparkle" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/animation_mode
echo "2" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/animation_speed

# Aurora effect (uses its own colors)
echo "aurora" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/animation_mode
echo "3" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/animation_speed

# Disco strobe effect
echo "disco" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/animation_mode
echo "6" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/animation_speed

# Candle effect (uses its own warm colors)
echo "candle" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/animation_mode
echo "4" | sudo tee /sys/devices/platform/omen-rgb-keyboard/rgb_zones/animation_speed

Troubleshooting

Module Not Loading

# Check if WMI is supported
sudo dmesg | grep -i wmi

# Check for errors
sudo dmesg | grep -i hp_wmi

No RGB Zones Found

# Verify the module loaded
lsmod | grep hp_wmi

# Check sysfs path
ls -la /sys/devices/platform/omen-rgb-keyboard/rgb_zones/

Colors Not Changing

  • Ensure you're using the correct hex format (6 characters, uppercase)
  • Check that brightness is not set to 0
  • Verify the module loaded without errors

Technical Details

  • Driver Name: omen-rgb-keyboard
  • WMI Interface: Uses HP's native WMI commands for maximum compatibility
  • Buffer Layout: Matches HP's Windows implementation exactly
  • Animation System: CPU-efficient timer-based updates with 20 FPS
  • State Persistence: Saves settings to /var/lib/omen-rgb-keyboard/state
  • Kernel Compatibility: Linux 5.0+

License

GPL-3.0

Contributing

Feel free to submit issues and pull requests.

Disclaimer

This driver is provided as-is, use at your own risk. The author is not responsible for any damage to your hardware.

About

Linux kernel driver for HP OMEN laptop RGB keyboard lighting.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published