HUION Kamvas Pro 22 drivers not available on DIGImend list


#151

quick question(hopefully), is this example correct?

#will this work to run the script as root at startup (after graphical.target)???
#if yes, does the script need to be in a certain directory?
#does the ownership of script need to be set to root for this to work??
[Unit]
Description=run start-driver.sh at boot
After=network.target

[Service]
User=root
Type=oneshot
ExecStart=./~/Documents/pilote_tablette_graphique/HuionKamvasGT220v2LinuxDriver/start-driver.sh
#is the "./" needed to run the script from a service?
[Install]
WantedBy=multi-user.target

i would like to know either way for my own education and future use or running a script as root at startup, ive been looking for a while through wiki’s/posts but im not sure. any help would be appreciated.
also, would “sudo” have to be removed from any lines in start-driver.sh since it would already be run as root in the first place? or would it not matter?


#152

Thanks! I saw that and it is equivalent to what I have done with the xfce-setting-manager. So no found solution by now…


#153

You received a lot of information, very clear on how to make that script running, but please also apply some common sense and logic.

The one script you are running is invoking another script that is called kamvas.py that works as a driver. So, when you launch the start-driver.sh from terminal, you ARE in the path/location where those two scripts reside. When you launch it from elsewhere, you need the real path/location for both of them. That is why one of the scripts had

and the other had

and that is why i asked if are identical or not, and if the kamvas.py is also identical on both cases, and which script works better for you and if they don’t interfere if you run both …

If the start-driver.sh works, then to run it from elsewhere, or as startup script, also the path to kamvas.py has to be the real path, or if you create a startup *.desktop file you have to define the ExecPath="to where the scripts and driver are"


#154

Thanks for all your answers. I am doing my best, sorry for my basic questions…

As @bogdancovaciu told me, I have changes in start-driver.sh the path giving the real path to the driver so that the driver could be run at startup. Now the start-driver.sh looks:

#!/usr/bin/env bash
# Adjust this as needed
DRIVER="/home/nameid/Documents/pilote_tablette_graphique/HuionKamvasGT220v2LinuxDriver/kamvas.py"

T="256c:006e"
BUS=$(lsusb | grep "$T" | sed -e 's|Bus \([0-9]*\) Device \([0-9]*\):.*$|\1|g')
DEV=$(lsusb | grep "$T" | sed -e 's|Bus \([0-9]*\) Device \([0-9]*\):.*$|\2|g')

sudo rmmod hid_uclogic
sudo modprobe uinput
sudo /usr/local/bin/uclogic-probe $BUS $DEV | /usr/local/bin/uclogic-decode
sudo python3 $DRIVER > /dev/null 2>&1 & disown; sleep 2; exit


Indeed, by creating a command at startup in xfce-settings-manager in a graphic way, it created the file /home/namedid/.config/autostart/pilote tablette graphique Huion.desktop which is the following:

[Desktop Entry]
Encoding=UTF-8
Version=0.9.4
Type=Application
Name=pilote tablette graphique Huion
Comment=avec écran
Exec=/home/nameid/Documents/pilote_tablette_graphique/HuionKamvasGT220v2LinuxDriver/start-driver.sh
OnlyShowIn=XFCE;
StartupNotify=false
Terminal=false
Hidden=false

Instead of Exec=/home/nameid/Documents/pilote_tablette_graphique/HuionKamvasGT220v2LinuxDriver/start-driver.sh, I have tried before with
Exec=~/Documents/pilote_tablette_graphique/HuionKamvasGT220v2LinuxDriver/start-driver.sh but none of them launch the driver automatically after the boot. Should I try with sudo before these commands?
Thanks again.
Just for information, the script start-driver.sh as pasted above works still well (sometimes it is necessary to sleep/awake the computer to make the pen working on the graphic pad).


#155

rename the file to simply huion.desktop and reboot.


#156

Thanks for your answer. I have made it and rebooted twice but the script is not launched after the boots… There must be still a problem but I do not see where.
Changing their path to /usr/bin/ is not a good solution? I just propose but have no real experience…

edit : after the boots, I have put the computer into the sleep mode and awake but it does no change anything for the automatic launch of this script.


#157

