Wednesday, October 19, 2011 SVG Import/Export

I posted some SVG Import/Export comments on recently. The export procedure first featured on Wikipedia SVG Help.

Importing SVG files into

The only solution I have found to properly import svg files into 3 is to download and execute the standalone 2.0 SVG Import Filter from

java -jar svg2office-1.2.2.jar <some-file.svg>

Exporting SVG files

Exported svg files may require manual modification before successfully being used elsewhere (e.g. uploaded to wikipedia). To achieve this;
  • change all fonts types to supported fonts (E.g. change "Sans embedded" to "DejaVu Sans")
  • add "px" to all font-size references (E.g. change "font-size:100" to "font-size:100px")
  • remove all additional x coordinate references in tspans (E.g. change <tspan x="17583 17917 " y="10943"> to <tspan x="17583" y="10943">)
  • [Not required for OO 2.3.0:] explicitly colour all text (E.g. black) by replacing relevant "stroke:none;fill:none" instances with "stroke:none;fill:rgb(0,0,0)" (note that simply explicitly colouring text black in openoffice 3.2.1 does not appear to work)
NB vector graphics line widths may also need to be set explicitly in Draw.

SVG code replacement guide (executing replace all using Nedit regular expressions):

Original Text Replacement Text
Sans embedded DejaVu Sans
font-size:([0-9]*); font-size:\1px;
tspan x="([0-9]*) ([0-9 ]*)" tspan x="\1"
<g style="stroke:none;fill:none"><text> <g style="stroke:none;fill:rgb(0,0,0)"><text>

This svg export procedure has been tested using OO 2.3.0 and OO 3.2.1 with a simple .odg candidate.

Planner task Predecessors on EL6

Planner is currently unusable on EL6 due to a break in task Predecessors. Note the bugzilla report. (Feedback from Red Hat indicates a fix might be arriving soon on a new release).

Compiz Fusion Install on EL6

Here is some basic documentation for compiz-fusion on EL6 that wasn't immediately obvious (posted on;

A. To install compiz fusion;
1. install epel-release (rpm -i epel-release-6-5.noarch.rpm)
2. yum install compiz-fusion-extras compiz-plugins-main compiz-manager compiz-fusion-extras libcompizconfig compiz-plugins-main-gconf ccsm compiz-gnome compiz-gtk compiz-fusion-extras-gnome fusion-icon

(rpm -i ccsm-0.8.2-5.el6.noarch.rpm compizconfig-python-0.8.2-3.el6.x86_64.rpm compiz-fusion-0.8.2-8.el6.x86_64.rpm compiz-fusion-extras-0.8.2-6.el6.x86_64.rpm compiz-fusion-extras-gnome-0.8.2-6.el6.x86_64.rpm compiz-manager-0.6.0-11.el6.noarch.rpm fusion-icon-0.1.0-0.9.5e2dc9git.el6.noarch.rpm fusion-icon-qt-0.1.0-0.9.5e2dc9git.el6.noarch.rpm libcompizconfig-0.8.2-9.el6.x86_64.rpm
[Dependencies may include; libsexy-0.1.11-13.el6.x86_64.rpm protobuf-2.3.0-7.el6.x86_64.rpm PyQt4-4.6.2-8.el6.x86_64.rpm python-sexy-0.1.9-9.1.el6.x86_64.rpm sip-4.9.3-1.el6.x86_64.rpm etc])

B. To enable compiz-fusion;
1. System - Preferences - desktop effects - compiz
2. Applications - System Tools - Compiz Fusion Icon

C. To use compiz-fusion;
1. Right click on Blue CompizFusion icon - Settings Manager
2. Make changes
3. Right click on Blue CompizFusion icon - Reload Windows Manager

D. To load compiz-fusion on startup;
1. System - Preferences - Startup Applications - Add
2. enter "fusion-icon" in command box, then press 'Add'

