-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.py
31 lines (25 loc) · 1.23 KB
/
install.py
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
#! /usr/bin/env python
import os
import fnmatch
exclude = ['*.sw*', '.git', 'install.*', '.gitmodules']
for f in os.listdir('.'):
if not any(fnmatch.fnmatch(f, p) for p in exclude):
path = os.path.join(os.path.expanduser('~'), f)
if os.path.isfile(path) or os.path.isdir(path):
os.unlink(path)
os.symlink(os.path.abspath(f), path)
print('create link for %s' % (path))
def symlink(target, source):
# Symlink nvim config file
path = os.path.expanduser(target)
path_dir = os.path.dirname(path)
if os.path.isfile(path) or os.path.isdir(path):
os.unlink(path)
if not os.path.exists(path_dir):
os.makedirs(path_dir)
os.symlink(os.path.abspath(source), path)
symlink('~/.config/nvim/init.vim', 'nvim.init')
symlink('~/.config/powerline.bash', 'powerline.bash')
symlink('~/.config/fish', 'fish')
# to get better colors in the terminal, launch the following command
# gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/palette "#000000000000:#E5E522222222:#A6A6E3E32D2D:#FCFC95951E1E:#C4C48D8DFFFF:#FAFA25257373:#6767D9D9F0F0:#F2F2F2F2F2F2:#4CCC4CCC4CCC:#E5E522222222:#A6A6E3E32D2D:#FCFC95951E1E:#C4C48D8DFFFF:#FAFA25257373:#6767D9D9F0F0:#F2F2F2F2F2F2"