{"id":408,"date":"2011-01-22T14:18:09","date_gmt":"2011-01-22T13:18:09","guid":{"rendered":"http:\/\/braindump.kargulus.de\/?p=408"},"modified":"2016-10-12T20:43:56","modified_gmt":"2016-10-12T18:43:56","slug":"using-the-wacom-intuos4-tablet-with-linux-part-2","status":"publish","type":"post","link":"https:\/\/braindump.kargulus.de\/?p=408","title":{"rendered":"Using The Wacom Intuos4 Tablet With Linux (Part 2)"},"content":{"rendered":"<p><img decoding=\"async\" class=\"alignleft\" title=\"Wacom Intuos4 M tablet\" src=\"..\/wp-content\/uploads\/wacom-intuos4-m-tablet3-300x202.jpg\" alt=\"Wacom Intuos4 M tablet\" width=\"171\" height=\"115\" \/>After developing a tool to manipulate the LEDs of the tablet in <a title=\"Part 1\" href=\"..\/?p=321\" target=\"_self\">Part 1<\/a>, the next step is to simplify the usage. The idea is to provide profiles which store a tablet configuration (this is, the button keys and the icons of the LED displays). A collection of such profiles is stored in an XML document. The user can choose the appropriate profile by using a command line tool. The\u00a0setup and usage of the tool is described in the following.<!--more--><\/p>\n<p><strong>Notes: <\/strong>In order to use this tool, the following is required:<\/p>\n<ul>\n<li>The Linux Wacom tool xsetwacom must be installed.<\/li>\n<li>The command <code class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">intuos4-led-config<\/code>\u00a0(see <a title=\"Part 1\" href=\"..\/?p=321\" target=\"_self\">Part 1<\/a>) must be installed and located as an executable in one of the directories <code class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\/usr\/bin<\/code>, <span style=\"font-family: monospace;\"><code class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\/usr\/local\/bin<\/code><\/span>,\u00a0<code class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">%HOME\/bin.<\/code>.<\/li>\n<li>The user must be in the sudo group.<\/li>\n<\/ul>\n<h2>Installation<\/h2>\n<p>The command line tool is written in Python. Hence, Python and some related stuff must be installed. Under Debian GNU\/Linux, this is done with the following command:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-linenumbers=\"false\">sudo apt-get install python python-argparse<\/pre>\n<p>To install the config tool, download the <a title=\"Using The Wacom Intuos4 Tablet With Linux\" href=\"https:\/\/braindump.kargulus.de\/?p=432\" target=\"_self\">source archive<\/a>. Extract the archive by executing the following command (by replacing xyz with the version number of the archive) :<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-linenumbers=\"false\">tar xzf intuos4-config-xyz.tar.gz<\/pre>\n<p>After that, change directory to the extracted directory:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-linenumbers=\"false\">cd intuos4-config-xyz<\/pre>\n<p>Build the package by executing:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">python setup.py build<\/pre>\n<p>If an error occurs, then check whether a python library is missing. If the build is successful, then install the package with the command:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">sudo python setup.py install<\/pre>\n<p>After that, the config script\u00a0<code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">intuos4-config.py<\/code>\u00a0can be found in the folder <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">\/usr\/local\/bin<\/code>. Furthermore, a sample configuration is provided in the folder <div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-1 hundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-overflow:visible;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-0 fusion_builder_column_1_1 1_1 fusion-one-full fusion-column-first fusion-column-last fusion-column-no-min-height\" style=\"--awb-bg-size:cover;--awb-margin-bottom:0px;\"><div class=\"fusion-column-wrapper fusion-flex-column-wrapper-legacy\">[cci]\/usr\/local\/share\/intuos4[\/cci].<\/p>\n<h2>Setup<\/h2>\n<p>For a quick start, the sample configuration must be copied into the user&#8217;s home folder. This is done as follows:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">mkdir $HOME\/.intuos4\r\ncp -r \/usr\/local\/share\/intuos4\/* $HOME\/.intuos4\/<\/pre>\n<p>After this, the config tool is ready to use. The command<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">intuos4-config.py --list<\/pre>\n<p>lists the names of the available profiles. In the example there included are three profiles: <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">Demo<\/code>, <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">Image Demo<\/code>, and <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">GIMP<\/code>.<\/p>\n<p>To apply the profile <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">Demo<\/code>\u00a0to the tablet, execute:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">intuos4-config.py --profile Demo<\/pre>\n<p>Note, that you need to enter your password, since some of the internal commands of the script need superuser rights.<\/p>\n<p>The default name of the tablet device is <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">Wacom Intuos4 6x9 pad<\/code>\u00a0which corresponds to the Wacom Intuos4 M tablet. If an Intuos4 tablet of a different size is used, the device name can be passed to intuos4-config.py with the argument <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">--device<\/code>. Note, that you can determine the name of your device by executing<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">xsetwacom --list | grep pad<\/pre>\n<p>and removing the tailing PAD.<\/p>\n<p>To apply the profile <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">Image Demo<\/code>\u00a0to the tablet, execute:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">intuos4-config.py --profile \"Image Demo\"<\/pre>\n<p>Note the quotation marks which are used if the name contains a whitespace character.<\/p>\n<h2>Creating new profiles<\/h2>\n<p>The available profiles are stored in the file <div class=\"fusion-clearfix\"><\/div><\/div><\/div><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-1 fusion_builder_column_1_1 1_1 fusion-one-full fusion-column-first fusion-column-last fusion-column-no-min-height\" style=\"--awb-bg-size:cover;--awb-margin-bottom:0px;\"><div class=\"fusion-column-wrapper fusion-flex-column-wrapper-legacy\">[cci]settings.xml[\/cci]. It contains an XML document which allows you to add new profiles.<\/p>\n<p>The basic layout of the XML document is:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"xml\" data-enlighter-linenumbers=\"true\">&lt;intuos4settings device=\"Wacom Intuos4 6x9 pad\"&gt;\r\n  &lt;profiles default=\"Name1\"&gt;\r\n    &lt;profile name=\"Name1\" lefthanded=\"false\"&gt;\r\n      ...\r\n    &lt;\/profile&gt;\r\n    ...\r\n    &lt;profile name=\"Name110\" lefthanded=\"false\"&gt;\r\n      ...\r\n    &lt;\/profile&gt;\r\n  &lt;\/profiles&gt;\r\n&lt;\/intuos4settings&gt;<\/pre>\n<p>The element <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">intuos4settings<\/code>\u00a0is the outermost element of the XML document. The default device may be provided by the attribute <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">device<\/code>. The profiles are stored within the element <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">profiles<\/code>. The name of the default profile may be set with the attribute <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">default<\/code>. There is no restriction on the number of profiles.<\/p>\n<p>A profile stores the configuration of all eight display buttons plus the button in the center of the wheel. An example for a profile is presented in the next listing:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"xml\" data-enlighter-linenumbers=\"true\">&lt;intuos4settings device=\"Wacom Intuos4 6x9 pad\"&gt;\r\n  &lt;profiles default=\"GIMP\"&gt;\r\n    &lt;profile name=\"Demo\" lefthanded=\"False\"&gt;\r\n      &lt;button number=\"1\"&gt;\r\n        &lt;oled type=\"icon\" name=\"ButtonOne\"&gt;&lt;\/oled&gt;\r\n        &lt;keystroke key=\"1\"&gt;&lt;\/keystroke&gt;\r\n      &lt;\/button&gt;\r\n      &lt;button number=\"2\"&gt;\r\n        &lt;oled type=\"icon\" name=\"ButtonTwo\"&gt;&lt;\/oled&gt;\r\n        &lt;keystroke key=\"2\"&gt;&lt;\/keystroke&gt;\r\n      &lt;\/button&gt;\r\n      &lt;button number=\"3\"&gt;\r\n        &lt;oled type=\"icon\" name=\"ButtonThree\"&gt;&lt;\/oled&gt;\r\n        &lt;keystroke key=\"3\"&gt;&lt;\/keystroke&gt;\r\n      &lt;\/button&gt;\r\n      &lt;button number=\"4\"&gt;\r\n        &lt;oled type=\"icon\" name=\"ButtonFour\"&gt;&lt;\/oled&gt;\r\n        &lt;keystroke key=\"8\"&gt;&lt;\/keystroke&gt;\r\n      &lt;\/button&gt;\r\n      &lt;button number=\"5\"&gt;\r\n        &lt;oled type=\"icon\" name=\"ButtonFive\"&gt;&lt;\/oled&gt;\r\n        &lt;keystroke key=\"5\"&gt;&lt;\/keystroke&gt;\r\n      &lt;\/button&gt;\r\n      &lt;button number=\"6\"&gt;\r\n        &lt;oled type=\"icon\" name=\"ButtonSix\"&gt;&lt;\/oled&gt;\r\n        &lt;keystroke key=\"6\"&gt;&lt;\/keystroke&gt;\r\n      &lt;\/button&gt;\r\n      &lt;button number=\"7\"&gt;\r\n        &lt;oled type=\"icon\" name=\"ButtonSeven\"&gt;&lt;\/oled&gt;\r\n        &lt;keystroke key=\"7\"&gt;&lt;\/keystroke&gt;\r\n      &lt;\/button&gt;\r\n      &lt;button number=\"8\"&gt;\r\n        &lt;oled type=\"icon\" name=\"ButtonEight\"&gt;&lt;\/oled&gt;\r\n        &lt;keystroke key=\"8\"&gt;&lt;\/keystroke&gt;\r\n      &lt;\/button&gt;\r\n    &lt;\/profile&gt;\r\n    &lt;profile name=\"Image Demo\" lefthanded=\"False\"&gt;\r\n      &lt;button number=\"1\"&gt;\r\n        &lt;oled type=\"image\" name=\"~\/.intuos4\/icons\/icon-cut.png\"&gt;&lt;\/oled&gt;\r\n        &lt;keystroke key=\"ctrl x\"&gt;&lt;\/keystroke&gt;\r\n      &lt;\/button&gt;\r\n      &lt;button number=\"2\"&gt;\r\n        &lt;oled type=\"image\" name=\"~\/.intuos4\/icons\/icon-copy.png\"&gt;&lt;\/oled&gt;\r\n        &lt;keystroke key=\"ctrl c\"&gt;&lt;\/keystroke&gt;\r\n      &lt;\/button&gt;\r\n      &lt;button number=\"3\"&gt;\r\n        &lt;oled type=\"image\" name=\"~\/.intuos4\/icons\/icon-paste.png\"&gt;&lt;\/oled&gt;\r\n        &lt;keystroke key=\"ctrl v\"&gt;&lt;\/keystroke&gt;\r\n      &lt;\/button&gt;\r\n      &lt;button number=\"4\"&gt;\r\n        &lt;oled type=\"icon\" name=\"Save\"&gt;&lt;\/oled&gt;\r\n        &lt;keystroke key=\"\"&gt;ctrl s&lt;\/keystroke&gt;\r\n      &lt;\/button&gt;\r\n      &lt;button number=\"5\"&gt;\r\n        &lt;oled type=\"icon\" name=\"Blank\"&gt;&lt;\/oled&gt;\r\n        &lt;keystroke key=\"\"&gt;&lt;\/keystroke&gt;\r\n      &lt;\/button&gt;\r\n      &lt;button number=\"6\"&gt;\r\n        &lt;oled type=\"image\" name=\"~\/.intuos4\/icons\/icon-tux-inverse.png\"&gt;&lt;\/oled&gt;\r\n        &lt;keystroke key=\"\"&gt;&lt;\/keystroke&gt;\r\n      &lt;\/button&gt;\r\n      &lt;button number=\"7\"&gt;\r\n        &lt;oled type=\"icon\" name=\"DebianLogo\"&gt;&lt;\/oled&gt;\r\n        &lt;keystroke key=\"\"&gt;&lt;\/keystroke&gt;\r\n      &lt;\/button&gt;\r\n      &lt;button number=\"8\"&gt;\r\n        &lt;oled type=\"icon\" name=\"WacomLogo\"&gt;&lt;\/oled&gt;\r\n        &lt;keystroke key=\"\"&gt;&lt;\/keystroke&gt;\r\n      &lt;\/button&gt;\r\n      &lt;wheel button=\"ctrl z\"&gt;&lt;\/wheel&gt;\r\n    &lt;\/profile&gt;\r\n    &lt;profile name=\"GIMP\" lefthanded=\"false\"&gt;\r\n      &lt;button number=\"1\"&gt;\r\n        &lt;oled type=\"icon\" name=\"Undo\"&gt;&lt;\/oled&gt;\r\n        &lt;keystroke key=\"ctrl z\"&gt;&lt;\/keystroke&gt;\r\n      &lt;\/button&gt;\r\n      &lt;button number=\"2\"&gt;\r\n        &lt;oled type=\"icon\" name=\"Redo\"&gt;&lt;\/oled&gt;\r\n        &lt;keystroke key=\"ctrl y\"&gt;&lt;\/keystroke&gt;\r\n      &lt;\/button&gt;\r\n      &lt;button number=\"3\"&gt;\r\n        &lt;oled type=\"icon\" name=\"ZoomIn\"&gt;&lt;\/oled&gt;\r\n        &lt;keystroke key=\"plus\"&gt;&lt;\/keystroke&gt;\r\n      &lt;\/button&gt;\r\n      &lt;button number=\"4\"&gt;\r\n        &lt;oled type=\"icon\" name=\"ZoomOut\"&gt;&lt;\/oled&gt;\r\n        &lt;keystroke key=\"minus\"&gt;&lt;\/keystroke&gt;\r\n      &lt;\/button&gt;\r\n      &lt;button number=\"5\"&gt;\r\n        &lt;oled type=\"icon\" name=\"Save\"&gt;&lt;\/oled&gt;\r\n        &lt;keystroke key=\"ctrl s\"&gt;&lt;\/keystroke&gt;\r\n      &lt;\/button&gt;\r\n      &lt;button number=\"6\"&gt;\r\n        &lt;oled type=\"icon\" name=\"Alt\"&gt;&lt;\/oled&gt;\r\n        &lt;keystroke key=\"alt\"&gt;&lt;\/keystroke&gt;\r\n      &lt;\/button&gt;\r\n      &lt;button number=\"7\"&gt;\r\n        &lt;oled type=\"icon\" name=\"Ctrl\"&gt;&lt;\/oled&gt;\r\n        &lt;keystroke key=\"ctrl\"&gt;&lt;\/keystroke&gt;\r\n      &lt;\/button&gt;\r\n      &lt;button number=\"8\"&gt;\r\n        &lt;oled type=\"icon\" name=\"ArrowUp\"&gt;&lt;\/oled&gt;\r\n        &lt;keystroke key=\"shift\"&gt;&lt;\/keystroke&gt;\r\n      &lt;\/button&gt;\r\n      &lt;wheel button=\"Ctrl E\"&gt;&lt;\/wheel&gt;\r\n    &lt;\/profile&gt;\r\n  &lt;\/profiles&gt;\r\n&lt;\/intuos4settings&gt;\r\n<\/pre>\n<p>The settings of a profile are stored in the element <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">profile<\/code>. The attribute <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">name<\/code>\u00a0stores the name of the profile. This name must be unique. The optional attribute <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">lefthanded<\/code>\u00a0handles the orientation of the tablet.<\/p>\n<p>The element <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">button<\/code>\u00a0stores the configuration of a particular display button. The number of the button is set by the attribute <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">number<\/code>\u00a0which must be an integer between 1 and 8. The subelement <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">oled<\/code>\u00a0 contains the configuration of the button&#8217;s LED. It owns the two attributes <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">type<\/code>\u00a0and <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">name<\/code>\u00a0with the following meaning:<\/p>\n<ul>\n<li>If\u00a0<code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">type<\/code>\u00a0equals <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">\"icon\"<\/code>, then <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">name<\/code>\u00a0refers to a builtin icon of the command <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">intuos4-led-config<\/code>\u00a0(see <a title=\"Part 1\" href=\"https:\/\/braindump.kargulus.de\/?p=321\" target=\"_self\">Part 1<\/a> for details).<\/li>\n<li>If <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">type<\/code>\u00a0equals <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">\"image\"<\/code>, then <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">name<\/code>\u00a0is the path to an image file located on the hard disk.<\/li>\n<\/ul>\n<p>The element <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">keystroke<\/code>\u00a0provides the key stroke of the button. It is stored in the attribute <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">key<\/code>\u00a0in the same syntax which is used by <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">xsetwacom<\/code>.<\/p>\n<p>The element <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">wheel<\/code>\u00a0contains the settings of the circle. The key of the button in the center of the circle is set with the attribute <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">button<\/code>. Again, <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">xsetwacom<\/code>\u00a0syntax is used. Independently form the profile, the wheel is setup for scrolling up and down with respect of the rotation direction.<\/p>\n<p>Each user can modify his <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">settings.xml<\/code>\u00a0file, this is, adopt the provided profiles or add new ones.<\/p>\n<p><strong>Enjoy!<\/strong><div class=\"fusion-clearfix\"><\/div><\/div><\/div><\/div><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is the second part of a Linux project to support the LEDs of the Wacom Intuos 4 tablet.<\/p>\n","protected":false},"author":2,"featured_media":335,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[8],"tags":[3],"class_list":["post-408","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howto","tag-linux"],"_links":{"self":[{"href":"https:\/\/braindump.kargulus.de\/index.php?rest_route=\/wp\/v2\/posts\/408","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/braindump.kargulus.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/braindump.kargulus.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/braindump.kargulus.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/braindump.kargulus.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=408"}],"version-history":[{"count":101,"href":"https:\/\/braindump.kargulus.de\/index.php?rest_route=\/wp\/v2\/posts\/408\/revisions"}],"predecessor-version":[{"id":4062,"href":"https:\/\/braindump.kargulus.de\/index.php?rest_route=\/wp\/v2\/posts\/408\/revisions\/4062"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/braindump.kargulus.de\/index.php?rest_route=\/wp\/v2\/media\/335"}],"wp:attachment":[{"href":"https:\/\/braindump.kargulus.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=408"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/braindump.kargulus.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=408"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/braindump.kargulus.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=408"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}