From a0616b1f3e7944490700cc23b0c36514dee16765 Mon Sep 17 00:00:00 2001 From: takyshu98 Date: Mon, 22 Jan 2024 00:24:16 +0900 Subject: [PATCH] WIP --- {.config => home/.config}/git/config | 0 .../complex_modifications/1703418377.json | 0 .../automatic_backups/karabiner_20231224.json | 0 .../.config}/karabiner/karabiner.json | 0 {.config => home/.config}/mise/config.toml | 0 {.config => home/.config}/mise/settings.toml | 0 .../.config}/sheldon/plugins.toml | 0 {.config => home/.config}/starship.toml | 0 {.config => home/.config}/tmux/tmux.conf | 0 {.config => home/.config}/wezterm/wezterm.lua | 0 {.config => home/.config}/zsh/.zshrc | 0 .mackup.cfg => home/.mackup.cfg | 0 .zshenv => home/.zshenv | 0 {bin => home/bin}/.gitkeep | 0 install.sh | 8 ++--- scripts/symlink.sh | 29 +++++++++---------- 16 files changed, 17 insertions(+), 20 deletions(-) rename {.config => home/.config}/git/config (100%) rename {.config => home/.config}/karabiner/assets/complex_modifications/1703418377.json (100%) rename {.config => home/.config}/karabiner/automatic_backups/karabiner_20231224.json (100%) rename {.config => home/.config}/karabiner/karabiner.json (100%) rename {.config => home/.config}/mise/config.toml (100%) rename {.config => home/.config}/mise/settings.toml (100%) rename {.config => home/.config}/sheldon/plugins.toml (100%) rename {.config => home/.config}/starship.toml (100%) rename {.config => home/.config}/tmux/tmux.conf (100%) rename {.config => home/.config}/wezterm/wezterm.lua (100%) rename {.config => home/.config}/zsh/.zshrc (100%) rename .mackup.cfg => home/.mackup.cfg (100%) rename .zshenv => home/.zshenv (100%) rename {bin => home/bin}/.gitkeep (100%) diff --git a/.config/git/config b/home/.config/git/config similarity index 100% rename from .config/git/config rename to home/.config/git/config diff --git a/.config/karabiner/assets/complex_modifications/1703418377.json b/home/.config/karabiner/assets/complex_modifications/1703418377.json similarity index 100% rename from .config/karabiner/assets/complex_modifications/1703418377.json rename to home/.config/karabiner/assets/complex_modifications/1703418377.json diff --git a/.config/karabiner/automatic_backups/karabiner_20231224.json b/home/.config/karabiner/automatic_backups/karabiner_20231224.json similarity index 100% rename from .config/karabiner/automatic_backups/karabiner_20231224.json rename to home/.config/karabiner/automatic_backups/karabiner_20231224.json diff --git a/.config/karabiner/karabiner.json b/home/.config/karabiner/karabiner.json similarity index 100% rename from .config/karabiner/karabiner.json rename to home/.config/karabiner/karabiner.json diff --git a/.config/mise/config.toml b/home/.config/mise/config.toml similarity index 100% rename from .config/mise/config.toml rename to home/.config/mise/config.toml diff --git a/.config/mise/settings.toml b/home/.config/mise/settings.toml similarity index 100% rename from .config/mise/settings.toml rename to home/.config/mise/settings.toml diff --git a/.config/sheldon/plugins.toml b/home/.config/sheldon/plugins.toml similarity index 100% rename from .config/sheldon/plugins.toml rename to home/.config/sheldon/plugins.toml diff --git a/.config/starship.toml b/home/.config/starship.toml similarity index 100% rename from .config/starship.toml rename to home/.config/starship.toml diff --git a/.config/tmux/tmux.conf b/home/.config/tmux/tmux.conf similarity index 100% rename from .config/tmux/tmux.conf rename to home/.config/tmux/tmux.conf diff --git a/.config/wezterm/wezterm.lua b/home/.config/wezterm/wezterm.lua similarity index 100% rename from .config/wezterm/wezterm.lua rename to home/.config/wezterm/wezterm.lua diff --git a/.config/zsh/.zshrc b/home/.config/zsh/.zshrc similarity index 100% rename from .config/zsh/.zshrc rename to home/.config/zsh/.zshrc diff --git a/.mackup.cfg b/home/.mackup.cfg similarity index 100% rename from .mackup.cfg rename to home/.mackup.cfg diff --git a/.zshenv b/home/.zshenv similarity index 100% rename from .zshenv rename to home/.zshenv diff --git a/bin/.gitkeep b/home/bin/.gitkeep similarity index 100% rename from bin/.gitkeep rename to home/bin/.gitkeep diff --git a/install.sh b/install.sh index 0e6ad12..ef25318 100755 --- a/install.sh +++ b/install.sh @@ -39,18 +39,16 @@ else echo fi -cd "${DOTPATH}" - # Restore macOS settings -scripts/defaults.sh +"${DOTPATH}/scripts/defaults.sh" echo # Make symbolic links and directories -scripts/symlink.sh +"${DOTPATH}/scripts/symlink.sh" echo # Install command line tools and applications -brew bundle +brew bundle --file "${DOTPATH}/Brewfile" echo # Restore application settings diff --git a/scripts/symlink.sh b/scripts/symlink.sh index 0575758..5737761 100755 --- a/scripts/symlink.sh +++ b/scripts/symlink.sh @@ -1,28 +1,27 @@ #!/bin/bash -readonly DOTPATH="${HOME}/share/dotfiles" +readonly DOTHOME="${HOME}/share/dotfiles/home" -if [ ! -e "${DOTPATH}" ]; then - echo "Error: Directory does not exist: ${DOTPATH}" +if [ ! -e "${DOTHOME}" ]; then + echo "Error: Directory does not exist: ${DOTHOME}" exit 1 fi -cd "${DOTPATH}" - -# Make symbolic links from ~/.* to ~/share/dotfiles/.* -for file in .??*; do - [[ "${file}" == ".DS_Store" ]] && continue - [[ "${file}" == ".config" ]] && continue - [[ "${file}" == ".git" ]] && continue - [[ "${file}" == ".github" ]] && continue - [[ "${file}" == ".gitignore" ]] && continue - ln -fvns "${DOTPATH}/${file}" "${HOME}/${file}" +# Make symbolic links from ~/.* to ~/share/dotfiles/home/.* +for file_path in "${DOTHOME}"/.??*; do + file_name="$(basename "${file_path}")" + [[ "${file_name}" == ".DS_Store" ]] && continue + [[ "${file_name}" == ".config" ]] && continue + [[ "${file_name}" == ".git" ]] && continue + [[ "${file_name}" == ".github" ]] && continue + [[ "${file_name}" == ".gitignore" ]] && continue + ln -fvns "${DOTHOME}/${file_name}" "${HOME}/${file_name}" done # Make symbolic links on the basis of XDG Base Directory specification [[ -z "${XDG_CONFIG_HOME}" ]] && XDG_CONFIG_HOME="${HOME}/.config" mkdir -p "${XDG_CONFIG_HOME}" -find "${DOTPATH}/.config" -maxdepth 1 -exec ln -fvns {} "${XDG_CONFIG_HOME}" \; +find "${DOTHOME}/.config" -maxdepth 1 ! -name '.config' ! -name '.DS_Store' -exec ln -fvns {} "${XDG_CONFIG_HOME}" \; [[ -z "${XDG_CACHE_HOME}" ]] && XDG_CACHE_HOME="${HOME}/.cache" mkdir -p "${XDG_CACHE_HOME}" @@ -35,7 +34,7 @@ mkdir -p "${XDG_STATE_HOME}" # Make directories with reference to Filesystem Hierarchy Standard mkdir -p "${HOME}/bin" # for original commands -find "${DOTPATH}/bin/" -type f -perm 0755 -exec ln -fvns {} "${HOME}/bin/" \; +find "${DOTHOME}/bin/" -type f ! -name '.DS_Store' -perm 0755 -exec ln -fvns {} "${HOME}/bin/" \; mkdir -p "${HOME}/src" # for code repositories