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

Tuesday, November 27, 2012

[HOW TO] Remap Xbox 360 controller buttons in Xubuntu

On a previous article I wrote about using the Xbox 360 controller as a mouse. The --mouse option is actually a shortcut for a custom button configuration. You can map any button on the controller to any key/combination. In this article I'll layout the basics. Further information can be obtained in the references.

There are two ways of providing a custom mapping:

  1. Command line options: use ui-buttonmap to map a button and use ui-axismap to map a axis. The syntax consists of assigning a button name to a symbol.

    Example: ui-buttonmap x=XK_Tab,a=XK_Control_L+XK_a ui-axismap y2=XK_plus:XK_minus. This will map "X" as "Tab", "A" as "Super+a" and the right stick up is "+" and right stick down is "-".

  2. Configuration file: use config to provide the path for a configuration file.

    The config file has a ini format. Use the sections ui-buttonmap and ui-axismap for configuring the mappings. You can have a section xboxdrv to provide general options.

    Example:

    [xboxdrv]
    silent=true
    trigger-as-button=true
    dpad-as-button=true
    
    [ui-buttonmap]
    a=XK_Super_L+XK_a
    b=XK_b
    x=XK_e
    y=XK_Shift_L+XK_a
    

The list of buttons/axis you can map is: a, b, x, y, lb, lt, rb, rt, back, start, du, dd, dl, dr, tl, tr, x1, y1, x2 and y2. These names should be familiar to anyone who knows the controller. tl/tr is pressing the left/right stick and x1/y1 is the axis for the left stick and x2/y2 the axis for the right stick.

A full list of valid symbols can be optained with xboxdrv --help-x11keysym.

Usage

To provide the mappings directly use: xboxdrv [OPTIONS] --ui-buttonmap BTN=SYM,... -ui-axismap x1=SYM,....

To provide a file with the mappings use: xboxdrv [OPTIONS] --config FILENAME.

You can use the --alt-config and provide alternative configurations. Then you can use the Guide button to change between them. This allows to quickly change mappings without having to rerun the command with a different file. Example: xboxdrv --config first.ini --alt-config second.ini --alt-config third.ini

References

xboxdrv

Wednesday, November 21, 2012

[TIP] Open Directory In Guake from Thunar

In this article we'll see how to change the working directory in Guake terminal from Thunar's context menu.

Open Directory In Guake from Thunar

Install

Add a custom action in Thunar with the following contents:

  • Name: Open Guake Here
  • Command: guake -n NEW_TAB && guake -e "cd %f" && guake -t
  • File Pattern: *
  • Appears if selection contains: Directories

Note: This UCA has one problem; if Guake is already visible it'll will hide it. That's because of the --toggle-visibility option.

[HOW TO] Add Thunar Custom Actions

Thunar allows the user to add custom actions the the file and folder context menu (right-click).

Thunar Custom Actions

Add custom action

The easiest way is to learn by example:

  1. Open Thunar, then Edit > Configure custom actions....
  2. Enter this data:

    • Name: Add to Playlist
    • Command: gmusicbrowser -cmd AddFilesToPlaylist %F
    • File pattern: *
    • Appears if selection contains: Audio files

This will show a menu item when audio files are selected that adds them to gmusicbrowser's playlist.

Thunar's custom actions are added to the XML file: ~/.config/Thunar/uca.xml.

Check the references for more examples. In the meanwhile I'll post some of my own.

References

Custom actions

Thursday, November 15, 2012

[HOW TO] Install Guake (Quake-like terminal) in Xubuntu

Some time ago I wrote about installing Tilda in Xubuntu. Now I gave Guake a try (another terminal that slides in from the top of the screen).

Guake running on Xubuntu
Guake running on Xubuntu

There are some reasons for liking Guake better:

  • The width is set to 100% (Tilda has some problems when changing monitors).
  • The height can be adjusted with the mouse.
  • All key bindings can be customized.
  • The tab bar is quite useful and it's easy to rename tabs.

Tilda is still a good program, though, so if you're undecided give them both a try and see which suits you best.

Install

Open a terminal window and run:

sudo apt-get install guake -y

Usage

Guake can be accessed via Applications Menu > Accessories > Guake Terminal or typing the following command: guake. Guake's preferences editor can be directly accessed using the command: guake-prefs or you can right-click on Guake and select Preferences.

Tuesday, November 13, 2012

[SOLVED] Suspend causes reboot on Sony Vaio

I was using a Sony Vaio SR29VN and when I tried to resume from suspension, the laptop would reboot instead of resuming. I understand that this may affect other models, however, I don't have a list.

Luckily it's easy to fix: we need to add acpi_sleep=nonvs kernel option to the grub settings.

Fix

Edit (with root permissions) the line GRUB_CMDLINE_LINUX on the file /etc/default/grub, adding the option acpi_sleep=nonvs.

Fixing Vaio suspend problem

Then run this on the command line:

sudo update-grub2

References

suspend causes reboot

[HOW TO] Install and Integrate Dropbox with Thunar

In this article we'll see how to install Dropbox and Thunar integration in Xubuntu.

Thunar Dropbox plugin running on Xubuntu
Thunar Dropbox plugin running on Xubuntu

I've tested this procedure in Xubuntu 12.04 and Xubuntu 12.10 (32 and 64 bits). It also works for the newer version of Thunar (1.5.2 at the time of this writing).

Install

Choose one of the alternatives and run the corresponding command on a terminal window:

Alternative #1 - Install both Dropbox and Thunar plugin
cd && plat=`uname -m`; if [ $plat != "x86_64" ]; then plat="x86"; deb="i386"; else deb="amd64"; fi; wget -O - "http://www.dropbox.com/download?plat=lnx.$plat" | tar xzf - && wget -O dropbox-thunar-plugin.deb http://packages.crunchbang.org/waldorf/pool/main/thunar-dropbox-plugin_0.2.0-1_$deb.deb && sudo dpkg -i dropbox-thunar-plugin.deb && rm dropbox-thunar-plugin.deb && ~/.dropbox-dist/dropboxd 
Alternative #2 - Install only the Thunar plugin

Choose this option if you have Dropbox already installed.

cd && plat=`uname -m`; if [ $plat != "x86_64" ]; then deb="i386"; else deb="amd64"; fi; wget -O dropbox-thunar-plugin.deb http://packages.crunchbang.org/waldorf/pool/main/thunar-dropbox-plugin_0.2.0-1_$deb.deb && sudo dpkg -i dropbox-thunar-plugin.deb && rm dropbox-thunar-plugin.deb
Alternative #3 - Install only Dropbox

Choose this option if you which to install Dropbox in Xubuntu but don't care about the Thunar integration.

cd && plat=`uname -m`; if [ $plat != "x86_64" ]; then plat="x86"; fi; wget -O - "http://www.dropbox.com/download?plat=lnx.$plat" | tar xzf - && ~/.dropbox-dist/dropboxd 

Usage

After installing, Thunar must be restarted (killall Thunar && Thunar) for the plugin to work and Dropbox must be running. Also, you may want to add Dropbox to startup, see this and use /home/YOUR_USER/.dropbox-dist/dropboxd as the command (replace YOUR_USER with your username.

References

How To Install Dropbox In Xubuntu And Get Thunar Integration (Xfce)