mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 08:41:43 +05:30
- Aliases added for alternate Nvim distros
- File cleanups - Zoxide initialization in bashrc & zshrc
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -92,4 +92,3 @@ dist-ssr
|
|||||||
**/contents/images
|
**/contents/images
|
||||||
**/contents/fonts
|
**/contents/fonts
|
||||||
*kpluginindex.json
|
*kpluginindex.json
|
||||||
|
|
||||||
|
|||||||
@@ -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.
|
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.
|
||||||
|
|
||||||
<!-- TODO: Move as many dotfiles inside ~/.config as possible -->
|
<!-- TODO: Move as many dotfiles inside ~/.config as possible -->
|
||||||
|
|
||||||
|
|||||||
90
bootstrap.sh
90
bootstrap.sh
@@ -1,21 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/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
|
# Parse script arguments
|
||||||
##################################
|
##################################
|
||||||
@@ -47,41 +31,20 @@ while [[ "${#}" -gt 0 ]]; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
main() {
|
usage() {
|
||||||
|
if [ -n "$1" ]; then
|
||||||
# Check if the current os is KDE Neon or Mac
|
echo ""
|
||||||
# if $(command -v pkcon > /dev/null) || [[ $XDG_CURRENT_DESKTOP == "KDE" ]]; then
|
echo -e "${CRED}$1${CEND}\n"
|
||||||
# OS="kde-neon"
|
|
||||||
#
|
|
||||||
# else
|
|
||||||
# OS="macos"
|
|
||||||
# fi
|
|
||||||
if [[ $(uname -s) == *Darwin* ]]; then
|
|
||||||
OS="macos"
|
|
||||||
else
|
|
||||||
OS="kde-neon"
|
|
||||||
fi
|
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
|
echo ""
|
||||||
cd -P "$(dirname "$0")" || exit
|
echo "Example: $0 -q --create-links"
|
||||||
|
|
||||||
# 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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
place_dotfile_at_target_location() {
|
place_dotfile_at_target_location() {
|
||||||
@@ -114,4 +77,33 @@ place_dotfile_at_target_location() {
|
|||||||
fi
|
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 "$@"
|
main "$@"
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ alias usersearch="awk -F: '{print \"UserName: \" \$1 \", UserID: \" \$3 \", Home
|
|||||||
alias untar='tar -zxvf '
|
alias untar='tar -zxvf '
|
||||||
alias v=nvim
|
alias v=nvim
|
||||||
alias n=nvim
|
alias n=nvim
|
||||||
alias vim=nvim
|
|
||||||
|
|
||||||
url_encode(){
|
url_encode(){
|
||||||
python3 -c "import urllib.parse, sys; print(urllib.parse.quote(sys.stdin.read()))" <<< "$1"
|
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 tls="tmux ls"
|
||||||
alias tnew="tmux new"
|
alias tnew="tmux new"
|
||||||
alias tnewt="tmux new -t"
|
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 $@
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -207,3 +207,6 @@ export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || pr
|
|||||||
export QT_PLUGIN_PATH=~/.local/lib/qt/plugins/:
|
export QT_PLUGIN_PATH=~/.local/lib/qt/plugins/:
|
||||||
|
|
||||||
eval "$(ssh-agent -s)"
|
eval "$(ssh-agent -s)"
|
||||||
|
if command -v zoxide > /dev/null; then
|
||||||
|
eval "$(zoxide init bash)"
|
||||||
|
fi
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ return {
|
|||||||
color_scheme = "Catppuccin Mocha",
|
color_scheme = "Catppuccin Mocha",
|
||||||
font_size = 14.0,
|
font_size = 14.0,
|
||||||
font = wezterm.font_with_fallback({
|
font = wezterm.font_with_fallback({
|
||||||
-- "JetBrains Mono",
|
|
||||||
"JetBrainsMono Nerd Font",
|
"JetBrainsMono Nerd Font",
|
||||||
{ family = "Symbols Nerd Font Mono", scale = 0.75 },
|
{ family = "Symbols Nerd Font Mono", scale = 0.75 },
|
||||||
}),
|
}),
|
||||||
@@ -12,7 +11,6 @@ return {
|
|||||||
enable_tab_bar = true,
|
enable_tab_bar = true,
|
||||||
use_fancy_tab_bar = true,
|
use_fancy_tab_bar = true,
|
||||||
hide_tab_bar_if_only_one_tab = true,
|
hide_tab_bar_if_only_one_tab = true,
|
||||||
-- window_background_opacity = 0.99,
|
|
||||||
win32_system_backdrop = "Mica",
|
win32_system_backdrop = "Mica",
|
||||||
macos_window_background_blur = 80,
|
macos_window_background_blur = 80,
|
||||||
|
|
||||||
|
|||||||
@@ -126,3 +126,6 @@ export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || pr
|
|||||||
|
|
||||||
eval "$(ssh-agent -s)" > /dev/null
|
eval "$(ssh-agent -s)" > /dev/null
|
||||||
ulimit -n 10240
|
ulimit -n 10240
|
||||||
|
if command -v zoxide > /dev/null; then
|
||||||
|
eval "$(zoxide init zsh)"
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user