I have just bought a Huion H640P tablet (just for writing notes), and use it with Ubuntu 18.04 with kernel 5.3.0-40-generic.

I installed digimend-kernel-drivers v9 to make the tablet work.

Now, how can I configure hotkeys on the tablet and make the configuration permanent so that I don't have to launch commands like:

xsetwacom set "HID 256c:006d Pad pad" button 1 key Ctrl z

each time I start Ubuntu? (for instance, I want to set button 2 for scrolling).

  • 3
    Does this answer your question? How to run scripts on start up?
    – K7AAY
    Mar 23, 2020 at 18:11
  • Well, yes. I would like to write a bash script (?), but for the specific case of Huion H640P model. I don't even know which shortcuts I can set for the tablet.
    – michele_ub
    Mar 23, 2020 at 22:06
  • I would prefer: button 1: ctrl+z, button 2: pag up, button 3 pag down, button 4: ctr +c, button 5: ctrl+v , button 6 ctrl + s (save)
    – michele_ub
    Mar 23, 2020 at 22:58
  • @michele_ub Welcome to AskUbuntu! You might find this useful
    – Elder Geek
    Mar 24, 2020 at 16:12
  • @ElderGeek Well, this is the reference page for xsetwacom, and is useful, but I need to map shortcuts into tablet's keys, writing a bash script.
    – michele_ub
    Mar 24, 2020 at 16:52

2 Answers 2


Since you already know the commands you need to use (based on your question), the vast majority of the information you need is already here. To clarify, a script is nothing more than a text file of commands that has its permissions set to executable.

To avoid having to run your script of commands every time, all you need to do is run the script at startup.

Once you've chosen your scripting language there are numerous resources that explain the syntax. If you get stuck on the programming aspect you can always ask find answers to specific questions by utilizing for example our sister site https://stackoverflow.com/

Personally I often use bash for simple scripts such as you seem to require, Here's a command reference However in your case you might not need that much. A simple script might be described as:

command 1
command 2
command 3

where command 1 is xsetwacom set "HID 256c:006d Pad pad" button 1 key Ctrl z

I don't have your hardware and as such am unable to test it's capabilities, you however can do this with a bit of research and effort. xinput could be a useful tool for this.

  • Thank you for your answer, it helped me to solve the problem. I wrote the script and added it to the list of programs to run at startup.
    – michele_ub
    Mar 26, 2020 at 11:23
  • 1
    @michele_ub Always eager to help. I'm glad the information was useful. Cheers!
    – Elder Geek
    Mar 26, 2020 at 16:59

Try this page https://www.huion.com/download/, I was able to download the software to set the hotkeys from here which worked on ubuntu 20 for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.