This commit is contained in:
Blake Ridgway 2021-11-16 10:21:59 -06:00
parent 0ac688f05f
commit 2f5da3571a
11 changed files with 355 additions and 202 deletions

View file

@ -1560,7 +1560,7 @@
# - verbose: Enable instant prompt and print a warning when detecting console output during
# zsh initialization. Choose this if you've never tried instant prompt, haven't
# seen the warning, or if you are unsure what this all means.
typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose
typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet
# Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized.
# For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload

View file

@ -1,17 +1,13 @@
## Install
`./install` will run a script that checks what OS you're on, and if you have
all the necessary programs installed. If you dont, it installs them for you!
Once the dependencies are installed, it will run any third party installations,
and create symlinks for the necessary config files in the correct locations.
`./post_install` will run a script that installs the software that I use on
daily basis, and if you have all the necessary programs installed. If you don't, it installs them for you!
Once the dependencies are installed, it will run any third party installations, and create symlinks for the necessary config files in the correct locations.
## Dotfiles
Here's my collection of dotfiles I use on linux/osx environments.
Here's my collection of dotfiles I use on Linux environments.
I continuously add to this repo over time, as I customise my dev environment.
Feel free to fork this and modify the scripts/dotfiles to suit your own needs!
ZSH and Oh-My-Zsh must be installed:
- http://ohmyz.sh/
**Git**
Make sure to edit the gitconfig and add your credentials instead of mine
@ -20,61 +16,3 @@ I use neovim and vim-plug. So if you're using regular vim you might want to
remove the neovim specific plugins from my vimrc. Also, you might need to run
:PlugClean to remove the plugin directories then run :PlugInstall to reinstall
them.
**NVIM to VIM**
For Linux and macOS, just add the above lines to the top of your ~/.config/nvim/init.vim, or %LOCALAPPDATA%\nvim\init.vim for Windows.
````
set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath=&runtimepath
source ~/.vimrc
````
#### Aliases
Here are the aliases I use in my shell to utilize these scripts. This allows you to save
this folder wherever you want. Just modify the path if you dont clone to your home
directory.
````
alias tmpc='source ~/.dotfiles/scripts/CTemplate.sh'
alias tdev='source ~/.dotfiles/scripts/tmux-dev.sh'
alias project='source ~/.dotfiles/scripts/ProjectLayout.sh'
alias mdtopdf='source ~/.dotfiles/scripts/MDtoPDF.sh'
````
#### MDtoPDF
MDtoPDF Uses **Python Markdown** and **wkhtmltopdf** to convert a markdown file into a pdf
file.
Usage: `mdtopdf <filenamewithoutextension> <optionaldirectory>`
Example: `mdtopdf notes pdf` would convert notes.md to a pdf and save it to the /pdf
directory
This script uses Python Markdown to export the markdown file to an html file, then it uses
wkhtmltopdf to convert the html file to a pdf. It can take a little time to convert to
PDF, but is a lot simpler than using pandoc in my opinion.
* https://pythonhosted.org/Markdown/install.html
Install (Requires Python):
`$ sudo pip install markdown`
* http://wkhtmltopdf.org/
Install:
`$ sudo apt-get install wkhtmltopdf`
#### ProjectLayout.sh
* Creates a file system structure to begin a project. The Makefile in files/ is really
only setup for C at the moment. Edit it based on the project's needs.
#### Tmux-Dev.sh
This is a simple script I made to setup a tmux environment, it looks like this when its
running. I usually have code open in vim on the left, a man page or other code open in the
bottom right corner, and use the top right for running commands and compiling on the go.
![tmux](files/tmux.png)
#### CTemplate.sh
This script copies a skeleton C file to either your current directory or one you provide.
This could also just be done with a copy alias. I use a script so I can provide a custom
file name/directory.
* Usage: `~/.dotfiles/scripts/CTemplate.sh <Directory/Filename>`

View file

