summaryrefslogtreecommitdiff
path: root/make-symlinks
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2013-10-12 16:38:43 +0100
committerLars Wirzenius <liw@liw.fi>2013-10-12 16:38:43 +0100
commit44b622c7691d7870e05992d194228318c826714e (patch)
treeedd7a7e8dcb112dd4626a5ca16a6cda92eb2e264 /make-symlinks
downloadliw-dot-files-44b622c7691d7870e05992d194228318c826714e.tar.gz
Initial import
Diffstat (limited to 'make-symlinks')
-rwxr-xr-xmake-symlinks35
1 files changed, 35 insertions, 0 deletions
diff --git a/make-symlinks b/make-symlinks
new file mode 100755
index 0000000..3853a89
--- /dev/null
+++ b/make-symlinks
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+set -e
+
+die()
+{
+ echo "$@" 1>&2
+ exit 1
+}
+
+
+abspath()
+{
+ (cd "$1" && pwd)
+}
+
+
+dirname=$(abspath $(dirname "$0"))
+echo "$dirname"
+
+files="bashrc bash_profile profile xsessionrc vimrc muttrc mailcap emacs
+ signature signature-codethink"
+
+for x in $files
+do
+ [ -e "$dirname/$x" ] || die "$dirname/$x does not exist, oops"
+# [ ! -L "$HOME/.$x" ] || die "$HOME/.$x is already a symlink, oops"
+done
+
+for x in $files
+do
+ ln -sf "$dirname/$x" "$HOME/.$x"
+done
+
+ln -sf "$dirname/xmonad.hs" "$HOME/.xmonad/xmonad.hs"