Joop99
Posts: 60
Joined: Fri Jul 23, 2021 1:23 pm

where to save Wacom commands for auto start?

Thu Jul 29, 2021 11:38 am

I use a Wacom Bamboo tablet with only a pen, so no keys. I use this as a mouse in order to prevent RSI and this works very well. When pi 400 is started the setup for the "other" mouse button is set to button 3, that's the top button and difficult to use. I managed to set button 2 to button 3 and button 3 to button 2. When I use button 2 after this switch I get what you get with the other mouse button. Just clicking on a subject is done with the tip, ie button 1. This action was done with these two lines in the LXTerminal app;

xsetwacom set "Wacom Bamboo Connect Pen stylus" Button 2 3
xsetwacom set "Wacom Bamboo Connect Pen stylus" Button 3 2

This works, but now I want it to save it in a way that it is set automatic at start up the pi 400, but where to put those two lines?
Last edited by Joop99 on Thu Jul 29, 2021 11:42 am, edited 1 time in total.

User avatar
thagrol
Posts: 5560
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: where to save Wacom commands for auto start?

Thu Jul 29, 2021 11:42 am

I'm a volunteer. Take me for granted or abuse my support and I will walk away

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

Joop99
Posts: 60
Joined: Fri Jul 23, 2021 1:23 pm

Re: where to save Wacom commands for auto start?

Thu Jul 29, 2021 12:14 pm

Thanks, had some kind of .conf file in mind, but after reading your pdf and thinking it over it might be better to put it somewhere in a user directory. Its less likely that that will be rewritten with an update. But have again to study what's in those two files in /home/pi.

Joop99
Posts: 60
Joined: Fri Jul 23, 2021 1:23 pm

Re: where to save Wacom commands for auto start?

Thu Jul 29, 2021 1:54 pm

viewtopic.php?f=91&t=314455

section 4.1.3; I did open it with Text Editor, did copy the two lines in the end with some comment "# comment" and saved the file. Reboot and..... nothing, no button swap. Now there are three possibilities;
1 the /home/pi/.bashrc is not read;
2 the file is read, but doesn't know anything about xsetwacom because its to early in the proces;
3 can't find xsetwacom so command is not executed..

Did try to find some kind of log file, there are some but not one about .bashr, or its not in the same directory.
So to get back to your pdf, it seems not that simple as you wrote down. Solution?

klricks
Posts: 7978
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: where to save Wacom commands for auto start?

Thu Jul 29, 2021 2:06 pm

Joop99 wrote:
Thu Jul 29, 2021 1:54 pm
viewtopic.php?f=91&t=314455

section 4.1.3; I did open it with Text Editor, did copy the two lines in the end with some comment "# comment" and saved the file. Reboot and..... nothing, no button swap. Now there are three possibilities;
1 the /home/pi/.bashrc is not read;
2 the file is read, but doesn't know anything about xsetwacom because its to early in the proces;
3 can't find xsetwacom so command is not executed..

Did try to find some kind of log file, there are some but not one about .bashr, or its not in the same directory.
So to get back to your pdf, it seems not that simple as you wrote down. Solution?
If you are booting to desktop don't use bashrc.
Use autosart instead. See this for autostart details: viewtopic.php?f=66&t=294014
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

User avatar
thagrol
Posts: 5560
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: where to save Wacom commands for auto start?

Thu Jul 29, 2021 3:43 pm

klricks wrote:
Thu Jul 29, 2021 2:06 pm
Joop99 wrote:
Thu Jul 29, 2021 1:54 pm
viewtopic.php?f=91&t=314455

section 4.1.3; I did open it with Text Editor, did copy the two lines in the end with some comment "# comment" and saved the file. Reboot and..... nothing, no button swap. Now there are three possibilities;
1 the /home/pi/.bashrc is not read;
2 the file is read, but doesn't know anything about xsetwacom because its to early in the proces;
3 can't find xsetwacom so command is not executed..

Did try to find some kind of log file, there are some but not one about .bashr, or its not in the same directory.
So to get back to your pdf, it seems not that simple as you wrote down. Solution?
If you are booting to desktop don't use bashrc.
Use autosart instead. See this for autostart details: viewtopic.php?f=66&t=294014
I second using autostart. I'm also surprised that the flowchart in section 3.3 didn't take you there. See section 5.1 of my guide.

Using .bashrc is the wrong choice because:
  • It is run before the desktop has started
  • It is run at every login, even when over ssh
  • It is run whenever you open a terminal from teh desktop.
I'm a volunteer. Take me for granted or abuse my support and I will walk away

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

Joop99
Posts: 60
Joined: Fri Jul 23, 2021 1:23 pm

Re: where to save Wacom commands for auto start?

Thu Jul 29, 2021 7:57 pm

thagrol wrote:
Thu Jul 29, 2021 3:43 pm
I second using autostart. I'm also surprised that the flowchart in section 3.3 didn't take you there. See section 5.1 of my guide.

Using .bashrc is the wrong choice because:
  • It is run before the desktop has started
  • It is run at every login, even when over ssh
  • It is run whenever you open a terminal from teh desktop.
I see what you mean, but there is no desktop required for setting the buttons on a Wacom stylus, therefore I took the road behind "No".

User avatar
thagrol
Posts: 5560
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: where to save Wacom commands for auto start?

Thu Jul 29, 2021 10:39 pm

Joop99 wrote:
Thu Jul 29, 2021 7:57 pm
thagrol wrote:
Thu Jul 29, 2021 3:43 pm
I second using autostart. I'm also surprised that the flowchart in section 3.3 didn't take you there. See section 5.1 of my guide.

Using .bashrc is the wrong choice because:
  • It is run before the desktop has started
  • It is run at every login, even when over ssh
  • It is run whenever you open a terminal from teh desktop.
I see what you mean, but there is no desktop required for setting the buttons on a Wacom stylus, therefore I took the road behind "No".
That it's a shell command doesn't mean that a desktop isn't required. xhosts is a shell command but won't do anything usefull unless the desktop is running. Same with a lot of xset commands.

I'd expect xsetwacom to be the same though as I don't have any wacom devices I've never used it.
I'm a volunteer. Take me for granted or abuse my support and I will walk away

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

Joop99
Posts: 60
Joined: Fri Jul 23, 2021 1:23 pm

Re: where to save Wacom commands for auto start? (solved)

Mon Aug 02, 2021 10:37 am

The method with xsetwacom can only be used in the way I did. When you want that Pi is set that way every time you start up you have to do something else. I got my info from https://help.ubuntu.com/community/Wacom. In Pi 400 (don't know if it is the same in other Pi's) you have to start up file manager with "sudo pcmanfm". Go to "/usr/share/X11/xorg.conf.d". In this directory are 3 files, you need "70-wacom.conf". There are a lot of sections, but if you read carefully you can see that they are different models and different connections with the computer.
I had to take the first section;

Section "InputClass"
Identifier "Wacom USB tablet class"
MatchUSBID "056a:*"
MatchDevicePath "/dev/input/event*"
MatchIsTablet "true"
Driver "wacom"
Option "Button2" "3"
Option "Button3" "2"
EndSection

The two lines I added are the lines with "Option". Save the file and exit file manager and LXTerminal. Close everything if something was running. REBOOT. Now test if the stylus does what you want, you can do that in Text Editor in a safe way.

Return to “General discussion”