Merge branch 'master' of https://gitlab.com/sagev9000/dotfiles
This commit is contained in:
commit
5e2154c35b
74
copy.sh
74
copy.sh
|
@ -1,12 +1,11 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Install required packages
|
|
||||||
if [[ "$1" != "--install" ]]; then
|
|
||||||
git submodule init
|
|
||||||
git submodule update
|
|
||||||
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||||
FAKE_HOME="$SCRIPT_DIR/fake_home"
|
FAKE_HOME="$SCRIPT_DIR/fake_home"
|
||||||
|
|
||||||
|
git submodule init
|
||||||
|
git submodule update
|
||||||
|
|
||||||
dotdirs="$(find $FAKE_HOME -mindepth 1 -type d)"
|
dotdirs="$(find $FAKE_HOME -mindepth 1 -type d)"
|
||||||
|
|
||||||
echo "$dotdirs" | while read -r dotdir; do
|
echo "$dotdirs" | while read -r dotdir; do
|
||||||
|
@ -25,19 +24,76 @@ if [[ "$1" != "--install" ]]; then
|
||||||
done
|
done
|
||||||
|
|
||||||
touch "$HOME/.zsh_local"
|
touch "$HOME/.zsh_local"
|
||||||
else
|
if [[ "$1" == "--files-only" ]]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "Installing required packages..."
|
||||||
|
|
||||||
echo -n "Rust is "
|
echo -n "Rust is "
|
||||||
if ! command -v cargo; then
|
if ! command -v cargo &> /dev/null; then
|
||||||
echo "not installed. Installing..."
|
echo "not installed. Installing..."
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||||
else
|
else
|
||||||
echo "installed."
|
echo "already installed."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
. "$HOME/.cargo/env"
|
. "$HOME/.cargo/env"
|
||||||
if command -v cargo; then
|
if command -v cargo &> /dev/null && ! command -v bat &> /dev/null; then
|
||||||
cargo install bat
|
cargo install bat
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo -n "nvm is "
|
||||||
|
if ! test -d "$HOME/.nvm"; then
|
||||||
|
echo "not installed. Installing..."
|
||||||
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
|
||||||
|
export NVM_DIR="$HOME/.nvm"
|
||||||
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
||||||
|
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
||||||
|
nvm install 14
|
||||||
|
nvm install 18
|
||||||
|
nvm install node
|
||||||
|
nvm use node
|
||||||
|
else
|
||||||
|
echo "already installed."
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -n "dotnet is "
|
||||||
|
if ! command -v dotnet &> /dev/null; then
|
||||||
|
echo "not installed. Installing..."
|
||||||
|
wget https://dot.net/v1/dotnet-install.sh -O /tmp/dotnet-install.sh
|
||||||
|
chmod +x /tmp/dotnet-install.sh
|
||||||
|
/tmp/dotnet-install.sh --version latest
|
||||||
|
rm /tmp/dotnet-install.sh
|
||||||
|
else
|
||||||
|
echo "already installed."
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -n "starship is "
|
||||||
|
if ! command -v starship &> /dev/null; then
|
||||||
|
echo "not installed. Installing..."
|
||||||
curl -sS https://starship.rs/install.sh | sh
|
curl -sS https://starship.rs/install.sh | sh
|
||||||
echo "Starship requires an NFont: https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/FiraCode.zip"
|
echo "Starship requires an NFont: https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/FiraCode.zip"
|
||||||
echo "You may wish to install fzf"
|
else
|
||||||
|
echo "already installed."
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -n "JetBrains toolbox is "
|
||||||
|
if ! test -d $HOME/.config/JetBrains/; then
|
||||||
|
echo "not installed. Installing..."
|
||||||
|
ARCHIVE_URL="$(curl -s 'https://data.services.jetbrains.com/products/releases?code=TBA&latest=true&type=release' | grep -Po '"linux":.*?[^\\]",' | awk -F ':' '{print $3,":"$4}'| sed 's/[", ]//g')"
|
||||||
|
wget -q --show-progress -cO "/tmp/jetbrains-toolbox-latest.tar.gz" "$ARCHIVE_URL"
|
||||||
|
cd /tmp/
|
||||||
|
tar -xvf jetbrains-toolbox-latest.tar.gz --strip-components=1
|
||||||
|
chmod +x jetbrains-toolbox
|
||||||
|
./jetbrains-toolbox
|
||||||
|
else
|
||||||
|
echo "already installed."
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! command -v fzf &> /dev/null; then
|
||||||
|
echo "You may wish to install fzf for sofi and other search"
|
||||||
|
else
|
||||||
|
echo "fzf is already installed"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -139,3 +139,4 @@ ex ()
|
||||||
}
|
}
|
||||||
|
|
||||||
source ~/.shell_aliases
|
source ~/.shell_aliases
|
||||||
|
. "$HOME/.cargo/env"
|
||||||
|
|
|
@ -4,6 +4,18 @@ function fin {
|
||||||
find -iname "*$@*"
|
find -iname "*$@*"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function gamp {
|
||||||
|
git add * && git commit -am "$1" && git push
|
||||||
|
}
|
||||||
|
|
||||||
|
function gap {
|
||||||
|
git add * && git commit -a && git push
|
||||||
|
}
|
||||||
|
|
||||||
|
function gd {
|
||||||
|
git add * && git diff --cached --word-diff=porcelain
|
||||||
|
}
|
||||||
|
|
||||||
function wf {
|
function wf {
|
||||||
if [[ "$@" != "" ]]; then
|
if [[ "$@" != "" ]]; then
|
||||||
local fzf_args="-q $@"
|
local fzf_args="-q $@"
|
||||||
|
@ -45,6 +57,11 @@ function vo {
|
||||||
echo $f
|
echo $f
|
||||||
}
|
}
|
||||||
|
|
||||||
|
alias yt='yt-dlp'
|
||||||
|
function y {
|
||||||
|
cd ~/.ytdl; yt-dlp $@; cd -
|
||||||
|
}
|
||||||
|
|
||||||
# Mkdir should remind you to use git
|
# Mkdir should remind you to use git
|
||||||
alias mkdir="echo 'Maybe use git init if this is a new project' && mkdir"
|
alias mkdir="echo 'Maybe use git init if this is a new project' && mkdir"
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ if [ -x /usr/bin/dircolors ]; then
|
||||||
alias egrep='egrep --color=auto'
|
alias egrep='egrep --color=auto'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export PATH=./:~/.bin:$HOME/.platformio/penv/bin:/usr/local/go/bin:$PATH
|
export PATH=./:~/.bin:$HOME/.dotnet:$HOME/.platformio/penv/bin:/usr/local/go/bin:$PATH
|
||||||
|
|
||||||
fignore=(o)
|
fignore=(o)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue