20dec11
DEBIAN, CRUNCHBANG






Default Apps

With openbox as window manager and no desktop environment it is sometimes a bit annoying to set default programs. That's how to do it:


GUI:


Install:
sudo apt-get install galternatives

Screenshot:

The nice buttons on the upper left corner did nothing at all but the program was usable nevertheless.


Terminal:

Set a default program:
update-alternatives --set editor /usr/bin/vim

List available programs:
update-alternatives --list x-www-browser

Add available programs:
update-alternatives --install /usr/bin/x-mail-client x-mail-client /usr/bin/thunderbird 10
That works too (if a program is not installed but in /opt):
sudo update-alternatives --install /usr/bin/x-mail-client x-mail-client /opt/thunderbird/thunderbird 200
sudo update-alternatives --install /usr/bin/x-www-browser x-www-browser /opt/firefox9/firefox 200

The number at the end of the line is the priority (low priorities might be overwritten).

You might want to consider to add an executable file in /usr/bin with this content (for programs in /opt) - filename e.g.: firefox9:
#!/bin/sh
exec /opt/firefox9/firefox "$@"



Another way to set default applications (also mentioned in the CrunchBang Customizations articel):


1. Install the package libfile-mimeinfo-perl.

2. In a terminal, invoke the mimeopen command like this:

mimeopen -d /path/to/file

E.g. you want VLC to open .mkv-files. Type:

mimeopen -d /path/to/my.mkv-file

Then select VLC from the appearing list. Done!