Compare commits

..

No commits in common. "a344ac5e35d910e5a908324de21c17aedabf6bcd" and "a125c81d403eb0c07f536ade7942f63c40c9d00e" have entirely different histories.

8 changed files with 65 additions and 213 deletions

View file

@ -1,11 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
install_homebrew() { install_homebrew() {
echo -n Checking homebrew... if ! command -v brew > /dev/null; then
if command -v brew > /dev/null; then
echo -n already installed...
else
echo -n installing...
NONINTERACTIVE=1 /bin/bash -c "$( NONINTERACTIVE=1 /bin/bash -c "$(
curl \ curl \
--fail \ --fail \
@ -15,31 +11,21 @@ install_homebrew() {
https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh
)" )"
fi fi
echo done
} }
install_shared_brew_packages() { install_shared_applications() {
echo -n Checking shared brew packages... brew install direnv fzf git stow the_silver_searcher tmux \
missing_packages=$( vim zsh rbenv ruby-build tfenv nodenv node-build tig libpq gnupg llvm \
comm -23 <(cat packages-shared-brew.txt) <(brew list | sort) \ awscli cmake jq watch gh nvim openssl@1.1 openssl@3 readline libyaml gmp \
| tr "\n" " " pyenv ripgrep
)
if [[ -z $missing_packages ]]; then install_fzf
echo -n already installed... install_rust
else install_vim
echo -n installing $missing_packages...
brew install $missing_packages
fi
echo done
} }
install_alacritty() { install_alacritty() {
echo -n Checking Alacritty... if ! command -v alacritty > /dev/null; then
if command -v alacritty > /dev/null; then
echo -n already installed...
else
echo -n installing...
cargo install alacritty cargo install alacritty
curl \ curl \
@ -59,15 +45,10 @@ install_alacritty() {
sudo update-desktop-database sudo update-desktop-database
sudo ln -s /home/$USER/.cargo/bin/alacritty /usr/local/bin/alacritty sudo ln -s /home/$USER/.cargo/bin/alacritty /usr/local/bin/alacritty
fi fi
echo done
} }
install_alacritty_terminfo() { install_alacritty_terminfo() {
echo -n Checking Alacritty terminfo... if ! infocmp alacritty > /dev/null; then
if infocmp alacritty > /dev/null; then
echo -n already installed...
else
echo -n installing...
curl \ curl \
--fail \ --fail \
--location \ --location \
@ -76,15 +57,10 @@ install_alacritty_terminfo() {
sudo tic -xe alacritty,alacritty-direct /tmp/alacritty.info sudo tic -xe alacritty,alacritty-direct /tmp/alacritty.info
fi fi
echo done
} }
install_tmux_terminfo() { install_tmux_terminfo() {
echo -n Checking Tmux terminfo... if ! infocmp tmux-256color > /dev/null; then
if infocmp tmux-256color > /dev/null; then
echo -n already installed...
else
echo -n installling....
curl \ curl \
--fail \ --fail \
--location \ --location \
@ -98,30 +74,18 @@ install_tmux_terminfo() {
sudo tic -xe tmux-256color tmux-256color.src sudo tic -xe tmux-256color tmux-256color.src
popd popd
fi fi
echo done
} }
install_fzf() { install_fzf() {
echo -n Checking fzf... $(brew --prefix)/opt/fzf/install \
if [[ $PATH =~ "fzf" ]]; then --xdg \
echo -n already installed... --no-update-rc \
else --key-bindings \
echo -n installing... --completion
$(brew --prefix)/opt/fzf/install \
--xdg \
--no-update-rc \
--key-bindings \
--completion
fi
echo done
} }
install_rust() { install_rust() {
echo -n Checking Rust... if ! command -v rustup > /dev/null; then
if command -v rustup > /dev/null; then
echo -n already installed...
else
echo -n installing...
curl \ curl \
--fail \ --fail \
--proto '=https' \ --proto '=https' \
@ -131,83 +95,13 @@ install_rust() {
https://sh.rustup.rs \ https://sh.rustup.rs \
| sh -s -- -y --no-modify-path | sh -s -- -y --no-modify-path
fi fi
echo done
} }
install_linux_packagges() { install_vim() {
echo -n Checking Linux packages... if ! test -d ~/.local/share/nvim/site > /dev/null; then
packages=$(cat packages-linux-apt.txt | tr "\n" " ") git clone --depth 1 https://github.com/wbthomason/packer.nvim \
if dpkg -s $packages >/dev/null 2>&1; then ~/.local/share/nvim/site/pack/packer/start/packer.nvim
echo -n already installed...
else
echo -n installing...
sudo apt-get install --assume-yes $packages
fi fi
echo done
}
install_darwin_brew_packages() {
echo -n Checking Darwin brew packages...
missing_packages=$(
comm -23 <(cat packages-darwin-brew.txt) <(brew list | sort) \
| tr "\n" " "
)
if [[ -z $missing_packages ]]; then
echo -n already installed...
else
echo -n installing $missing_packages...
brew install --cask $missing_packages
fi
echo done
}
install_darwin_brew_cask_packages() {
echo -n Checking Darwin brew cask packages...
missing_packages=$(
comm -23 <(cat packages-darwin-brew-cask.txt) <(brew list | sort) \
| tr "\n" " "
)
if [[ -z $missing_packages ]]; then
echo -n already installed...
else
echo -n installing $missing_packages...
brew install --cask $missing_packages
fi
echo done
}
install_color_default() {
echo -n Checking color default file...
if [[ -f $HOME/.config/atomaka/color.yml ]]; then
echo -n already installed...
else
echo -n installing....
$HOME/dotfiles/bin/bin/toggle-color-mode
fi
echo done
}
install_darwin_profile_hack() {
echo -n Checking profile hack...
if [[ ! -f /etc/zprofile ]]; then
echo -n already installled...
else
echo -n installing...
sudo mv /etc/{zprofile,zprofile.old}
fi
}
install_env() {
echo -n Checking zshenv available...
if [[ -z $HOMEBREW_PREFIX ]]; then
echo -n already installed...
else
echo -n installling...
source ~/dotfiles/zsh/.zshenv
fi
echo done
} }
install_linux() { install_linux() {
@ -216,26 +110,34 @@ install_linux() {
exit 1 exit 1
fi fi
install_linux_packagges packages="build-essential procps curl file git cmake pkg-config\
libfreetype6-dev libfontconfig1-dev libxcb-xfixes0-dev\
libxkbcommon-dev python3 libssl-dev xclip"
dpkg -s $packages >/dev/null 2>&1 \
|| sudo apt-get install --assume-yes $packages
install_homebrew install_homebrew
install_env source ~/dotfiles/zsh/.zshenv
install_shared_brew_packages install_shared_applications
install_fzf
install_rust # gui
install_alacritty install_alacritty
install_alacritty_terminfo install_alacritty_terminfo
} }
install_darwin() { install_darwin() {
install_darwin_profile_hack
install_homebrew install_homebrew
install_env [[ -f /etc/zprofile ]] && sudo mv /etc/{zprofile,zprofile.old}
install_shared_brew_packages source ~/dotfiles/zsh/.zshenv
install_fzf install_shared_applications
install_rust
softwareupdate --install-rosetta --agree-to-license softwareupdate --install-rosetta --agree-to-license
install_darwin_brew_packages brew install coreutils gnu-sed session-manager-plugin orbstack
install_darwin_brew_cask_packages
# gui
brew install --cask rectangle slack google-chrome alacritty telegram \
discord element brave-browser zoom notion
install_tmux_terminfo install_tmux_terminfo
} }
@ -253,7 +155,7 @@ main() {
stow alacritty bin git nvim ruby tmux zsh stow alacritty bin git nvim ruby tmux zsh
install_color_default $HOME/dotfiles/bin/bin/toggle-color-mode
} }
main main

View file

@ -1,11 +0,0 @@
alacritty
brave-browser
discord
element
firefox
google-chrome
notion
rectangle
slack
telegram
zoom

View file

@ -1,4 +0,0 @@
coreutils
gnu-sed
orbstack
session-manager-plugin

View file

@ -1,14 +0,0 @@
build-essential
cmake
curl
file
git
libfontconfig1-dev
libfreetype6-dev
libssl-dev
libxcb-xfixes0-dev
libxkbcommon-dev
pkg-config
procps
python3
xclip

View file

@ -1,33 +0,0 @@
awscli
bzip2
chruby
cmake
direnv
fontconfig
fzf
gh
git
gmp
gnupg
jq
libpq
libyaml
llvm
neovim
node-build
nodenv
openssl@1.1
openssl@3
pyenv
readline
ripgrep
rtx
ruby-build
stow
tfenv
the_silver_searcher
tig
tmux
vim
watch
zsh

View file

@ -28,8 +28,19 @@ if which direnv > /dev/null; then
eval "$(direnv hook zsh)" eval "$(direnv hook zsh)"
fi fi
if which rtx > /dev/null; then if which rbenv > /dev/null; then
eval "$(rtx activate zsh)" eval "$(rbenv init --no-rehash -)"
(rbenv rehash &) 2> /dev/null
fi
if which nodenv > /dev/null; then
eval "$(nodenv init --no-rehash -)"
(nodenv rehash &) 2> /dev/null
fi
if which pyenv > /dev/null; then
eval "$(pyenv init --no-rehash -)"
(pyenv rehash &) 2> /dev/null
fi fi
if [ -f $HOME/.orbstack/shell/init.zsh ]; then if [ -f $HOME/.orbstack/shell/init.zsh ]; then

View file

@ -80,14 +80,6 @@ function git-root {
fi fi
} }
function install-ruby {
if [ $# -eq 0 ]; then
echo Usage: install-ruby RUBY_VERSION
else
ruby-build $1 $HOME/.rubies/$1
fi
}
function password-generator { function password-generator {
if [ -x "$(command -v openssl)" ]; then if [ -x "$(command -v openssl)" ]; then
password=$( password=$(

View file

@ -7,6 +7,11 @@ XDG_CONFIG_HOME="$HOME/.config"
PERSONAL_BIN_PATH="$HOME/bin" PERSONAL_BIN_PATH="$HOME/bin"
PERSONAL_FPATH="$ZDOTDIR/completions" PERSONAL_FPATH="$ZDOTDIR/completions"
NODENV_PATH="$HOME/.nodenv/bin"
RBENV_PATH="$HOME/.rbenv/bin"
TFENV_PATH="$HOME/.tfenv/bin"
PYENV_PATH="$HOME/.pyenv/bin"
CARGO_PATH="$HOME/.cargo/bin" CARGO_PATH="$HOME/.cargo/bin"
if [[ "$OSTYPE" == darwin* ]]; then if [[ "$OSTYPE" == darwin* ]]; then
@ -40,6 +45,10 @@ elif [[ "$OSTYPE" == linux* ]]; then
INFOPATH="/home/linuxbrew/.linuxbrew/share/info:${INFOPATH:-}"; INFOPATH="/home/linuxbrew/.linuxbrew/share/info:${INFOPATH:-}";
fi fi
[[ -d "$RBENV_PATH" ]] && PATH="$RBENV_PATH:$PATH"
[[ -d "$NODENV_PATH" ]] && PATH="$NODENV_PATH:$PATH"
[[ -d "$TFENV_PATH" ]] && PATH="$TFENV_PATH:$PATH"
[[ -d "$PYENV_PATH" ]] && PATH="$PYENV_PATH:$PATH"
[[ -d "$CARGO_PATH" ]] && PATH="$CARGO_PATH:$PATH" [[ -d "$CARGO_PATH" ]] && PATH="$CARGO_PATH:$PATH"
[[ -d "$PERSONAL_BIN_PATH" ]] && PATH="$PERSONAL_BIN_PATH:$PATH" [[ -d "$PERSONAL_BIN_PATH" ]] && PATH="$PERSONAL_BIN_PATH:$PATH"
[[ -d "$PERSONAL_FPATH" ]] && FPATH="$PERSONAL_FPATH:$FPATH" [[ -d "$PERSONAL_FPATH" ]] && FPATH="$PERSONAL_FPATH:$FPATH"