#+TITLE: Drawing Tablet - Xournal
#+SETUPFILE: ./setup/org-setup-file.org
#+PROPERTY: header-args:bash :comments both :mkdirp yes
#+PROPERTY: header-args:bash+ :shebang "#!/usr/bin/env bash"
#+PROPERTY: header-args:bash+ :tangle-mode (identity #o555)
* =xournalpp=
=toolbar.ini=:
#+begin_src conf :tangle ~/.config/xournalpp/toolbar.ini
## Xournal++ Toolbar configuration
## Here you can customize the Toolbars
# Delete this file to generate a new config file with default values
#
# Available buttons:
# File: NEW,SAVE,OPEN,PRINT
#
# Edit: CUT,COPY,PASTE,SEARCH,UNDO,REDO,INSERT_NEW_PAGE
#
# Navigation: GOTO_FIRST,GOTO_BACK,GOTO_NEXT,GOTO_LAST,GOTO_NEXT_ANNOTATED_PAGE
#
# Zoom: ZOOM_OUT,ZOOM_IN,ZOOM_FIT,ZOOM_100,FULLSCREEN,PAIRED_PAGES
#
# Color: COLOR(0xffffff),COLOR(0xffff00),COLOR(0xff8000),COLOR(0xff00ff),COLOR(0x00ff00),COLOR(0x00c0ff),COLOR(0x808080),COLOR(0x008000),COLOR(0xff0000),COLOR(0x3333cc),COLOR(0x000000),COLOR_SELECT
# Notice: This are the default Xournal colors, each other color in HEX can also be used, eg COLOR(0x12ABCF);
#
# Tools: ERASER,PEN,HIGHLIGHTER,IMAGE,TEXT,IMAGE,SELECT,SELECT_REGION,SELECT_RECTANGLE,VERTICAL_SPACE,HAND
# Notice: ERASER also has a drop down menu to select the eraser type, SELECT are all selection tools, with drop down menu
#
# Tool settings: SHAPE_RECOGNIZER,RULER,FINE,MEDIUM,THICK,SELECT_FONT
#
# Components: PAGE_SPIN,ZOOM_SLIDER,LAYER
# PAGE_SPIN: The page spiner, incl. current page label
# ZOOM_SLIDER: The zoom slider
# LAYER: The layer dropdown menu
#
#
[Floating Toolbox - Custom]
toolbarTop1=SAVE,NEW,OPEN,SEPARATOR,IMAGE,TEXT,MATH_TEX,DRAW,SEPARATOR,SELECT,SEPARATOR,DEFAULT_TOOL,SEPARATOR,ZOOM_100,ZOOM_FIT
toolbarFloat1=PEN,HIGHLIGHTER,ERASER
toolbarFloat2=FINE,MEDIUM,THICK,VERY_THICK
toolbarFloat3=COLOR(0xffffff),COLOR(0x0072BD),COLOR(0xD95218),COLOR(0xECB01F),COLOR(0x7D2E8E),COLOR(0x77AB2F),COLOR(0x000000),COLOR_SELECT
toolbarFloat4=DRAW_RECTANGLE,DRAW_ELLIPSE,DRAW_ARROW,RULER,DRAW_SPLINE
name=Floating Tolbox - Custom
#+end_src
Special lines in =settings.xml=:
#+begin_src conf :tangle no
#+end_src
* Automatically configure tablet
See [[https://unix.stackexchange.com/questions/65788/why-doesnt-xsetwacom-work-from-udev][here]].
=sudoedit /etc/udev/rules.d/99-huion-tablet.rules=
#+begin_src conf :tangle no
SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="256c", ATTRS{idProduct}=="006d", RUN="/home/thomas/.local/scripts/setup-huion-tablet.sh"
#+end_src
Then two scripts are used.
The first one is just used to call the second one in the background
#+begin_src bash :tangle ~/.local/scripts/setup-huion-tablet.sh
/home/thomas/.local/scripts/setup-huion-tablet-script.sh &
#+end_src
And this is the second one with the actual config:
#+begin_src bash :tangle ~/.local/scripts/setup-huion-tablet-script.sh
sleep 2
DISPLAY=:0
XAUTHORITY=/home/thomas/.Xauthority
export DISPLAY XAUTHORITY
# Pen Buttons
xsetwacom set "HUION Huion Tablet_H320M stylus" button 1 1 # Left click
xsetwacom set "HUION Huion Tablet_H320M stylus" button 2 2 # Right click
xsetwacom set "HUION Huion Tablet_H320M stylus" button 3 3 # Middle click
# Top Buttons
xsetwacom set "HUION Huion Tablet_H320M pad" button 1 "key Ctrl T" # Tools
xsetwacom set "HUION Huion Tablet_H320M pad" button 2 "key Ctrl Shift A" # Hand Tool
xsetwacom set "HUION Huion Tablet_H320M pad" button 3 "key Ctrl Shift D" # Default Tool
# Round Buttons (Top, Bottom, Middle, Left, Right)
xsetwacom set "HUION Huion Tablet_H320M pad" button 8 "key Ctrl Shift +" # Zoom
xsetwacom set "HUION Huion Tablet_H320M pad" button 9 "key Ctrl -" # Unzoom
xsetwacom set "HUION Huion Tablet_H320M pad" button 10 "key Ctrl S" # Save
xsetwacom set "HUION Huion Tablet_H320M pad" button 11 "key Ctrl Z" # Undo
xsetwacom set "HUION Huion Tablet_H320M pad" button 12 "key Ctrl Y" # Redo
# Bottom Buttons
xsetwacom set "HUION Huion Tablet_H320M pad" button 13 "key Ctrl Shift O" # Select
xsetwacom set "HUION Huion Tablet_H320M pad" button 14 "key Ctrl Shift E" # Errase
xsetwacom set "HUION Huion Tablet_H320M pad" button 15 "key Ctrl Q" # Quit
#+end_src