@ -7,25 +7,24 @@ alias e="$EDITOR"
alias v="$VISUAL"
alias tmux='tmux -u'
# checks if on linux or OSX for open command
if [ "$(uname)" = "Linux" ]; then
alias open="xdg-open"
alias say='echo "$*" | espeak -s 120 2>/dev/null'
alias cpwd='pwd|tr -d "\n"|xclip'
else
# OSX
alias cpwd='pwd|tr -d "\n"|pbcopy'
fi
# top
alias cpu='top -o CPU'
alias mem='top -o MEM'
# Get your current public IP
alias ip="curl icanhazip.com"
alias ip6="wget -q0- -ti -T2 ipv6.icanhazip.com"
# list TODO/FIX lines from the current project
alias todos="ag --nogroup '(TODO|FIX(ME)?):'"
# Git
alias ga="git add"
alias gaa="git add ."
alias gc="git commit -m "
alias gp='git push -u origin "$(git symbolic-ref --short HEAD)"'
alias gs="git status"
alias nah="git reset --hard; git clean -df;"
alias grr="git remote remove origin"
alias gra="git remote add origin "
alias clonerepo="git fetch --all && git pull --all && git clone-branches"
# Bandwhich
alias band="sudo ~/.cargo/bin/bandwhich"
@ -56,33 +55,6 @@ alias rcc="rustc"
# Pretty print the path
alias path='echo $PATH | tr -s ":" "\n"'
# Scripts Aliases
alias tmpc='source ~/.scripts/CTemplate.sh'
alias project='source ~/dotfiles/scripts/ProjectLayout.sh'
alias mdtopdf='source ~/.scripts/MDtoPDF.sh'
# Tmux Aliases
alias tdev='source ~/dotfiles/scripts/tmux-dev.sh'
alias tls='tmux ls'
tnew() {
if [ "$1" != "" ]
then
tmux new -s $1
else
tmux
fi
}
tatt() {
if [ "$1" != "" ]
then
tmux attach -t $1
else
tmux attach
fi
}
# Configuration Reloads
alias tmuxreload='source ~/.tmux.conf'
alias zshreload='source ~/.zshrc'
@ -90,43 +62,11 @@ alias zshreload='source ~/.zshrc'
# SSH
# alias sshwork='ssh bridgway@0.0.0.0'
# Logbook
lbt() {
nvim -c ":VimwikiMakeDiaryNote"
}
lby() {
nvim -c ":VimwikiMakeYesterdayDiaryNote"
}
lbi() {
nvim -c ":VimwikiDiaryIndex"
}
wiki() {
nvim -c ":VimwikiIndex"
}
swiki() {
nvim -c ":VimwikiSearch $*"
}
# nvim
alias vim=nvim
alias vi=nvim
# Configuration
alias vimrc='nvim ~/.vimrc'
alias ealias='nvim ~/dotfiles/aliases.zsh'
alias zshrc='nvim ~/.zshrc'
ycmcomp() {
cp ~/.dotfiles/templates/_ycm_extra_conf.py ./.ycm_extra_conf.py
}
alias fv='vim $(fzf --height 40%)'
alias eclim='/Applications/Eclipse.app/Contents/Eclipse/eclimd > /dev/null 2>&1 &'
# Docker-Compose Commands
alias dce='docker-compose exec --user $(id -u):$(id -g)'
alias dc='docker-compose'

150
dotfiles/post_install Executable file
View file