For reference, "ccsm" is the compiz fusion settings manager (System - Preferences - CompizConfig Settings Manager), and "fusion-icon" is the compiz fusion initialiser / system tray icon

NB To install compiz fusion optimised themes (?);
yum install emerald-themes emerald
(emerald-0.8.2-3.el6.x86_64.rpm emerald-themes-0.5.2-5.el6.noarch.rpm)

How To Reinstall Grub Boot Loader (EL5 and EL6)

Here are some extracts from on how to reinstall the Grub Boot Loader (EL5 and EL6) which were recently updated. Note these instructions appear to be published now by Red Hat.

How to Reinstall EL5/EL6 Grub Boot Loader
(Eg this is required if a Windows reinstallation overwrote/disabled your Linux boot partition)

***disclaimer; advice offered with no warranty***

1. Insert EL5/EL6 DVD
2. Reboot PC
3. type 'linux rescue' when prompted
4. Accept standard options (Eg English)
5. If necessary, select your Linux partition used during the original EL5/EL6 installation when Grub was originally installed (Eg 'sda')
6. when prompted, select allow write access (ie, NOT read only)
7. type 'chroot /mnt/sysimage' (as suggested by linux rescue)
8. type '/sbin/grub-install /dev/sda' (assuming you wish to use the Primary boot sector of 'sda' - you will wish to use this if you installed it here during the original EL5/EL6 installation. Type the command '/sbin/fdisk -l' to determine where you installed Linux)
9. restart PC
10. Grub should load, and your previous grub settings (before you reinstalled Windows) should have remained


I would not recommend using the Windows Boot Manager to start anything other than Windows. I personally install Grub as my primary boot manger (on the primary boot sector).

Ideally, Windows is installed first, and then Linux (eg EL5/EL6) is installed (with grub) - which generally overwrites the Windows boot sequence. Grub automatically detects the Windows partition and adds to grub.conf the necessary command to load it.

However, if Windows is installed after Linux, grub can be extended to load the windows partition (eg XP, Win7) by manually adding the necessary command to grub.conf.

Added are some examples of grub.conf windows boot commands below. "PARTITIONINDEX" in these examples should be set to the partition index of Windows. This should generally be "0" if Windows was installed first*. You should use the command "/sbin/fdisk -l" (referenced by ppesci) to determine/confirm the partition index of Windows (or the Windows Boot Manager). Note, there is no blank line between the line "title..." and the line "root...".

title Windows XP

chainloader +1

title Windows 7

rootnoverify (hd0,PARTITIONINDEX)
chainloader +1

* Note again; you shouldn't have to modify grub.conf at all if Windows was installed before Linux. However exceptions do exist. An example of an exception would be if you RE-installed Windows and Windows changed the partition in which it needed to initialise its boot sequence/manager. These things happen, from experience - particularly on laptops with pre-installed copies of Windows.

Tuesday, October 11, 2011

Mouse button customisation instructions for Linux (EL6) with MX620 Cordless Laser Mouse

I have added mouse button customisation instructions for Linux (EL6) with MX620 Cordless Laser Mouse to the Logitech forums. These assume the user wishes to map BackSpace and Return to buttons 8 and 9, and the Search button to Firefox. NB the horizontal scroll wheel should be enabled by default on current distributions, but this method can be used to explicitly map it if necessary.

[The following step is neither required nor recommended for current Linux distributions]
1. determine usb-Logitech_USB_Receiver-event-mouse event# (eg event8):
ls -lh /dev/input/by-id/
    e.g. output;
    lrwxrwxrwx. 1 root root  9 Oct 12 09:01 usb-Logitech_USB_Receiver-event-if01 -> ../event9
    lrwxrwxrwx. 1 root root  9 Oct 12 09:01 usb-Logitech_USB_Receiver-event-mouse -> ../event8
    lrwxrwxrwx. 1 root root  9 Oct 12 09:01 usb-Logitech_USB_Receiver-mouse -> ../mouse2
    lrwxrwxrwx. 1 root root 10 Oct 12 09:01 usb-Sonix_Technology_Co.__Ltd._USB_2.0_Camera-event-if00 -> ../event10

