Mon premier ebuild !

Pendant toutes ces années d'utilisation de Gentoo, j'ai enfin voulu rendre quelque chose à la communauté. Ainsi, ma contribution était sous la forme de mon tout premier ebuild, pour une police de caractères que j'aime beaucoup, à savoir Gohufont.

Cet ebuild est maintenant disponible dans l'overlay sunrise, dont je tiens à remercier les développeurs pour leur soutien (et à Gohu pour avoir fait une police que j'utilise maintenant depuis au moins deux ans). Enfin, en guise de trophée, cette screenshot :

Sortie de eix gohufont

Et si ça finit un jour dans l'arbre portage officiel, je vomirai des arcs-en-ciel.

Posté par x0r à 0 commentaire • Tags : linux gentoo gohufont sunrise ebuild

Wacom Bamboo Pen & Touch on Gentoo Linux (part 2)

As promised, I'll give you a little follow-up on the custom scripts I've written to make my Wacom tablet work on Gentoo.

The biggest issue I had was pretty much anything with respect to aspect ratio. For instance, I have a ThinkPad with a 1024×768 screen, but the tablet is designed for 16:10 screens.

Checking for correct aspect ratio

The test is simple: grab a coin, fire up GIMP and trace the coin. If you don't get a circle, that means the aspect ratio of the tablet is off, and therefore your drawings will be stretched.

Fixing aspect ratio

Two commands are enough:

xsetwacom set "Wacom Bamboo 16FG 4x5 Pen stylus" "Area" "0 0 12266 9200"
xsetwacom set "Wacom Bamboo 16FG 4x5 Pen eraser" "Area" "0 0 12266 9200"

This will set the active area of the tablet. Its active area is 14720×9200 units, so you can "clip off" a little bit of the tablet's active area in order to preserve your aspect ratio. For more info, this page has some more useful resources.

The big picture

Here's the contents of my ~/myscripts/wacom_init.sh (which I run manually when I hotplug my Wacom tablet):

#!/bin/sh

# Wacom settings: eraser and pen aspect ratio and softer pressure curve
xsetwacom set "Wacom Bamboo 16FG 4x5 Pen stylus" "Area" "0 0 12266 9200"
xsetwacom set "Wacom Bamboo 16FG 4x5 Pen eraser" "Area" "0 0 12266 9200"
xsetwacom set "Wacom Bamboo 16FG 4x5 Pen stylus" "PressureCurve" "0 50 50 100"
xsetwacom set "Wacom Bamboo 16FG 4x5 Pen eraser" "PressureCurve" "0 50 50 100"

# Wacom keys
xsetwacom set "Wacom Bamboo 16FG 4x5 Finger pad" Button 9 "key shift key plus"
xsetwacom set "Wacom Bamboo 16FG 4x5 Finger pad" Button 8 "key shift key minus"

Have fun!

Posté par x0r à 0 commentaire • Tags : linux gentoo wacom x11

Un chipmunk sauvage apparaît !

Dans la série "Je me suis fait troller par Skype", voici la dernière :

J'ai appelé mon contact tout à l'heure. Mais lorsque j'ai dit "allô", il a répondu en éclatant de rire. "T'as une voix de chipmunk", m'a-t-il dit.

Après avoir testé plein de fois avec le fameux service echo123, et après qu'il a bien pu se payer ma tête comme il se doit, j'ai fini par comprendre que quelque chose ne tournait effectivement pas rond depuis que j'étais passé sur le kernel 3.0.6 sur mon ThinkPad.

En googlant un peu, j'ai finalement trouvé le patch suivant :

--- linux-3.0.1/drivers/usb/core/quirks.c    2011-08-05 06:59:21.000000000 +0200
+++ linux-3.0.1/drivers/usb/core/quirks_c310.c    2011-08-07 19:17:28.673002728 +0200
@@ -41,6 +41,9 @@
    /* Logitech Harmony 700-series */
    { USB_DEVICE(0x046d, 0xc122), .driver_info = USB_QUIRK_DELAY_INIT },

+   /* Logitech Webcam C310 */
+   { USB_DEVICE(0x046d, 0x081b), .driver_info = USB_QUIRK_RESET_RESUME },
+
    /* Philips PSC805 audio device */
    { USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME },

Attention : l'outil patch est assez tâtillon sur le whitespace, donc prenez plutôt le patch ici (chipmunk.patch). Celui-ci est évidemment à adapter selon l'ID vendeur/produit (ici 0x046d et 0x081b) de la webcam en question. Ce qu'on trouve en général assez facilement avec lsusb :

