Linux tool to allow using the numpad that is overlayed on various Asus Laptop touchpads.
This builds upon the work done in asus-touchpad-numpad-driver, and adds more goodies that bring it closer to parity with the official Windows driver-
- Hold to toggle numlock/cycle brightness
- Drag to trigger calculator (on supported models)
- Allows using the touchpad when numlock is active
- Ignores touches in margins (outside the numpad)
- Integration with system's NumLock state - toggle with external keyboards
- Install
libevdev
- Debian / Ubuntu / Linux Mint / Pop!_OS / Zorin OS:
sudo apt install libevdev2
- Arch Linux / Manjaro:
sudo pacman -S libevdev
- Fedora:
sudo dnf install libevdev
- Debian / Ubuntu / Linux Mint / Pop!_OS / Zorin OS:
- Download from
Releases
page - Copy to some directory in PATH. (Further instructions assume it is in
/usr/bin/
)
OR
- Install the Rust 2021 toolchain using
Rustup
sudo -E cargo install --root /usr --git="https://github.com/iamkroot/asus-numpad"
-
sudo modprobe i2c-dev
andsudo modprobe uinput
- You can have them be loaded automatically at boot. Consult ArchWiki for details
-
Create the config file at
/etc/xdg/asus_numpad.toml
and addlayout = "LAYOUT"
, whereLAYOUT
is one ofUX433FA
,M433IA
,UX581
,GX701
,GX531
orG533
. See Configuration for more options. -
sudo asus-numpad
It is best to run this program through a separate Unix user that is allowed to access input devices.
# create a group `uinput` and add a `udev` rule for it
# needed to be able to create a dummy virtual keyboard
sudo groupadd uinput
echo 'KERNEL=="uinput", GROUP="uinput", MODE:="0660"' | sudo tee /etc/udev/rules.d/99-input.rules
# create a system user called "asus_numpad" which is a part of the required groups,
# so that the program can access the touchpad events and control its brightness
sudo useradd -Gi2c,input,uinput --no-create-home --system asus_numpad
After a reboot, check that the permissions are correct:
ls -l /dev/uinput
should showcrw-rw---- 1 root uinput ... /dev/uinput
(Theuinput
afterroot
is important)- Similarly,
ls -l /dev/i2c-*
should be owned byi2c
group - Finally,
groups asus_numpad
should includeinput
,i2c
anduinput
.
To enable autoloading at boot, a systemd service has been provided.
- If you have added the new user from previous section, add
User=asus_numpad
the end of[Service]
section intools/asus-numpad.service
. - Run the following
# copy the systemd service to a known location sudo cp tools/asus-numpad.service /etc/systemd/system/ # enable and start the service sudo systemctl enable --now asus-numpad.service
The config file is stored in TOML format at /etc/xdg/asus_numpad.toml
. It supports the following params:
name | type | default | desc |
---|---|---|---|
layout |
string |
Required | One of UX433FA , M433IA , UX581 , GX701 , GX531 or G533 . |
calc_start_command |
|
["KEY_CALC"] |
Defines what is to be done when calc key is dragged. If variant a is used, the specified keys will be pressed. Variant b allows running an arbitrary command. |
calc_stop_command |
Same as calc_start_command |
Not specified | Defines what is to be done when calc key is dragged the second time. Useful for closing/killing a launched process. If not specified, the calc_start_command will be triggered. |
disable_numlock_on_start |
bool |
true |
Specifies whether we should deactivate the numlock when starting up. |
If you are running the daemon under a different user as discussed in Running without sudo
, and you have specified custom commands in the configuration, then you'll find that the commands are actually running under the asus_numpad
user. This may or may not be irksome based on what the command does (it won't have access to your user's files).
You can use sudo
for in order to run the commands as your main user account:
sudo visudo
to edit thesudoers
file- At the very end, add
asus_numpad ALL=(__YOUR_USERNAME__) NOPASSWD: ALL
(replace__YOUR_USERNAME__
with your actual username!) - In
asus_numpad.toml
, specify the commands as{cmd = "sudo", args = ["-u", "__YOUR_USERNAME__", "some_binary", "arg1", "arg2"]
The following features are planned and implemented for the app:
- Support UX433FA and M433IA
- Hold the numpad button to toggle it
- Use i2cdev crate for setting brightness
- Handle Calc Key
- Cycle through multiple brightness options
- Ignore touches in margins
- Support more numpad layouts (UX581 and GX701)
- Logging for debugging purposes
- Set model via program argument
- Systemd service to enable autostart
- Run without
sudo
- Start Calc only on drag instead of tap
- Don't panic on errors - exit gracefully
- Integration with system's NumLock state (toggle with external keyboards)
-
strip
release binaries - Re-triggering Calc Key should close the previously opened calc
- Run custom command on triggering Calc Key
- Autodetect laptop model
- Disable numpad if idle for more than a minute
- This is a rewrite of asus-touchpad-numpad-driver