@ -0,0 +1,150 @@
#!/usr/bin/env bash
# A script for setting up post install
# Relies on Flatpak to be installed
# Created by Blake Ridgway
git submodule init
git submodule update --recursive
PACKAGE_LIST=(
dialog
discord
htop
neofetch
neovim
openjdk-11-jre
python3
python3-pip
solaar
steam
system76-keyboard-configurator
tilix
libvirt-daemon-driver-lxc
virt-manager
vlc
zsh
)
FLATPAK_LIST=(
com.github.fabiocolacio.marker
com.mattermost.Desktop
com.mojang.Minecraft
com.obsproject.Studio
net.veloren.Airshipper
)
echo #######################
echo # Installing Packages #
echo #######################
# iterate through package and installs them
for package_name in ${PACKAGE_LIST[@]}; do
if ! sudo apt list --installed | grep -q "^\<$package_name\>"; then
echo "Installing $package_name..."
sleep .5
sudo apt install "$package_name" -y
echo "$package_name has been installed"
else
echo "$package_name already installed"
fi
done
for flatpak_name in ${FLATPAK_LIST[@]}; do
if ! flatpak list | grep -q $flatpak_name; then
flatpak install "$flatpak_name" -y
else
echo "$package_name already installed"
fi
done
echo #####################
echo # Install Nerd Font #
echo #####################
# Nerd Font install
wget https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/Hack/Regular/complete/Hack%20Regular%20Nerd%20Font%20Complete.ttf
mkdir -p ~/.local/share/fonts
cp Hack\ Regular\ Nerd\ Font\ Complete.ttf ~/.local/share/fonts/
fc-cache -f -v
echo ##################################
echo # Downloading and Configuring Go #
echo ##################################
# Grabs and downloads Go for Google
wget https://golang.org/dl/go1.17.2.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.17.2.linux-amd64.tar.gz
echo ###################
echo # Installing Rust #
echo ###################
# Install Rust
curl https://sh.rustup.rs -sSf | sh
echo ######################
echo # Setting up SSH Key #
echo ######################
# SSH Key Gen
ssh-keygen -t ed25519 -C ${USER}@$(hostname --fqdn)
echo ######################
echo # Installing OhMyZSH #
echo ######################
# Oh-my-ZSH
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
echo ############################
echo # Setting up Powerlevel10k #
echo ############################
# POWERLEVEL10K
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
echo ##################################
echo # Copying p10k Config file to ~/
echo ##################################
# Copy p10k Config file
cp .p10k.zsh ~/
echo ############################
echo # Setting up nvim/init.vim #
echo ############################
mkdir -p ~/.config/nvim/
echo $'set runtimepath^=~/.vim runtimepath+=~/.vim/after\nlet &packpath=&runtimepath\nsource ~/.vimrc' > ~/.config/nvim/init.vim
# wget https://github.com/OrangeDrangon/android-messages-desktop/releases/download/v5.1.1/AndroidMessages-v5.1.1-linux-amd64.deb
echo #######################
echo # Cleanup and Updates #
echo #######################
sudo apt update
sudo apt upgrade -y
sudo apt autoremove -y
flatpak update
echo ################
echo # File Cleanup #
echo ################
rm -r *.ttf *.tar.gz
FILES=( 'vimrc' 'vim' 'zshrc' 'zsh' 'agignore' 'gitconfig' 'gitignore' 'gitmessage' )
for file in ${FILES[@]}; do
echo ""
echo "Simlinking $file to $HOME"
ln -sf "$PWD/$file" "$HOME/.$file"
if [ $? -eq 0 ]
then
echo "$PWD/$file ~> $HOME/.$file"
else
echo 'Install failed to symlink.'
exit 1
fi
done

178
dotfiles/post_install_fed Normal file
View file

