-
Notifications
You must be signed in to change notification settings - Fork 0
/
restore.py
31 lines (28 loc) · 898 Bytes
/
restore.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
PWD = os.getcwd()+'/'
HOME = os.environ['HOME']+'/'
q = ''
files = [
('vimrc', '~/.vimrc'),
('NERDTreeBookmarks', '~/.NERDTreeBookmarks'),
('i3status.conf', '~/.i3status.conf'),
('i3config', '~/.i3/config'),
('beetsconfig', '~/.config/beets/config.yaml'),
('bashrc', '~/.bashrc'),
('gitconfig', '~/.gitconfig'),
('yaourtrc', '~/.yaourtrc'),
('zshrc', '~/.zshrc'),
('aliases', '~/.aliases'),
('tmux.conf', '~/.tmux.conf')
]
for file in files:
sendplace = os.path.expanduser(file[1])
print "%s%s -> %s" % (PWD, file[0], sendplace)
while len(q) == 0:
q = raw_input('should i symlink it? (y/n): ')
if q == 'y' or q == 'Y':
command = 'ln -s %s %s' % (PWD+file[0], sendplace)
print command+'\n'
os.system(command)
q = ''