GNU | Linux

Home > Interests > GNU | Linux español

Contents (hide)

  1. 1. Old Pages
  2. 2. My Linux Box
    1. 2.1 Wireless LAN
    2. 2.2 Audio
    3. 2.3 Video
    4. 2.4 DVD Playback
    5. 2.5 The Lid Switch
  3. 3. Windows in Linux
    1. 3.1 VIrtualBox
    2. 3.2 Cedega
    3. 3.3 Wine
  4. 4. Other
    1. 4.1 Development
    2. 4.2 Internet
    3. 4.3 Multimedia
    4. 4.4 The X-Window System
    5. 4.5 KDE
    6. 4.6 Printing

http://www.geekculture.com/joyoftech

1.  Old Pages

2.  My Linux Box

2.1  Wireless LAN

The Intel® PRO/Wireless 2200BG integrated wireless card worked out of the box.

2.2  Audio

Audio worked right out of the box.

2.3  Video

In order to get hardware acceleration working you can install the package xorg-driver-fglrx using the Synaptic package manager.

2.4  DVD Playback

DVD playback works well right out of the box. DMA (necessary for good performance) seems to be already enabled.

2.5  The Lid Switch

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

3.  Windows in Linux

3.1  VIrtualBox

Download and install the Ubuntu 8.04 (“Hardy Heron”) i386 package from the VirtualBox Linux download page

3.2  Cedega

These days, game support is about the only reason why I sometimes still regress to Windows, but that is rapidly changing. Cedega is a neat piece of software that you can use to install and run Windows games under Linux. You can download it from their site after paying a US$15 registration fee which includes a 3 month period of technical support. They have a fairly large library of games supported and they tend to focus on the hottest titles. Here is what I have managed to install (that I actually like):

Games

Application Installation Status Issues Screenshot
Unreal Tournament (v4.36 Patch)
  1. Simply run the installer from CD: $ cedega Path_to_CD_Drive/Setup.exe
  2. Follow the instructions
  3. Repeat for v4.35 Patch: $ cedega Path_to_Patch/utpatch436.exe
Running smoothly None
Unreal Tournament
VisualBoy Advance (v1.7.2)
  1. Download the latest version from http://vba.ngemu.com/
  2. Unzip the downloaded file.
  3. Run: $ cedega Path_to_Files/VisualBoyAdvace.exe
Running smoothly None
VisualBoyAdvance

3.3  Wine

Does your brand new Windows system refuses to install that awesome application you loved in Windows 98? Well, I bet you can run it with Wine! Wine is an Open Source implementation of the Windows API on top of X and Linux. This means that Wine allows you to run Windows applications on Linux!

Install the wine package with Synaptic and rejoice!

4.  Other

4.1  Development

HOWTO create patches with diff

$ diff -Naur olddir newdir > new-patch

or

$ diff -Naur oldfile newfile > new-patch

4.2  Internet

Post Flash Videos Online with FFmpeg and FlowPlayer

4.3  Multimedia

Encode a Windows-Compatible Video

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. 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

4.4  The X-Window System

Add True Type Fonts as User

  1. Add the *.ttf file to $HOME/.fonts folder.
  2. Open a console and type:
$ cd $HOME/.fonts
$ fc-cache ./

´ 3. Restart the X display manager.

4.5  KDE

Open a new konqueror tab from command line

kfmclient newTab <URL> "text/html"

Record Audio from Soundcard Output

  1. Open KMix
  2. In the “Switches” tab, activate “Mix”
  3. Open a console and type:
$ arecord -f cd -t wav test.wav

´ 4. Press Ctrl+C when finished
´ 5. You can edit the resulting file with audacity

Integrate Firefox with KDE

Convert TeX files to HTML with Kile

  1. Download and install TeX4ht. Get the Fedora rpm here.
  2. Start kile
  3. Then, choose: Settings>Configure Kile>Build>New Tool. Type in TeX4ht. Click Next button, then Finish button.
  4. At the command text field, type in: mzlatex
  5. At the Options text field, type in: '%source' 'xhtml,mathml-' (with all quotes intact and there is a space between the quoted options)
  6. Click the OK button.

4.6  Printing

The Linux Printing System (CUPS)