@ -0,0 +1,178 @@
#!/usr/bin/env bash
# A script for setting up post install
# Relies on Flatpak to be installed
# Created by Blake Ridgway
# Setup all System76 Software
sudo dnf copr enable szydell/system76
sudo dnf install system76-dkms system76-power system76-driver system76-firmware firmware-manager system76-io-dkms system76-acpi-dkms
sudo systemctl enable system76-power system76-power-wake system76-firmware-daemon
sudo systemctl start system76-power system76-firmware-daemon
systemctl enable --user com.system76.FirmwareManager.Notify.timer
# Verify flatpak is engaged properly
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
PACKAGE_LIST=(
dialog
git
htop
neofetch
neovim
java-11-openjdk
python3
python3-pip
solaar
tilix
virt-manager
vlc
zsh
)
FLATPAK_LIST=(
com.discordapp.Discord
com.github.fabiocolacio.marker
com.mattermost.Desktop
com.mojang.Minecraft
com.obsproject.Studio
com.valvesoftware.Steam
)
echo #######################
echo # Installing Packages #
echo #######################
# iterate through package and installs them
for package_name in ${PACKAGE_LIST[@]}; do
if ! sudo dnf list --installed | grep -q "^\<$package_name\>"; then
echo "Installing $package_name..."
sleep .5
sudo dnf install "$package_name" -y
echo "$package_name has been installed"
else
echo "$package_name already installed"
fi
done
for flatpak_name in ${FLATPAK_LIST[@]}; do
if ! flatpak list | grep -q $flatpak_name; then
flatpak install "$flatpak_name" -y
else
echo "$package_name already installed"
fi
done
git submodule init
git submodule update --recursive
echo ############
echo # Protonup #
echo ############
pip3 install protonup
echo #####################
echo # Install Nerd Font #
echo #####################
# Nerd Font install
wget https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/Hack/Regular/complete/Hack%20Regular%20Nerd%20Font%20Complete.ttf
mkdir -p ~/.local/share/fonts
cp Hack\ Regular\ Nerd\ Font\ Complete.ttf ~/.local/share/fonts/
fc-cache -f -v
echo ##################################
echo # Downloading and Configuring Go #
echo ##################################
# Grabs and downloads Go for Google
wget https://golang.org/dl/go1.17.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.17.linux-amd64.tar.gz
echo ###################
echo # Installing Rust #
echo ###################
# Install Rust
curl https://sh.rustup.rs -sSf | sh
echo ######################
echo # Setting up SSH Key #
echo ######################
# SSH Key Gen
ssh-keygen -t ed25519 -C ${USER}@$(hostname --fqdn)
echo ######################
echo # Installing OhMyZSH #
echo ######################
# Oh-my-ZSH
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
echo ############################
echo # Setting up Powerlevel10k #
echo ############################
# POWERLEVEL10K
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
echo ##################################
echo # Copying p10k Config file to ~/
echo ##################################
# Copy p10k Config file
cp .p10k.zsh ~/
echo ############################
echo # Setting up nvim/init.vim #
echo ############################
mkdir -p ~/.config/nvim/
echo $'set runtimepath^=~/.vim runtimepath+=~/.vim/after\nlet &packpath=&runtimepath\nsource ~/.vimrc' > ~/.config/nvim/init.vim
echo #######################
echo # Cleanup and Updates #
echo #######################
sudo dnf update
flatpak update
echo ################
echo # File Cleanup #
echo ################
rm -r *.ttf *.tar.gz *.rpm
FILES=( 'vimrc' 'vim' 'zshrc' 'zsh' 'agignore' 'gitconfig' 'gitignore' 'gitmessage' 'aliases' )
for file in ${FILES[@]}; do
echo ""
echo "Simlinking $file to $HOME"
ln -sf "$PWD/$file" "$HOME/.$file"
if [ $? -eq 0 ]
then
echo "$PWD/$file ~> $HOME/.$file"
else
echo 'Install failed to symlink.'
exit 1
fi
done
# Enable RPM Fusion
# Run in Bash as Zsh cannot do `$(rpm -E %fedora)`
sudo dnf install \
https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install \
https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
# EXECUTE LAST SO NOTHING BREAKS
# Enable Mesa aco
sudo dnf copr enable gloriouseggroll/mesa-aco
# Enable fsync kernel
sudo dnf copr enable sentry/kernel-fsync
sudo dnf update --refresh

View file

@ -78,6 +78,13 @@ call plug#begin('~/.vim/plugged/')
Plug 'artur-shaik/vim-javacomplete2'
Plug 'dansomething/vim-eclim'
if has('nvim')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
else
Plug 'Shougo/deoplete.nvim'
Plug 'roxma/nvim-yarp'
endif
Plug 'Shougo/neosnippet'
Plug 'Shougo/neosnippet-snippets'

View file

@ -110,9 +110,9 @@ function code {
open -a "Visual Studio Code" "$argPath"
fi
}
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"
# export PATH="$HOME/.rbenv/bin:$PATH"
# eval "$(rbenv init -)"
# export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

View file

@ -1,11 +0,0 @@
#/bin/bash
# Grabs and downloads Go for Google
wget https://golang.org/dl/go1.16.4.linux-amd64.tar.gz
# Untar's the file just recently downloaded
sudo tar -C /usr/local -xzf go1.16.4.linux-amd64.tar.gz
# Exports the GOPATH
export PATH=$PATH:/usr/local/go/bin

View file

@ -1,12 +0,0 @@
# Ruby & rbenv Installation
There is currently two parts to get this to work.
`install` & `rbenv-install`
The first part that needs to be ran is `install`. This will install the
requirements needed to complete the installation with `rbenv-install`.
# Disclaimer
This is currently **ONLY** set to work with zsh.

View file

@ -1,20 +0,0 @@
sudo apt install curl
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update
sudo apt-get install git-core zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev nodejs yarn
cd
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(rbenv init -)"' >> ~/.zshrc
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.zshrc
echo "#####################################################"
echo "# Please restart your shell or run 'exec $SHELL' #"
echo "# Then run the second script. rbenv-install #"
echo "#####################################################"

View file

@ -1,17 +0,0 @@
#!/bin/bash
# Installs rbenv
rbenv install 3.0.1
rbenv global 3.0.1
ruby -v
# Insalls Bundler
gem install bundler
rbenv rehash
# Installs Rails Version 6.
gem install rails -v 6.1.3.2
rbenv rehash