]> ruderich.org/simon Gitweb - config/dotfiles.git/blob - setup.sh
tmux.conf: Add, very basic tmux configuration file.
[config/dotfiles.git] / setup.sh
1 #!/bin/sh
2
3 # Setup script for shell configuration files.
4
5
6 . ../lib.sh
7
8 hostname=`hostname`
9
10 # Generate ~/.less with lesskey.
11 lesskey lesskey
12 chmod 0600 ~/.less
13
14 # As screen-256color is not widely supported use it only on machines known to
15 # work.
16 generate cat screenrc .in
17 if [ $hostname != asp -a $hostname != systemofadown ]; then
18     sed 's/Enable 256 color/Disable 256 color/;
19          s/screen-256color/screen/' screenrc > screenrc.tmp
20     mv screenrc.tmp screenrc
21 fi
22 # Some options are only necessary when running as root. They are marked as
23 # "(ROOT)".
24 if [ x`id -u` != x0 ]; then
25     echo screenrc: removing root options
26     grep -v '(ROOT)' screenrc > screenrc.tmp
27     mv screenrc.tmp screenrc
28 fi
29 # I use some features of screen which are only in Git. Drop them on machines
30 # which have older versions. They are marked as "(GIT)".
31 if [ $hostname != asp -o x`id -u` = x0 ]; then
32     echo screenrc: removing Git features
33     grep -v '(GIT)' screenrc > screenrc.tmp
34     mv screenrc.tmp screenrc
35 fi
36 # Rxvt doesn't need the attrcolor "fix". As I prefer rxvt assume I use it when
37 # it's installed.
38 if installed rxvt; then
39     echo screenrc: removing attrcolor \"fix\"
40     sed 's/attrcolor b ".I"/#attrcolor b ".I"/' screenrc > screenrc.tmp
41     mv screenrc.tmp screenrc
42 fi
43 # Display current battery charge on computers with a battery. Necessary lines
44 # are marked as "(BATTERY)".
45 if [ ! -d /sys/class/power_supply/BAT0 ]; then
46     echo screenrc: removing battery display
47     grep -v '(BATTERY)' screenrc > screenrc.tmp
48     mv screenrc.tmp screenrc
49 fi
50
51 # Link setup for shells.
52 link shell ~/.shell
53 link bash ~/.bash
54 link bash/rc ~/.bashrc
55 link bash/profile ~/.bash_profile
56 link bash/logout ~/.bash_logout
57 if installed csh; then
58     link csh/rc ~/.cshrc
59 fi
60 link zsh ~/.zsh
61 link zsh/env ~/.zshenv
62 link zsh/rc ~/.zshrc
63 link zsh/logout ~/.zlogout
64
65 # Link setup for additional files.
66 link lessfilter ~/.lessfilter
67 if installed colordiff; then
68     link colordiffrc ~/.colordiffrc
69 fi
70 link inputrc ~/.inputrc
71 link screenrc ~/.screenrc
72 if installed tmux; then
73     link tmux.conf ~/.tmux.conf
74 fi
75
76 # Create rlwrap history directory.
77 mkdir -p shell/rlwrap