Friday, December 21, 2012

[TIPS] Xfce Font Settings

There are two settings related to Xfce font rendering that make fonts look better: Anti-aliasing and LCD Hinting.

From my experience with Xubuntu these two settings are set to its optimal value, so I never had any complains about the font appearance. But if you think your fonts could look better, proceed as described below.

(click on the images to see the differences)

Anti-aliasing disabled and LCD Hinting set to lcdnone

Anti-aliasing disabled and LCD Hinting set to lcdnone

Anti-aliasing enabled and LCD Hinting set to lcdnone

Anti-aliasing enabled and LCD Hinting set to lcdnone

Anti-aliasing enabled and LCD Hinting set to lcddefault

Anti-aliasing enabled and LCD Hinting set to lcddefault

Check current settings

Open a terminal window and run:

xrdb -query

Fix

If your Xft.antialias is set to "0" or Xft.lcdfilter is not "ldcdefault", run:

# Enable anti-aliasing
xfconf-query -c xsettings -p /Xft/Antialias -n -t int -s 1
# Set LCDHinting to lcddefault
xfconf-query -c xsettings -p /Xft/Lcdfilter -n -t string -s lcddefault

You should logout and in for settings take full effect.

Note:Other possible values for Lcdfilter are lcdnone, lcddefault, lcdlight and lcdlegacy.

References

Appearance [Xfce Docs]

Thursday, December 13, 2012

[HOW TO] Add options to Thunar's "Send To" menu

Thunar's "send to" menu option can be easily extended using desktop entry files. All we need is to create a new desktop file in ~/.local/share/Thunar/sendto/ for each destination. The desktop file has a MimeType field which allows you to control on which file types the "send to" option will appear. If you omit the MimeType the option will appear for all types.

Example

The example bellow is a option to send my sketches to Picasa. It appears only for PNG images and uses a shell script that I wrote and is in $PATH. You can use it as a boilerplate for your own.

# sketchupload.desktop - Send to Picasa
[Desktop Entry]
Type=Application
Version=1.0
Encoding=UTF-8
TryExec=sketchupload.sh
Exec=sketchupload.sh %F
Icon=picasa-16
Name=Send to Picasa
MimeType=image/png;

References

The "Send To" Menu

Tuesday, December 11, 2012

[HOW TO] Find which package includes a specific file

apt-file is a command that allows you to find which package includes a specific file. It can also be used to list all files included in a package without installing or downloading it.

Install

Open a terminal window and run:

sudo apt-get install apt-file -y && sudo apt-file update

The last part of the above command will update apt-file's cache, so it might take a few minutes to complete.

Usage

The updated cache can be queried for a list of packages containing a file. The query may be constructed using only the file's name or the file's path:

apt-file search filename
apt-file search path/to/filename

The contents of a package can be listed with:

apt-file list packagename

References

apt-file | manpage

Wednesday, December 5, 2012

[HOW TO] Play Encrypted DVDs on Xubuntu

If you try to play an encrypted DVD on Xubuntu (most likely using the default player, Parole) you'll get an error message:

Playing Encrypted DVDs on Xubuntu

To play encrypted DVDs, we need the libdvdcss2 package. Here's how to install it in Xubuntu.

Install

Open a terminal window. First we need to enable Medibuntu repository:

sudo wget --output-document=/etc/apt/sources.list.d/medibuntu.list http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list && sudo apt-get --quiet update && sudo apt-get --yes --quiet --allow-unauthenticated install medibuntu-keyring && sudo apt-get --quiet update

Then we install libdvdcss2:

sudo apt-get install libdvdcss2 -y

That's it! You can now play encrypted DVDs on Xubuntu.

References

Medibuntu

Tuesday, December 4, 2012

[HOW TO] Install Exaile in Xubuntu

Exaile is a music manager and player for GTK+ written in Python. It incorporates automatic fetching of album art, lyrics fetching, Last.fm scrobbling, support for many portable media players, internet radio such as shoutcast, and tabbed playlists.

Here's how to install it in Xubuntu using two methods: from Ubuntu repositories and from source. The version in the repositories is always a little behind so to get the latest version choose the source method. The highlights of the newer versions are described on Exaile's website.

Exaile Running on Xubuntu
Exaile Running on Xubuntu

Install from Ubuntu Repositories

Open a terminal window and run:

sudo apt-get install exaile python-mmkeys -y

Note: The command above also installs python-mmkeys. This package is needed to activate the "XKeys" plugin (support for keyboard multimedia keys). You'll get this error otherwise:

mmkeys.so is not available

Install from Source

Navigate to Exaile's download page and grab the source tarball. It should look something like this: exaile*.tar.gz.

Extract the tarball somewhere and open a terminal on that directory, then run this command:

sudo apt-get install python-mutagen python-mmkeys -y && make && sudo make install

Usage

Exaile can be accessed via Applications Menu > Multimedia > Exaile or typing the following command: exaile.

Install Sound Indicator Integration

Open a terminal window and run:

cd && mkdir -p ~/.local/share/exaile/plugins/ && wget -O esi.zip http://goo.gl/PZFyC && unzip esi.zip -d ~/.local/share/exaile/plugins/ && rm esi.zip

Now, run Exaile and enable the "Sound Menu Indicator" plugin (Edit > Preferences > Plugins).

Exaile Sound Menu Indicator
Exaile Sound Menu Indicator

Enable Multimedia Keys Support

If you wish to use keyboard multimedia keys (pause, next, stop, ...) with Exaile, enable the "XKeys" plugin (Edit > Preferences > Plugins).

References

Exaile-Soundmenu-Indicator

Sunday, December 2, 2012

[SOLVED] Plank doesn't change theme

Switching Plank's theme it's easy: replace dock.theme and hover.theme in ~/.config/plank/theme. Plank should reflect instantly the changes. However there's a problem: Plank ignores some themes and uses the default one. Well, this happens because the newer version of Plank uses a different notation.

Plank using the Gingerbread theme
Plank using the Gingerbread theme

Fix

Open dock.theme and hover.theme on a text editor and paste the contents of the files from the new theme into the existing ones. Now find the words PlankDrawingThemeRenderer and PlankDrawingDockThemeRenderer and remove the sub-string Renderer. Don't forget to save.

And that's it! Plank should now apply the new theme. By the way, new themes can be found here.

Wednesday, November 28, 2012

[HOW TO] Install Plank dock in Xubuntu

Plank is a lightweight dock that provides simple functionality: launch applications and alternate between running applications. Here's how to install it in Xubuntu via PPA.

Install

Open a terminal window and run:

sudo add-apt-repository ppa:ricotz/docky -y && sudo apt-get update && sudo apt-get install plank -y

Usage

Plank can be accessed via Applications Menu > Accessories > Plank or typing the following command: plank.

Configure

Plank doesn't have a graphical configuration interface, you need to edit the text file: ~/.config/plank/dock1/settings. The configuration file has comments that explain how to configure it.

Add launchers to Plank

Right-click on a running application and select "Keep in dock".

Remove launchers from Plank

Drag-and-drop the launcher outside plank.

References

Plank – The Most Lightweight Dock For Ubuntu
Plank: Introduction