# lsusb | grep -i webcam
Bus 001 Device 011: ID 046d:081b Logitech, Inc. Webcam C310

Une fois sauvegardé dans un fichier, il m'a suffit de faire :

# cd /usr/src/linux
# patch -p1 ~/chipmunk.patch
# make -j3

Et hop.

Posté par x0r à 0 commentaire • Tags : linux patch bug skype webcam

Wacom Bamboo Pen & Touch on Gentoo Linux

I've been considering buying a Wacom tablet for quite a while, as they make quite a few things easier, especially with photo editing. I've just had mine for a couple days, and have been using it for quite some time lately.

Wacom Pen & Touch

Now, making it work on Gentoo was a bit of a daunting task, but I've managed to make it work on my travel machine, as well as my desktop, both on Gentoo Linux but with different specifics.

I've been following the tutorial, but some things just didn't work, and some Google-fu mostly helped me out figuring out a consistent way to get such a tablet to work.

Compiling the X11 driver

First, edit /etc/make.conf, and make sure you add wacom to your INPUT_DEVICES variable, like so:

INPUT_DEVICES="evdev synaptics wacom"

Then do emerge -1va x11-base/xorg-drivers.

Compiling the kernel driver

The tablet being relatively new as of December 2011, the in-kernel driver just wouldn't pick it up. Fortunately there was another option: grabbing the input-wacom sources (and be sure to use the bamboo3 branch) and compiling those. Do a git clone or whatever you want to obtain the sources, and once you have the source tree, just do ./autogen.sh. The output looks like this:

Your wacom.ko is available under 
    /home/x0r/src/cbagwell-input-wacom-eacac38/2.6.38
If you have an USB device, you can copy the driver by:
    cp 2.6.38/wacom.ko /lib/modules/3.0.6-gentoo/kernel/drivers/input/tablet
If you have a serial device, please copy the driver by:
    cp 2.6.38/wacom_w8001.ko /lib/modules/3.0.6-gentoo/kernel/drivers/input/touchscreen

NOTE: The kernel drivers included in this package are only
tested with the X Wacom driver built from xf86-input-wacom.
 If you are running an X server version older than 1.7, 
please use the drivers provided by linuxwacom package.

Just copy the right .ko file to the right location, then do depmod -ae, and plug in your tablet. If you're getting a response, then congratulations.

X11 configuration

However, even after restarting X, I have noticed that the Synaptics driver was intercepting my tablet, something you obviously don't want. Therefore, my xorg.conf.d looks like this:

35-wacom.conf

Section "InputClass"
    Identifier "Wacom Class"
    MatchProduct "Wacom|WACOM"
    MatchDevicePath "/dev/input/event*"
    Driver "wacom"
EndSection

40-mouse.conf

Section "InputDevice"
    Identifier "Mouse0"
    Driver  "synaptics"
    Option  "Device" "/dev/input/by-path/platform-i8042-serio-1-event-mouse"
    Option  "GrabDevice" "False"
EndSection

Section "InputDevice"
    Identifier "Mouse1"
    Driver  "evdev"
    Option  "Device" "/dev/input/by-path/pci-0000:00:1a.1-usb-0:1:1.0-event-mouse"
    Option "GrabDevice" "False"
EndSection

50-evdev.conf

# Catch-all evdev loader for udev-based systems
# We don't simply match on any device since that also adds accelerometers
# and other devices that we don't really want to use. The list below
# matches everything but joysticks.

Section "InputClass"
        Identifier "evdev pointer catchall"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
EndSection

Section "InputClass"
        Identifier "evdev keyboard catchall"
        MatchIsKeyboard "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
EndSection

#Section "InputClass"
#        Identifier "evdev tablet catchall"
#        MatchIsTablet "on"
#        MatchDevicePath "/dev/input/event*"
#        Driver "evdev"
#EndSection

#Section "InputClass"
#        Identifier "evdev touchscreen catchall"
#        MatchIsTouchscreen "on"
#        MatchDevicePath "/dev/input/event*"
#        Driver "evdev"
#EndSection

You'll notice that I've commented the two last sections in 50-evdev.conf. Actually, these were the ones that were causing me trouble.

Some hacks to make it work on my setup

Learn more about these in part 2.

Posté par x0r à 1 commentaire • Tags : linux gentoo wacom x11