2. install xorg-x11-drv-evdev:
yum install xorg-x11-drv-evdev [rpm -i xorg-x11-drv-evdev-2.3.2-8.el6.x86_64.rpm]
{Ubuntu: sudo apt-get install xserver-xorg-input-evdev}

[The following step is neither required nor recommended for current Linux distributions]
3. update xorg.conf:
su root
nedit /etc/X11/xorg.conf

Section "ServerLayout"  [add the following of text;]
    InputDevice "Logitech MX620"

Section "Module"  [add the following line of text;]
    load "evdev"
[add the following lines of text {NB event#};]  
Section "InputDevice"
    Identifier "Logitech MX620"
    Driver "evdev"
    Option "CorePointer"
    Option "Device" "/dev/input/by-id/usb-Logitech_USB_Receiver-event-mouse"
    #Option "Device" "/dev/input/event8"
    Option "Resolution" "800"
    Option "RelHWHEELMapTo" "Buttons 7 6"

4. install key executer software: choose either 4a) or 4b) or 4c) {RECOMMENDED};

4a) install xvkbd:
su root
yum install Xaw3d [rpm -i Xaw3d-1.5E-15.1.el6.x86_64.rpm]
rpm -i xvkbd-2.8-1.el4.rf.x86_64.rpm [download xvkbd from]
{Ubuntu: sudo apt-get install xvkbd}
xvkbd -xsendevent -text "\b"
xvkbd -xsendevent -text "\r"
        \b - Backspace
        \r - Return
4b) install xsendkeycode:
download xsendkeycode.c from /
yum install libXtst-devel [rpm -i libXtst-devel-]
gcc -o xsendkeycode xsendkeycode.c -lX11 -lXtst
    Eg1 ./xsendkeycode 38 1; ./xsendkeycode 38 0;
    Eg2 ./xsendkeycode 50 1; ./xsendkeycode 38 1; ./xsendkeycode 38 0; ./xsendkeycode 50 0;

4c) install xsendkey {RECOMMENDED}:
yum install libXtst-devel [rpm -i libXtst-devel-]
download xsendkey from
gcc -o xsendkey -lX11 -lXtst xsendkey.c
./xsendkey BackSpace  
./xsendkey Return
   [see keysyms in keysymdef.h]
su root
cp xsendkey /usr/bin/

5. install xbindkeys:
su root
rpm -i rpmforge-release
yum install xbindkeys [rpm -i guile-1.8.7-4.el6.x86_64.rpm xbindkeys-1.8.2-1.el6.rf.x86_64.rpm]
rpm -e rpmforge-release
{Ubuntu: sudo apt-get install xbindkeys}

[The following step is neither required nor recommended for current Linux distributions]
6. create a new rule file for udev with the following command:
su root
cd /etc/udev/rules.d
nedit 19-local.rules &
add the following;
    KERNEL=="hiddev*", NAME="%k", MODE="666"
    KERNEL=="event*", SYSFS{../name}=="Logitech USB Receiver", NAME="input/mx620"

7. create the xbindkeys bind file (see for more info and example configuration files):
   NB  You can see a default file with the --defaults option or create a default $HOME/.xbindkeysrc with
    'xbindkeys --defaults > $HOME/.xbindkeysrc'
    To find out a keyboard button is called, use xbindkeys -k
    To find out what a mouse button is called, you can use xev.
        button 1; left  
        button 2; middle
        button 3; right
        button 4; up scroll
        button 5; down scroll
        button 6; left scroll
        button 7; right scroll
        button 8; back
        button 9; forward      
su user
nedit ~/.xbindkeysrc
add the following;

"xsendkey BackSpace"
m:0x0 + b:8

"xsendkey Return"
m:0x0 + b:9

