Monday, December 12, 2011

Fix keyring for accessing Samba shares

If the Samba share that you are accessing is password protected, you'll be prompted to provide the login credentials for that share. It'll be given the choice for remembering the login information, so that it won't have to be entered every time the share is accessed.


However, for some reason every time the share was accessed share with nautilus, the login credentials were being asked persistently.
The way that I found to fix this was to remove the current keyring configuration:
$ rm ~/.gnome2/keyring

After that keyring behaved like it normally does: it prompts once for the credentials and stores them for later use if the 'Remember forever' option is selected.

Saturday, December 10, 2011

Suspend on close laptop lid [Xubuntu 11.10]

When using a laptop, the ability to suspend is a important feature because it allows to save some battery when idle and resume operation almost instantly.

To suspend when laptop lid is closed proceed as follows:
  1. Open 'Settings Manager'
  2. Select 'On AC'
  3. Select 'Suspend' from the combo-box.


Related:
Edit Xfce Settings with graphical interface

Wednesday, December 7, 2011

No tabs for Thunar

Update: Since version 1.5.1 Thunar supports multiple tabs. Here's how to install it.

If you're wondering when will Thunar support tabs, well the answer is never (see the reference bellow).

If you really want/need a file manager with tabs support for your Xubuntu, you could easily install nautilus:
$ sudo apt-get install nautilus

Nautilus will add tabs support for Xfce/Xubuntu
References:
When will thunar support tabs? (Xfce Forum)

Mouse gestures on Thunar

Mouse gestures is a way sending application commands with a pointing device (usually a mouse). This means that if some application has support for mouse gestures, you'll be able to perform some actions just by moving you mouse.

Mouse gestures are a common feature in Web Browsers. Opera has built-in support since version 5.10 (April 2001). For Firefox and Chrome support is added through extensions (FireGestures for Firefox and Smooth gestures for Chrome). There are also some projects that add support for Linux desktop (easystroke) and for Windows (Just Gestures and Strokeit)

Thunar also has support for mouse gestures (though very limited one). To use them press mouse middle button and the move your mouse in one of this directions:
  • Left - opens the previous visited folder
  • Up - opens the parent folder
  • Right - opens the next visited folder
  • Down - reload the current folder
mouse middle button and left will open the previous visited folder

References:
Thunar File Manager - FAQ
Pointing device gesture
Mouse gestures in Opera

Add support for Samba shares to Thunar [Xubuntu 11.10]

Thunar is a simple and easy to use file manager and is the default choice for Xfce.
Despite the fact the it incorporates all the main features that one would expect from a modern file manager, Thunar doesn't provide a out of the box solution for accessing remote folders (namely Samba shares).

Running the command below will add support for remote folders:
$ sudo apt-get install gvfs-backends

Accessing Samba shares with Thunar

Tuesday, December 6, 2011

Add items to Xfce Applications Menu

To add an application launcher to Xfce Applications Menu is simple; all you have to do is place the *.desktop file that launches the application in the right folder.

Create the *.desktop file
Create a text file whose extension is 'desktop', with the following content:
[Desktop Entry]
Version=1.0
Type=Application
Name=ItemName
Exec=Command
Icon=IconFile
Categories=Category;


On ItemName write the name that should be displayed on the menu. Command is the command that should be run. IconFile is the path to some *.png file. The Category dictates the sub-menu where the item will be placed. See the table bellow to see what Category value you should use.

Sub-Menu Categories
Accessories Utility
Development Development
Games Game
Graphics Graphics
Internet Network
Multimedia AudioVideo
Office Office
System System
A new item can be placed on a sub-menu by selecting the right 'Categories' value

To learn more about *.desktop files see the reference at the end of this post.

Add an item for you user only
Copy the *.desktop file to: $HOME/.local/share/applications

Add an item for all users
You'll need root privileges to do this.
Copy the *.desktop file to: /usr/share/applications

After you copy the *.desktop file the new item will be automatically added to the Applications Menu.

References:
Xubuntu : XFCE Menu Items
Customize the Xfce menu
Anatomy of a .desktop File

Friday, December 2, 2011

Pastie on Xubuntu 11.10

Pastie is a simple clipboard manager that saves history of previous copied text.
It's convenient to use a clipboard manager not only for the history list, but also because the copied text will be unavailable if the application that has the original text is closed.

Install Pastie via PPA
sudo add-apt-repository ppa:hel-sheep/pastie && sudo apt-get update
sudo apt-get install python-gnome2 pastie -y

Note: 
Pastie depends on python-gnome2 package, however this dependency it's not automatically resolved; python-gnome2 has to be installed manually.
Here's what happens if python-gnome2 is not installed:
$ pastie
Traceback (most recent call last):
  File "/usr/bin/pastie", line 30, in <module>
    import pastielib.protector as protector
  File "/usr/lib/pymodules/python2.7/pastielib/protector.py", line 31, in <module>
    import pastielib.history as history
  File "/usr/lib/pymodules/python2.7/pastielib/history.py", line 20, in <module>
    import gnomevfs
ImportError: No module named gnomevfs

Pastie's selection dialog
Pastie allows to open the clipboard history using a keyboard shortcut. The default value for that shortcut is Ctrl-Shift-C and it'll cause problems since that's the same key combination for copying text from the terminal.
My suggestion is to change it to Ctrl-Alt-H (the key combination is for accessing clipboard History, so it's easy to remember).

References:
Pastie get an Ubuntu PPA (WEB UPD8)
Pastie - Very Simple Clipboard Manager With Application Indicator Support