Further tidying and making

This commit is contained in:
2020-02-25 21:09:30 +00:00
committed by Andrejus
parent 549d6ce88d
commit c4ce39b965
15 changed files with 101 additions and 68 deletions

View File

@@ -7,7 +7,8 @@
#
# 1. fish shell is installed
if [ ! hash fish ] 2>/dev/null; then
if [ is_missing fish ] 2>/dev/null
then
printf "Installing fish...\n"
@@ -22,23 +23,20 @@ fi
printf "fish is installed\n"
# 2. fish shell is default login shell
fish_path=$(which fish)
if [ $SHELL != fish_path ]; then
readonly fish_path=$(which fish)
if [ $SHELL != fish_path ]
then
printf "Setting fish as default...\n"
# Update default login shell
chsh -s $fish_path $USER
usermod -s $fish_path $USER
fi
printf "fish is default login shell\n"
# 3. fish dotfiles are symlinked
target="$HOME/.config/fish"
for file in $(ls -d $script_dir/fish/*); do
rel_path=$(realpath --relative-to="$target" "$file")
printf "Linking $file to $target as $rel_path...\n"
ln -sv $rel_path $target
done
readonly fish_source="$dotfiles_dir/fish/*"
readonly fish_target="$HOME/.config/fish"
link_folder "$fish_source" "$fish_target"
printf "fish dotfiles linked\n"