[The above assumes 4c). If 4a) then use the commands "xvkbd -xsendevent -text "\b"" and "xvkbd -xsendevent -text "\r"" instead]

8. Autostart xbindkeys;
System - Preferences - Startup Applications - Add;
    Name: xbindkeys
    Command: /usr/bin/xbindkeys
{Ubuntu: System > Preferences > Sessions. Select the Startup Programs tab. Add: /usr/bin/xbindkeys}

9. To configure the mouse Search Button;
(NB the Logitech mouse search button is special in that it actually acts like the keyboard search button XF86Search).
System - Preferences - Keyboard Shortcuts
Disable the current keyboard shortcut mapped to XF86Search (e.g. "Search")
    Select "Search" and press the Backspace key (this should disable it)
Either a) Create a new keyboard shortcut mapped to XF86Search (e.g. "CustomSearchButton")
    Press "Add",
    enter name e.g. "CustomSearchButton"
    enter command e.g. "firefox -new-window"
    press close
    map XF86Search to this new shortcut definition by pressing the Search button on the mouse.
Or b) assign XF86Search to an existing function (eg 'Close Window')


NB For Ubuntu specifically, you could try btnx:

(How to Customize Extra Mouse Buttons in Linux)

sudo apt-get install btnx
Applications > System Tools > btnx

Tuesday, August 23, 2011

ASUS Laptop Audio Jack Fix for Linux - ALSA Configuration

Update: This fix is not required with a current Linux kernel: use GUI instead; e.g - Sound Preferences - Output - Connector - Analog Headphones/Speakers.

I have created a program to automatically apply a correction to the ASUS A42J (or equivalent) Audio Jack detection for Linux Systems (EL5/EL6) - It is designed to be manually executed on start-up (root privileges required), and instructions are provided in Install.txt. Alternatively the ASUS-A42J_soundfix.bat script can be made to execute upon system boot (where the exact configuration is distribution dependent).

Some additional information is provided here;

1. to manually configure ALSA hda_analyzer:
(based on
wget -O
su root
python OR python
Node[0x14] PIN -> Val[0] + Val[1] -> mute
Node[0x1a] PIN -> Connection List -> Audio Mixer [0x0c]

2. to modify ALSA hda_analyzer code for arbitrary problem:
(based on

Note if you are interested in creating a replicant of this software program for an entirely different problem (say ALSA configuration fix on another brand of laptop), you might be interested to know exactly what is the difference between the python code here and that of the original hda_analyzer source. The best way to achieve this is to perform a diff of the modified source code here and the version of hda_analyzer used to create this mod (2010).

< --- >
< --- > kaartteller=0 #Modification made here
> codecteller=0 #Modification made here
> nodeteller=0 #Modification made here
> kaartteller=kaartteller+1 #Modification made here
> codecteller=codecteller+1 #Modification made here
> nodeteller=nodeteller+1 #Modification made here
> #Modification made here;
> if kaartteller == 1 and codecteller == 1 and nodeteller == 19: #Node[0x14] PIN
> node.amp_vals_out.set_mute(0, True) #Val[0] set to Mute
> node.amp_vals_out.set_mute(1, True) #Val[1] set to Mute
> if kaartteller == 1 and codecteller == 1 and nodeteller == 25: #Node[0x1a] PIN
> node.set_active_connection(int(0)) #Audio Mixer [0x0c]


< gtk.main() --- > #gtk.main()

Friday, January 14, 2011

Linux File Management (PCman versus Nautilus)

The PCman File Manager (like Thunar) is another fast alternative to Nautilus. I have updated the PCman version 0.5 source code with a similar set of "Traditional Preferences";
  • Location Bar on Separate Line
  • Show Full Path on Title Bar
  • Remove Low Priority Toolbar icons (Refresh - F5, New Tab - Ctrl-T, Open Side Pane) - disabled by default
  • Remove Low Priority Columns (Permissions, owner etc)
I have uploaded the source code and the PCmanfm 0.5 patch.