because it needs to be run by system/root and not at user level to be automated since it requires sudo privileges. thats why i suggested looking into how to do just that, suggested some examples of using a service to run the script at boot. there is another way im pretty sure would work but i think it to be a bit hacky and thats including a execute command in an existing service that runs on the system level (im sure this is probably frowned upon by some and not the proper way of doing it and is why i didnt suggest it :wink:)


#158

Here is an example of how I would start a script in Konsole with root privileges from a desktop file. You would need to substitute your terminal program for konsole and substitute your own path.

Exec=konsole -e sudo /home/htpc/.scripts/wifi-restart.sh &

This is an even better way to do the same thing. This will not open a terminal window at all. This will simply open a small pkexec password prompt for your sudo password. The commands will all execute in the background. For this method to work you must install a small terminal program named “tmux”.

Exec=pkexec tmux -c /home/htpc/.scripts/wifi-restart.sh; sleep2 & exit

I do not feel like playing 150 questions with you anymore. Please attempt to find some answers for yourself. Your main issue is resolved. These are now issues you should be able to take care of yourself.


#159

I am really sorry to bother you all (and would like to work on my pad and stop boring you) with this topic and I thank you really for your great help!

I have downloaded tmux from pamac and wrote this line in huion.desktop:

Exec=pkexec tmux -c /home/nameid/Documents/pilote_tablette_graphique/HuionKamvasGT220v2LinuxDriver/start-driver.sh; sleep2 & exit

That does not work, also after sleeping/awaking the computer.

Afterwards I have replaced this line in huion.desktop, by

Exec=xfce4-terminal -e sudo /home/nameid/Documents/pilote_tablette_graphique/HuionKamvasGT220v2LinuxDriver/start-driver.sh &

but it has not worked neither…

I am sorry. Thanks again.


#160

You do know you must substitute your “user name” for “nameid” in any command I hope.


#161

Yes, of course. I write “nameid” for anonymizing purposes.
Thanks for your answer.


#162

I was just double checking because either of those 2 commands I gave work fine for me. I have no idea why you are having such difficulty.

If you actually formatted your code on the forum properly it would be a lot easier to see if you had any syntax errors.

Information on how to properly post hardware specs and logs:

Please format any terminal output with three backticks before and after, as shown in this picture:


#163

Have you made the desktop file you created executable?


#164

Apparently not but all the .desktop files are like the huion.desktop. Doing ls -l in /home/nameid/.config/autostart:

ls -l
total 32
-rw-r--r-- 1 nameid nameid   29 24 oct.  15:35 blueman.desktop
-rw-r--r-- 1 nameid nameid  277 19 déc.  18:28 huion.desktop
-rw-r--r-- 1 nameid nameid 1223  1 juil. 16:15 manjaro-hello.desktop
-rw-r--r-- 1 nameid nameid 3411 13 oct.  15:30 redshift-gtk.desktop
-rw-r--r-- 1 nameid nameid   70 19 déc.  18:29 xfce4-clipman-plugin-autostart.desktop
-rw-r--r-- 1 nameid nameid   29  4 juil. 22:27 xfce4-settings-helper-autostart.desktop
-rw-r--r-- 1 nameid nameid   29  4 juil. 22:27 xfce4-tips-autostart.desktop
-rw-r--r-- 1 nameid nameid   28  4 juil. 22:27 xfconf-migration-4.6.desktop

And redshift that I have installed is working after every boot for example (and manjaro hello for example).

Should I nevertheless make the huion.desktop executable?


#165

Every desktop file needs to be executable as far as I know.


#166

There must be a way to determine where exactly is not working. Since is a cascade from the desktop file that calls the start-driver.sh that then calls the kamvas.py … from what point is not working?
We can’t test as we don’t have that setup … Also the startup is a bit different in XFCE than KDE Plasma … AFAIK.


#167

All I know is my desktop files in ~/.config/autostart are executable. Does the desktop fie launch properly if you copy it to your desktop and launch it from there. It must be executable.


#168

If I do sudo ./start-driver.sh it now always works! So there is a problem between the desktop file and the start-driver.sh one.


#169

A few ideas:

  1. Check to be run as a program, so you mark the checkbox as active in the Permissions tab

image

  1. Add the working directory /home/nameid/Documents/pilote_tablette_graphique/HuionKamvasGT220v2LinuxDriver in the Launcher tab … probably checkbox the two boxes too

image


#170

that will work if run from its containing directory . if you opened a fresh term and ran that you would need its directory no? assume the same for anything not in the same directory thats trying to run something from outside