From ecb7bfad0cca9f8720fe53d8eb6bbe1c59138042 Mon Sep 17 00:00:00 2001 From: Alexandre Tuleu Date: Wed, 19 Jan 2022 15:24:49 +0100 Subject: [PATCH] Adds a clean install script --- .config/fish/functions/fish_prompt.fish | 2 +- .gitignore | 9 ------- .gitmodules | 3 +++ .local/share/omf | 1 + install.sh | 32 +++++++++++++++++++++++++ 5 files changed, 37 insertions(+), 10 deletions(-) create mode 100644 .gitmodules create mode 160000 .local/share/omf create mode 100755 install.sh diff --git a/.config/fish/functions/fish_prompt.fish b/.config/fish/functions/fish_prompt.fish index b1b9ccf..d17b69a 120000 --- a/.config/fish/functions/fish_prompt.fish +++ b/.config/fish/functions/fish_prompt.fish @@ -1 +1 @@ -/home/atuleu/.local/share/omf/themes/boxfish/fish_prompt.fish \ No newline at end of file +../../../.local/share/omf/themes/bobthefish/functions/fish_prompt.fish \ No newline at end of file diff --git a/.gitignore b/.gitignore index 33dc7f1..e69de29 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +0,0 @@ -* - -!.gitignore -!.config/fish/* -!.config/starship.toml -!.config/omf/* -!.emacs -!.config/git/* -!.tmux.conf diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..dc60757 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "omf"] +path= .local/share/omf +url= https://github.com/oh-my-fish/oh-my-fish.git \ No newline at end of file diff --git a/.local/share/omf b/.local/share/omf new file mode 160000 index 0000000..92a572d --- /dev/null +++ b/.local/share/omf @@ -0,0 +1 @@ +Subproject commit 92a572d8cdfdf5b219269d59210b8a28f6cd6616 diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..27548c0 --- /dev/null +++ b/install.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +set -e + +files=".config/fish \ +.config/git .config/omf .config/starship .tmux.conf .local/share/omf" + + +function this_script_root_dir() { + dirname $(realpath ${BASH_SOURCE[0]}) +} + +function run() { + echo "$@" + $@ +} + + +function install_home() { + for f in $files + do + run rm -Rf $HOME/$f + dir=$(dirname $f) + if [ ! "$dir" = "." ] + then + run mkdir -p $HOME/$dir + fi + run ln -sf $(this_script_root_dir)/$f $HOME/$f + done +} + +install_home