-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·40 lines (35 loc) · 748 Bytes
/
Copy pathsetup.sh
File metadata and controls
executable file
·40 lines (35 loc) · 748 Bytes
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
#! /bin/sh
#
# setup.sh --- Set up symlinks for a new system.
#
# Copyright (C) 2013, James Bielman <jamesjb@gmail.com>
# All Rights Reserved.
#
# maybe_backup(FILE)
#
# Move FILE to FILE.orig if it exists.
maybe_backup()
{
if [ -f "$1" ]; then
echo "Backing up old $1"
mv "$1" "$1.orig"
fi
}
# symlink(SRC, DEST)
#
# Symlinks $PWD/SRC to $HOME/DEST, backing up any old file.
symlink()
{
maybe_backup "$HOME/$2"
echo "Symlinking $2"
ln -s "$PWD/$1" "$HOME/$2"
}
symlink bashrc .bashrc
symlink profile .profile
symlink zshrc .zshrc
symlink vimrc .vimrc
symlink emacs.el .emacs.el
symlink Xresources .Xresources
mkdir -p ~/.config/wezterm
symlink wezterm/wezterm.lua .config/wezterm/wezterm.lua
echo "Done."