diff --git a/.gitignore b/.gitignore index 2bad335..e0565af 100644 --- a/.gitignore +++ b/.gitignore @@ -92,4 +92,3 @@ dist-ssr **/contents/images **/contents/fonts *kpluginindex.json - diff --git a/README.md b/README.md index 3ba099c..a8d7fd9 100755 --- a/README.md +++ b/README.md @@ -21,3 +21,4 @@ Example: bash ./bootstrap.sh -q --create-links I have multiple Linux installations on my machine. Linking it from one place (this repository) keeps things tidy. Also, changes to dotfiles automatically get applied to all the distros. + diff --git a/bootstrap.sh b/bootstrap.sh index d51184a..19fb460 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,21 +1,5 @@ #!/bin/sh - -usage() { - if [ -n "$1" ]; then - echo "" - echo -e "${CRED}$1${CEND}\n" - fi - - echo "Applies all settings stored in the script's directory to your home directory" - echo "" - echo "Usage: $0 [-q|--quiet] [-l|--create-links]" - echo " -q, --quiet No screen outputs" - echo " -l, --create-links Creates soft-links to files in the current directory instead of copying them" - - echo "" - echo "Example: $0 -q --create-links" -} - +# ################################## # Parse script arguments ################################## @@ -47,41 +31,20 @@ while [[ "${#}" -gt 0 ]]; do esac done -main() { - - # Check if the current os is KDE Neon or Mac - # if $(command -v pkcon > /dev/null) || [[ $XDG_CURRENT_DESKTOP == "KDE" ]]; then - # OS="kde-neon" - # - # else - # OS="macos" - # fi - if [[ $(uname -s) == *Darwin* ]]; then - OS="macos" - else - OS="kde-neon" +usage() { + if [ -n "$1" ]; then + echo "" + echo -e "${CRED}$1${CEND}\n" fi - TS=$(date '+%d_%m_%Y-%H_%M_%S') + echo "Applies all settings stored in the script's directory to your home directory" + echo "" + echo "Usage: $0 [-q|--quiet] [-l|--create-links]" + echo " -q, --quiet No screen outputs" + echo " -l, --create-links Creates soft-links to files in the current directory instead of copying them" - # Switch inside dotfile repository directory - cd -P "$(dirname "$0")" || exit - - # Copy all files in "Common" dotfiles to $HOME directory ("~") - find "./common" -type f ! -path '*.DS_Store' ! -path '*.directory' -print0 | while IFS= read -r -d '' file; - do - local file_target_location="${file/.\/common/$HOME}" - local source_file_location="${file/./$PWD}" - place_dotfile_at_target_location "$source_file_location" "$file_target_location" "$TS" - done - - # Copy platform specific files to $HOME directory ("~") - find "./${OS}" -type f ! -path '*.DS_Store' ! -path '*.directory' -print0 | while IFS= read -r -d '' file; - do - local file_target_location="${file/.\/${OS}/$HOME}" - local source_file_location="${file/./$PWD}" - place_dotfile_at_target_location "$source_file_location" "$file_target_location" "$TS" - done + echo "" + echo "Example: $0 -q --create-links" } place_dotfile_at_target_location() { @@ -114,4 +77,33 @@ place_dotfile_at_target_location() { fi } +main() { + if [[ $(uname -s) == *Darwin* ]]; then + OS="macos" + else + OS="kde-neon" + fi + + TS=$(date '+%d_%m_%Y-%H_%M_%S') + + # Switch inside dotfile repository directory + cd -P "$(dirname "$0")" || exit + + # Copy all files in "Common" dotfiles to $HOME directory ("~") + find "./common" -type f ! -path '*.DS_Store' ! -path '*.directory' -print0 | while IFS= read -r -d '' file; + do + local file_target_location="${file/.\/common/$HOME}" + local source_file_location="${file/./$PWD}" + place_dotfile_at_target_location "$source_file_location" "$file_target_location" "$TS" + done + + # Copy platform specific files to $HOME directory ("~") + find "./${OS}" -type f ! -path '*.DS_Store' ! -path '*.directory' -print0 | while IFS= read -r -d '' file; + do + local file_target_location="${file/.\/${OS}/$HOME}" + local source_file_location="${file/./$PWD}" + place_dotfile_at_target_location "$source_file_location" "$file_target_location" "$TS" + done +} + main "$@" diff --git a/common/.aliases b/common/.aliases index 95ba060..5ef9d3a 100644 --- a/common/.aliases +++ b/common/.aliases @@ -16,7 +16,6 @@ alias usersearch="awk -F: '{print \"UserName: \" \$1 \", UserID: \" \$3 \", Home alias untar='tar -zxvf ' alias v=nvim alias n=nvim -alias vim=nvim url_encode(){ python3 -c "import urllib.parse, sys; print(urllib.parse.quote(sys.stdin.read()))" <<< "$1" @@ -76,3 +75,19 @@ alias tat="tmux a -t" alias tls="tmux ls" alias tnew="tmux new" alias tnewt="tmux new -t" + +# Nvim Distro-Switcher +alias nvim-lazy="NVIM_APPNAME=lazyvim nvim" +alias nvim-chad="NVIM_APPNAME=nvchad nvim" +function nvims() { + items=$(find -L $HOME/.config -maxdepth 2 -name "init.lua" -type f -execdir sh -c 'pwd | xargs basename' \;) + config=$(printf "%s\n" "${items[@]}" | fzf --prompt=" Neovim Config  " --height=~50% --layout=reverse --border --exit-0) + if [[ -z $config ]]; then + echo "Nothing selected" + return 0 + elif [[ $config == "default" ]]; then + config="" + fi + NVIM_APPNAME=$config nvim $@ +} + diff --git a/common/.bashrc b/common/.bashrc index 6564342..f793f35 100644 --- a/common/.bashrc +++ b/common/.bashrc @@ -207,3 +207,6 @@ export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || pr export QT_PLUGIN_PATH=~/.local/lib/qt/plugins/: eval "$(ssh-agent -s)" +if command -v zoxide > /dev/null; then + eval "$(zoxide init bash)" +fi diff --git a/common/.config/wezterm/wezterm.lua b/common/.config/wezterm/wezterm.lua index dcf89bd..54d8a8d 100644 --- a/common/.config/wezterm/wezterm.lua +++ b/common/.config/wezterm/wezterm.lua @@ -4,7 +4,6 @@ return { color_scheme = "Catppuccin Mocha", font_size = 14.0, font = wezterm.font_with_fallback({ - -- "JetBrains Mono", "JetBrainsMono Nerd Font", { family = "Symbols Nerd Font Mono", scale = 0.75 }, }), @@ -12,7 +11,6 @@ return { enable_tab_bar = true, use_fancy_tab_bar = true, hide_tab_bar_if_only_one_tab = true, - -- window_background_opacity = 0.99, win32_system_backdrop = "Mica", macos_window_background_blur = 80, diff --git a/common/.zshrc b/common/.zshrc index 276cc72..96de0c9 100644 --- a/common/.zshrc +++ b/common/.zshrc @@ -126,3 +126,6 @@ export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || pr eval "$(ssh-agent -s)" > /dev/null ulimit -n 10240 +if command -v zoxide > /dev/null; then + eval "$(zoxide init zsh)" +fi