felipec’s installation notes

I regularly get rid of my home directory in order to prune my configuration, get rid of cruft, and backup important stuff. Here I’ll try to share the important steps to get a decent linux system configuration from scratch. Some of these are specific to GNOME, and some to Fedora, but mostly are generic.

root permissions

I hate to type the root password so I add my user to the ‘wheel‘ group and edit ‘/etc/sudoers‘ to add:
%wheel ALL=(ALL) NOPASSWD: ALL

So I just need to type ‘sudo -i‘ and I log-in as root (no password).

openbox

The first thing to do is to get rid of that annoying metacity. I choose openbox because the defaults work fine, and it doesn’t need anything special, just install it, and re-login with “GNOME/openbox”; voilà.

Now you have a decent window manager that resizes windows with alt + right button. And also you can configure it in many ways.

However, if you decide to stay with metacity, this makes it slightly more usable:
gconftool-2 --set --type bool /apps/metacity/general/resize_with_right_button true

Update: I found XFCE to be much superior to GNOME, and the WM works as expected by default.

keyboard settings

The next annoying thing is the keyboard settings; I find the repeat rate too slow:
gconftool-2 --set --type int /desktop/gnome/peripherals/keyboard/rate 98
gconftool-2 --set --type int /desktop/gnome/peripherals/keyboard/delay 242

zsh

I find bash too conservative; zsh provides many more options and extensibility, so install the ‘zsh‘ package, copy ‘/etc/skel/.zshrc‘ to your home, and then as root:

usermod -s /bin/zsh <user_name>

However, the defaults don’t play well with gnome-terminal; each console will show “Terminal” instead of the cwd, so edit ‘~/.zshrc‘:

case $TERM in
    xterm*)
        precmd () { print -Pn "\e]0;%n@%m: %~\a" }
        ;;
esac

Unfortunately, zsh doesn’t use readline’s inputrc, but it’s easy to convert:

bindkey -e
bindkey "\e[1~" beginning-of-line
bindkey "\e[4~" end-of-line
bindkey "\e[5~" history-search-backward
bindkey "\e[6~" history-search-forward
bindkey "\e[3~" delete-char
bindkey "\e[2~" quoted-insert
bindkey "\e[5C" forward-word
bindkey "\e[5D" backward-word
bindkey "\e[1;5C" forward-word
bindkey "\e[1;5D" backward-word

# for rxvt
bindkey "\e[8~" end-of-line
bindkey "\eOc" forward-word
bindkey "\eOd" backward-word

# for non RH/Debian xterm, can't hurt for RH/DEbian xterm
bindkey "\eOH" beginning-of-line
bindkey "\eOF" end-of-line

# for freebsd console
bindkey "\e[H" beginning-of-line
bindkey "\e[F" end-of-line

After doing these changes, re-login.

Certain settings are not specific to zsh and can be shared with bash, for that I use ‘~/.profile‘, which I manually include on ‘~/.bash_profile (not needed on ‘~/.zprofile‘):, and link ‘~/.zprofile‘ to it.

test -r ~/.profile && . ~/.profile

history-search

I avoid typing as much as possible, and quite often what I want to do is already in the history, so I find history-search-* commands essential. Fortunately this is now enabled by default in Fedora 13, but for the unlucky ones here are the instructions.

First, copy ‘/etc/inputrc‘ to ‘~/.inputrc‘ and make a minor modification:
"\e[5~": history-search-backward
"\e[6~": history-search-forward

This allows nice searches through the history, like ‘cp ‘ will search for the previous command starting with ‘cp ‘, type PGUP again and will search backards again.

However, you’ll need this on your ‘~/.profile‘:

export INPUTRC=$HOME/.inputrc

(a similar change would need to be done on zsh’s bindkeys)

development

Many applications benefit from these (on ‘~/.profile‘):

export EMAIL=felipe.contreras@gmail.com
export EDITOR="gvim --nofork"

And also, set your real name (as root):
usermod -c “Real Name” <user_name>

GNOME vim syntax

I like to have GLib code properly highlighted (in C), so I install gtk-vim-syntax which has a lot of stuff (D-Bus, GTK+, clutter, etc.).

Create ‘.vim/after/syntax‘, copy the files you are insterested on (glib.vim, gobject.vim, and gio.vim for me), and then, on c.vim:

runtime! syntax/glib.vim
runtime! syntax/gobject.vim
runtime! syntax/gio.vim

git

These go into ‘~/.gitconfig‘.

I like colors in git:
[color]
ui = auto

I’m not going to list all the aliases, just this one which is very useful:
[alias]
l = log --oneline --decorate --graph

I find mergetool essential to resolve conflicts:
[merge]
tool = gvimdiff
[mergetool]
prompt = false

Everyone should have their own exclude file:
[core]
excludesfile = /home/felipec/.gitignore

This is mine:
.*.sw[nop]

Very useful if you use sendemail often, (for more information see this other post)
[sendemail]
aliasesfile = /home/felipec/.mutt/aliases
aliasfiletype = mutt
chainreplyto = false
confirm = auto
smtpserver = /usr/bin/msmtp
envelopesender = "auto"

And a few more:
[user]
name = Felipe Contreras
email = felipe.contreras@gmail.com
[push]
default = current
[receive]
denyCurrentBranch = warn

Look and feel

fonts

Since I have a laptop (with LCD):
gconftool-2 --set --type string /desktop/gnome/font_rendering/hinting full
gconftool-2 --set --type string /desktop/gnome/font_rendering/antialiasing rgba
gconftool-2 --set --type string /desktop/gnome/font_rendering/rgba_order rgb

Also, I like the Droid fonts, and Iconsolata.

I copy them to ‘~/fonts‘, and instead of of manually configure everything on the
system to use them, I create a ‘~/fonts.conf‘ file like this:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <alias>
    <family>serif</family>
    <prefer>
      <family>Droid Serif</family>
    </prefer>
  </alias>
  <alias>
    <family>sans-serif</family>
    <prefer>
      <family>Droid Sans</family>
    </prefer>
  </alias>
  <alias>
    <family>monospace</family>
    <prefer>
      <family>Inconsolata</family>
    </prefer>
  </alias>
</fontconfig>

Then re-login.

mouse cursor

I like jimmac’s DMZ cursor theme.

gconftool-2 --set --type string /desktop/gnome/peripherals/mouse/cursor_theme dmz

Re-login.

Fedora has it installed by default, but if not, you can just extract the tarball into ‘~/.icons‘.

vim

I also wrote my own color scheme for vim, just copy to ‘.vim/colors‘, and then on ‘~/vimrc‘:
colorscheme felipec

felipec's vim color scheme

My custom color scheme

extra

Before I know it, I need Flash, which I install manually by downloading the tarball and extracting ‘libflashplayer.so‘ into ‘~/.mozilla/plugins‘. You don’t need to restart your browser, but it can’t hurt.

Then when I need to do some multimedia-related stuff I configure rpmfusion. Then add mplayer, which plays pretty much everything, or gnome-mplayer if you want a fancier UI.

After doing all this, and installing a few essential packages (such as vim-X11, gcc) I consider my system usable🙂

For the rest of my configuration files, check in github.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s