-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfinst.sh
More file actions
executable file
·73 lines (59 loc) · 1.73 KB
/
Copy pathconfinst.sh
File metadata and controls
executable file
·73 lines (59 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/sh
## Applications to check:
# terminal: X, bash, readline, less, zsh, mksh, mc
# editors: joe, emacs
# i3wm
# mutt
command -v X > /dev/null 2>&1 && has_x=0
command -v bash > /dev/null 2>&1 && has_bash=0
ldconfig -p | grep readline > /dev/null 2>&1 && has_readline=0
command -v less > /dev/null 2>&1 && has_less=0
command -v zsh > /dev/null 2>&1 && has_zsh=0
command -v mksh > /dev/null 2>&1 && has_mksh=0
command -v mc > /dev/null 2>&1 && has_mc=0
command -v jstar > /dev/null 2>&1 && has_jstar=0
command -v emacs > /dev/null 2>&1 && has_emacs=0
command -v i3 > /dev/null 2>&1 && has_i3=0
command -v mutt > /dev/null 2>&1 && has_mutt=0
echo Found programs:
test -n has_x && echo X
test -n has_bash && echo bash
test -n has_readline && echo readline
test -n has_less && echo less
test -n has_zsh && echo zsh
test -n has_mksh && echo mksh
test -n has_mc && echo mc
test -n has_jstar && echo jstar
test -n has_emacs && echo emacs
test -n has_i3 && echo i3
test -n has_mutt && echo mutt
d=$(dirname $0)
ask() {
read -p "Do you want to install config files for $1? (Y/N) " yn
case $yn
in [Yy]* ) return 0;;
* ) return 1;;
esac
}
# bash/readline: zwinputrc, ~/.inputrc
if [ -n $has_bash -o -n $has_readline ]; then
ask inputrc && cp -vi zwinputrc ~/.inputrc
fi
# less: ~/.lesskey
if [ -n $has_less ]; then
ask less && cp -vi zwlessrc ~/.lesskey
# TODO: lesskey needs lesskey to be run on startup
fi
# zsh: $ZDOTDIR/.zshrc, ~/.zshrc (+ .zshenv, .zprofile, .zlogin, .zlogout)
# mksh: ~/.mkshrc
# mc
# joe: dotjoe/ -> ~/.joe, jstarrc -> .jstarrc
if [ -n $has_jstar ]; then
if ask joe; then
cp -Trvi $d/joe/dotjoe ~/.joe
cp -vi $d/joe/jstarrc ~/.jstarrc
fi
fi
# emacs
# i3 ~/.i3/config, ~/.config/i3
# mutt: ~/.muttrc, ~/.mutt/muttrc