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-
libevdev
sudo apt install libevdev2
sudo pacman -S libevdev
sudo dnf install libevdev
Releases
page/usr/bin/
)OR
Rustup
sudo -E cargo install --root /usr --git="https://github.com/iamkroot/asus-numpad"
sudo modprobe i2c-dev
and sudo modprobe uinput
Create the config file at /etc/xdg/asus_numpad.toml
and add layout = "LAYOUT"
, where LAYOUT
is one of UX433FA
, M433IA
, UX581
, GX701
, GX531
or G533
. See Configuration for more options.
sudo asus-numpad
sudo
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 show crw-rw---- 1 root uinput ... /dev/uinput
(The uinput
after root
is important)ls -l /dev/i2c-*
should be owned by i2c
groupgroups asus_numpad
should include input
, i2c
and uinput
.To enable autoloading at boot, a systemd service has been provided.
User=asus_numpad
the end of [Service]
section in tools/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 the sudoers
fileasus_numpad ALL=(__YOUR_USERNAME__) NOPASSWD: ALL
(replace __YOUR_USERNAME__
with your actual username!)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:
sudo
strip
release binaries