GNU | Linux

Activate spelling check in OpenOffice 2.4

Posted in GNU | Linux, HowTo, Open Source on November 7th, 2008 by Jorge – 3 Comments

For some weird reason, activating the spellcheck on OpenOffice 2.4 seems to be more challenging than it should, and since I just got it working in Ubuntu Hardy Heron, I thougth I should post the solution here:

  1. Go to Tools > Options…

    Openoffice tools menu with options entry highlighted

    OpenOffice tools menu with options entry highlighted

  2. Select Language Settings > Writing Aids and click on the Edit… button

    Writing aids dialogue with edit button highlighted

    Writing aids dialogue with edit button highlighted

  3. Check the boxes for the Spelling and Thresaurus modules. This will enable the spellcheck for the language in the Language field, so you should repeat this process with each of the languages you want to use.

    Language module editing dialogue with spelling and thesaurus entries highlighted

    Language module editing dialogue with spelling and thesaurus entries highlighted

  4. You should now see the spellcheck symbol beside your chosen language in the language settings dialogue at Tools > Options… > Language Settings > Language. Enjoy!

    Language settings dialogue with spellcheck symbol highlighted

    Language settings dialogue with spellcheck symbol highlighted

Encode a windows-compatible video

Posted in GNU | Linux, HowTo, Open Source on November 7th, 2008 by Jorge – Be the first to comment

There are a lot of constantly updated video and audio codecs available in Linux. Unfortunately, the choice in Windows is way more limited. Because of this, it is common that videos compressed with the best and latests codecs in Linux cannot be read by common Windows applications. Luckily, You can encode windows-compatible videos in Linux with mencoder by typing the following command:

$ mencoder -oac mp3lame -ovc lavc -lavcopts \
vcodec=msmpeg4v2:vhq:vbitrate=1600 -o videoout.avi videoin.xxx

The Dell D610 lid switch on Ubuntu 8.04

Posted in GNU | Linux, HowTo, Open Source on October 7th, 2008 by Jorge – Be the first to comment

The lid switch makes the laptop’s screen turn off when the lid is closed and turns it back on when the lid opens. This already worked well in Ubuntu but I needed to tweak the behavior a bit. Sometimes I use a projector as the main display and turn off the laptop’s screen to save some battery, however, Ubuntu turns off ALL displays (including the analog output) when the panel lid is closed, which then leaves me with no screen at all!

How it Works

You can determine the state of the lid switch by doing:

$ cat /proc/acpi/button/lid/LID/state

In order to turn on/off the backlight of the LCD panel, you can use radeontool. This tool is part of the Ubuntu distribution so you can install it with Synaptic (if it is not already installed). After installing both, the laptop-mode-tools (also part of Ubuntu) and radeontool packages, I created the following script:

#!/bin/bash

LIGHT=$(radeontool light | grep "looks on")

if [ "$LIGHT" = "" ]; then
        radeontool light on
else
        radeontool light off
fi

This script toggles on/off the backlight of the LCD panel. You can then use xbindkeys to assign a keyboard shortcut and control the LCD backlight at will.

Tweaking the Lid Switch Behavior

In order to set and maintain the state of the backlight when the lid is closed, you can create a daemon and call it with laptop-mode-tools. This is specially handy if some of your applications (usually games) like to turn the panel backlight back on when resetting the video resolution or when going into full screen.

Step 1

Comment everything on /etc/acpi/lid.sh and add the following at the end of the script:

LID_CLOSED=$(cat /proc/acpi/button/lid/LID/state | grep open)
if [ "$LID_CLOSED" = "" ]; then
  /usr/sbin/blightoffd &
else
  /usr/sbin/radeontool light on
fi

Step 2

Save the following script as /usr/sbin/blightoffd

#!/bin/bash

#
# Keeps panel backlight off when computer lid is closed.
#

LID_CLOSED=$(cat /proc/acpi/button/lid/LID/state | grep open)

while [ "$LID_CLOSED" = "" ]; do

  LIGHT_ON=$(/usr/sbin/radeontool light | grep "looks off")
  if [ "$LIGHT_ON" = "" ]; then
    /usr/sbin/radeontool light off
  fi
  sleep 1
  LID_CLOSED=$(cat /proc/acpi/button/lid/LID/state | grep open)

done

Step 3

Disable or uninstall both kpowersave and klaptop.

Making it all work with powersave

I installed powersaved which is great tool for enabling dynamic control of the CPU speed and save additional power. However, that bugger messed up the scripts controlling the lid switch events. Here is how to fix the problem:

Find the following line in /etc/powersave/events:

EVENT_BUTTON_LID_CLOSED="xxxxxxx"

and make sure it says:

EVENT_BUTTON_LID_CLOSED="ignore"

This will make powersave ignore lid switch events

HOWTO create patches with diff

Posted in GNU | Linux, HowTo, Open Source on January 9th, 2008 by Jorge – Be the first to comment

For directories:

$ diff -Naur olddir newdir > new-patch

For files:

$ diff -Naur oldfile newfile > new-patch