Just annotations of little "how to's", so I know I can find how to do something I've already done when I need to do it again, in case I don't remember anymore, which is not unlikely. Hopefully they can be useful to others, but I can't guarantee that it will work, or that it won't even make things worse.
Proof of concept script to make GIMP more similar to MyPaint or Krita, for painting/drawing
Apparently on GIMP you can't set the stylus button 3 as an instant color picker. The default is to hold control and click, which is not that much of a hassle, but it's interesting to have this kind of functionality more uniformly activated.
A hacky way of getting an approximation of it is along the line(s) of:
For better reading, NOT for copy/paste:
while true ; do xdotool getactivewindow getwindowname | grep GIMP &&
xsetwacom set "Wacom Bamboo Pen stylus" Button 3 "key Control button 1" ||
xsetwacom set "Wacom Bamboo Pen stylus" Button 3 "button 3" ; sleep 0.3 ; done
Which would run as a wrap-around script on GIMP, I guess.
It possibly can be improved by assigning a random variable as an "on/off" thing so to avoid issuing the same command all the time, skipping xsetwacom itself.
Needless to say, you lose the "right click" menu with the stylus while it runs, even though it's still accessible on the mouse and on the menu bar itself, if it's not hidden.
Ideally I'd hack GIMP's code and make it a thing that can be configured for real, though, but that's well beyond my capabilities right now.
_____________
Okay, here's a more refined script, that uses a variable in order to skip or not issuing xsetwacom:
It would possibly be improved in terms of CPU load by replacing some if/then/else phrasings with just concatenated "&&" and "||", like the original, but I couldn't do the lock thing work that way, it's somewhat more confusing to write it. In the other hand, maybe the if/fis thing make it consume more CPU than issuing xsetwacom all the time, I haven't checked.
But I don't even know if it makes that much of a difference, it may well be worse.
A hacky way of getting an approximation of it is along the line(s) of:
Code:
while true ; do xdotool getactivewindow getwindowname | grep GIMP && xsetwacom set "Wacom Bamboo Pen stylus" Button 3 "key Control button 1" || xsetwacom set "Wacom Bamboo Pen stylus" Button 3 "button 3" ; sleep 0.3 ; done
while true ; do xdotool getactivewindow getwindowname | grep GIMP &&
xsetwacom set "Wacom Bamboo Pen stylus" Button 3 "key Control button 1" ||
xsetwacom set "Wacom Bamboo Pen stylus" Button 3 "button 3" ; sleep 0.3 ; done
Which would run as a wrap-around script on GIMP, I guess.
It possibly can be improved by assigning a random variable as an "on/off" thing so to avoid issuing the same command all the time, skipping xsetwacom itself.
Needless to say, you lose the "right click" menu with the stylus while it runs, even though it's still accessible on the mouse and on the menu bar itself, if it's not hidden.
Ideally I'd hack GIMP's code and make it a thing that can be configured for real, though, but that's well beyond my capabilities right now.
_____________
Okay, here's a more refined script, that uses a variable in order to skip or not issuing xsetwacom:
Code:
#!/bin/bash xsetwlock=0 while true ; do if xdotool getactivewindow getwindowname | grep GIMP > /dev/null ; then if ((xsetwlock==0)) ; then xsetwacom set "Wacom Bamboo Pen stylus" Button 3 "key Control button 1" xsetwlock=1 fi else if ((xsetwlock==1)) ; then xsetwacom set "Wacom Bamboo Pen stylus" Button 3 "button 3" xsetwlock=0 fi fi sleep 0.3 done
But I don't even know if it makes that much of a difference, it may well be worse.
Total Comments 0