Code Monkey home page Code Monkey logo

hp-omen-linux-module's Introduction

HP Omen special feature control for Linux

This is a version of the hp-wmi kernel module that implements some of the features of HP Omen Command Centre.

It's totally experimental right now, and could easily crash your machine.

USE AT YOUR OWN RISK

Currently working:

  • FourZone keyboard colour control (/sys/devices/platforms/hp-wmi/rgb-zones/zone0[0-3])
  • Omen hotkeys

Installation

  1. Install dkms and kernel headers if needed (already present on Ubuntu)

  2. Run sudo make install

Module will be built and installed, and DKMS will manage rebuilding it on kernel updates.

Usage

The module creates four files in /sys/devices/platform/hp-wmi/rgb_zones/ named zone00 - zone03.

To change zone highlight color, just print hex colour value in RGB format to the respective file. e.g:

sudo bash -c 'echo 00FFFF > /sys/devices/platform/hp-wmi/rgb_zones/zone00' to get sky-blue zone 0.

Omen and other hotkeys are bound to regular X11 keysyms, use your chosen desktop's hotkey manager to assign them to functions like any other key.

To do:

  • FourZone brightness control
  • Fan control

hp-omen-linux-module's People

Contributors

pelrun avatar wl2776 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hp-omen-linux-module's Issues

License

Could you add a license to the project? I'm not partial on which one: GPLv3, Apache, MIT, etc. more so just good to have instead of nothing. If anyone has a preference on which one, please chime in.

Any progress on the fans?

Module mostly works on OMEN by HP Laptop 17-ck0xxx:

  • Very happy to set the colors to something less garish.
  • The Omen key is available to xkb

What doesn't work:

  • The P1 to P6 keys are not available to xkb.

Any progress on the fan control? That would be my major request: my laptop keeps its fan on all the time at a low speed and I'd much prefer silence...

Thanks!

Improve hotkey support

Thanks to @wl2776 I've now got ACPI dumps from two different machines and I think I can properly implement Omen key detection that will work across the board.

Depending on the key and the model, a hotkey press will generate either an 0x04 (HPWMI_BEZEL_BUTTON) or 0x1D (Omen hotkey) WMI event, or (in my case) just raise a notification with no event data at all. In all cases, HPWMI_HOTKEY_QUERY needs to be called (as is already done for HPWMI_BEZEL_BUTTON) to get the ID of the key pressed.

The Omen key is 0x21A5, although wl2776's machine also appears to generate a 0x21A7 for some other key.

I'm not seeing the expected 'rgb_zones' under hp-wmi.

OMEN:~/Downloads/hp-omen-linux-module-master$ sudo make install
dkms install .

Creating symlink /var/lib/dkms/hp-omen-wmi/0.9/source ->
                 /usr/src/hp-omen-wmi-0.9

DKMS: add completed.

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make -j12 KERNELRELEASE=5.8.0-55-generic -C src/ KERNELDIR=/lib/modules/5.8.0-55-generic/build...
Signing module:
Generating a new Secure Boot signing key:
Can't load /var/lib/shim-signed/mok/.rnd into RNG
139764788532544:error:2406F079:random number generator:RAND_load_file:Cannot open file:../crypto/rand/randfile.c:98:Filename=/var/lib/shim-signed/mok/.rnd
Generating a RSA private key
.................................+++++
...................................................................................................................................................+++++
writing new private key to '/var/lib/shim-signed/mok/MOK.priv'
-----
 - /var/lib/dkms/hp-omen-wmi/0.9/5.8.0-55-generic/x86_64/module/hp-wmi.ko
Secure Boot not enabled on this system.
cleaning build area...

DKMS: build completed.

hp-wmi.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.8.0-55-generic/updates/dkms/

depmod...

DKMS: install completed.

Looks like everything installed fine? Any ideas? HP OMEN Model: 17-cb1055cl

Thanks for your work on this!

Different color codes for HP OMEN 870-155ng ?

I have got an HP tower "HP OMEN 870-155ng".
I've installed the module as follows:

(tested with Ubuntu Mate 20.04)

git clone https://github.com/pelrun/hp-omen-linux-module.git
cd hp-omen-linux-module
configure
make
sudo cp /usr/lib/modules/`uname -r`/kernel/drivers/platform/x86/hp-wmi.ko \
        /usr/lib/modules/`uname -r`/kernel/drivers/platform/x86/hp-wmi.ko.original
sudo cp hp-wmi.ko /usr/lib/modules/`uname -r`/kernel/drivers/platform/x86/hp-wmi.ko
sudo reboot

Now I can see the devices:

$ ls /sys/devices/platform/hp-wmi/rgb_zones/
zone00  zone01  zone02  zone03

$ cat /sys/devices/platform/hp-wmi/rgb_zones/*
red: 0, green: 0, blue: 0
red: 0, green: 0, blue: 0
red: 0, green: 0, blue: 0
red: 0, green: 0, blue: 0

While by default the front panel light rotates colors changing it every couple of seconds,
writing to the zone device definitely changes the behavior.
So the new module somehow works!

echo '00FF00' > /sys/devices/platform/hp-wmi/rgb_zones/zone00
echo '00FF00' > /sys/devices/platform/hp-wmi/rgb_zones/zone01
echo '00FF00' > /sys/devices/platform/hp-wmi/rgb_zones/zone02
echo '00FF00' > /sys/devices/platform/hp-wmi/rgb_zones/zone03

# cat /sys/devices/platform/hp-wmi/rgb_zones/*
red: 0, green: 255, blue: 0
red: 0, green: 255, blue: 0
red: 0, green: 255, blue: 0
red: 0, green: 255, blue: 0

Now the color rotation has stopped and the light has turned to pure red.
But I would like to have it green!
Looks like color encoding somehow differs for my model?
Do you have any ideas how to reverse engineer the values for my device or what to try out?

Brightness Control

Firstly thank you for your work.
I have an Omen 16 and this module lets me control the zones and colors.
What I would like to do is adjust the led brightness and turn the leds on and off from a script.

I was hoping that using evtest I could replicate the FN F4 command that turns the leds on and off, but the FN button does not register.

If you do have any ideas how to turn off the keyboard leds when the screen turns off and how to control the brightness please let me know.

Mouse Control

Thanks for this, works flawlessly with the Omen 15 on Pop Os after Rebooting, any chance of getting this to work with the Omen Wireless Mouse(Vector)?

Problems with other HP Omen models

In another issue I read that the app interface is different for different models. Could you implement it for my model?

OMEN Laptop 15-en0xxx(15-en0043ur)

mail: [email protected]
I'll send you a dump and a copy of this message from this post.

Bug in rgb zones 00 and 01

I think I've found a bug where if you try to change both zones 00 and 01 at the same time (for example with a single line in the terminal, with two commands separated by | or in a script that changes all zones to different colours at the same time), zone00 will take both the values for 00 and 01 (if you try to set 00 to 00FF00 and 01 to 0000FF, 01 will be changed to 0000FF and 00 will be changed to 00FFFF).

When I tried it in terminal sometimes 00 would take the appropriate value and sometimes the mixed value but completely at random.

When I tried to run a script that updates every zone with values from an array with three values using a loop, it'll at first take the correct value, then a mix from the one it should and the one 01 takes, and finally it'll take "000000"
like this:
array[]={1,2,3}

first iteration:
00->1
01->2
02->3

second iteration:
00->3+1
01->1
02->2

third iteration:
00->" "
01->3
02->1

Omen 15 2020 support

What's the status on the new Omen models? Some codes for them are the 15-en0029nr and the 15-en0036nr.

Enabling of macro keys P1-P6

I have a notebook HP Omen 17-cb1055cl. It has 6 macro keys P1-P6.
Is there exists any possibility to enable these keys in linux?

Improve README for collaboration

Hello @pelrun, I would be interested in contributing but the README don't say much.. Information about how to install and test would be helpful. On top of this I could develop an interface like HP COMMAND CENTER with GTK/TK libraries.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.