diff --git a/.gitignore b/.gitignore index 8df2436..b76e8cf 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ log/ *.zwc *.zwc.old prezto/ +tmux/t-theme/ diff --git a/bash.sh b/bash.sh new file mode 100755 index 0000000..d5385d0 --- /dev/null +++ b/bash.sh @@ -0,0 +1,10 @@ +#!/bin/bash +#download sensible bash if it doesnt exist +if [ ! -f ~/.sensible.bash ]; then + wget -O "$HOME/.sensible.bash" https://raw.githubusercontent.com/mrzool/bash-sensible/master/sensible.bash +fi + +#inject source line into bashrc +if ! grep -q ".sensible.bash" "$HOME/.bashrc"; then + echo "source \"\$HOME/.sensible.bash\"" >> "$HOME/.bashrc" +fi diff --git a/bash/.bash_aliases b/bash/.bash_aliases new file mode 100644 index 0000000..1d3a100 --- /dev/null +++ b/bash/.bash_aliases @@ -0,0 +1,35 @@ +#Readability aliases +if which exa > /dev/null; then + alias lss='exa -alh' +else + alias lss='ls -alh --color=auto' +fi +alias mount='mount |column -t' +alias df='df -H -x squashfs -x tmpfs -x devtmpfs' +alias bat=batcat +alias ncdu='ncdu --color dark' + +#Shell Function aliases +alias dirs="dirs -v" +alias h='history' +alias jb='jobs -l' +alias reload=". ~/.bashrc" + +#shortcuts aliases +alias please="sudo !!" +alias ping='ping -c 5' +alias ax="chmod a+x" +alias wmip="curl icanhazip.com" + +#git aliases +alias gitS='git status' +alias gitL='git log' +alias gitD='git diff' +alias gitC='git commit -a' + +#Apt aliases +alias aptup="sudo apt update && sudo apt full-upgrade" +alias aptrm="sudo apt autoremove && sudo apt autoclean" + +#ssh aliases +alias sagent="eval `ssh-agent`" diff --git a/init.sh b/init.sh index 5f7e175..fddf0cb 100755 --- a/init.sh +++ b/init.sh @@ -6,23 +6,20 @@ if [[ $answer = "U" ]] || [[ $answer = "u" ]]; then elif [[ $answer = "O" ]] || [[ $answer = "o" ]]; then bash odeps.sh else - echo "Aborting!" - exit 1 + echo "Skipping!" fi -#setup prezto +#setup shell +bash bash.sh echo "Select which shell to configure and use: zsh/fish/bash"; read -r answer if [[ $answer = "zsh" ]] || [[ $answer = "z" ]]; then - echo "Initializing ZSH" - sh -c "$(curl -fsSL https://raw.githubusercontent.com/zdharma/zinit/master/doc/install.sh)" -#This will install Zinit in ~/.zinit/bin. .zshrc will be updated with three lines of code that will be added to the bottom. The lines will be sourcing zinit.zsh and setting up completion for command zinit. After installing and reloading the shell compile Zinit with zinit self-update. - zinit self-update - zinit update - chsh -s /bin/zsh + echo "Initializing Prezto" + zsh prezto.zsh + chsh -s /usr/bin/zsh elif [[ $answer = "fish" ]] || [[ $answer = "f" ]]; then echo "Installing Oh-My-Fish" bash fish.sh - chsh -s /bin/fish + chsh -s /usr/bin/fish else echo "Guess we're sticking with default bash then..." fi @@ -30,13 +27,15 @@ fi #create symlinks using stow mkdir ~/.ssh echo "Stowing Configs" +stow bash stow tmux +#init TMP + git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm stow vim stow zsh stow config chmod 0700 ~/.ssh chmod -R 0600 ~/.ssh/* -#cp "$HOME/stevset/mc" "$HOME/.config/mc" #Configure git user echo -n "Would you like to configure your git name and email? (y/n) => "; read -r answer @@ -48,22 +47,15 @@ if [[ $answer = "Y" ]] || [[ $answer = "y" ]]; then fi #install spacevim -if [ ! -e ~/.space-vim ] -then - mv "$HOME/.vim" "$HOME/vim_bk" - mv "$HOME/.vimrc" "$HOME/vimrc_bk" +if [ ! -e ~/.space-vim ]; then echo "Install SpaceVim now? y/n"; read -r answer if [[ $answer = "Y" ]] || [[ $answer = "y" ]]; then + mv "$HOME/.vim" "$HOME/vim_bk" + mv "$HOME/.vimrc" "$HOME/vimrc_bk" (curl -sLf https://spacevim.org/install.sh | bash) fi fi -# #install Emacs Doom -# echo "Install Emacs Doom now? y/n"; read -r answer -# if [[ $answer = "Y" ]] || [[ $answer = "y" ]]; then -# ./emacs_doom.sh -# fi -###Doom's requirements are outside the scope of Ubuntu 20.04LTS echo "*******************************" echo "* Restart your terminal *" echo "*******************************" diff --git a/prezto.zsh b/prezto.zsh new file mode 100755 index 0000000..a539428 --- /dev/null +++ b/prezto.zsh @@ -0,0 +1,21 @@ +#!/bin/zsh +#Initializes Prezto +git clone --recursive -j 4 https://github.com/steveokard/prezto.git "$HOME/stevset/prezto/.zprezto" + +#Remove old stuff +echo "....Creating symlinks" +rm -rf ~/.zshrc ~/.zsh ~/.zprofile ~/.zlogin ~/.zlogout ~/.zpreztorc ~/.zshenv + +#Make Environment Links, per github readme +setopt EXTENDED_GLOB +for rcfile in "${ZDOTDIR:-$HOME}"/stevset/prezto/.zprezto/runcoms/^README.md(.N); do + ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}" + done + +#setup theme +echo "remember to run p10k configure to configure the theme!" +#ln -s $HOME/.zprezto/modules/prompt/external/powerlevel10k/prompt_powerlevel10k_setup $HOME/.zprezto/modules/prompt/functions/prompt_powerlevel10k_setup + +#finally, fix permissions to avoid compaudit flag +chmod -R go-w ~/.zprezto + diff --git a/scripts/fonts.sh b/scripts/fonts.sh index 51836c1..608d2ea 100755 --- a/scripts/fonts.sh +++ b/scripts/fonts.sh @@ -1,9 +1 @@ -#!/bin/bash -# clone -git clone https://github.com/powerline/fonts.git --depth=1 -# install -cd fonts -./install.sh -# clean-up a bit -cd .. -rm -rf fonts +echo "visit https://github.com/ryanoasis/nerd-fonts" diff --git a/scripts/preztoUpstream.zsh b/scripts/preztoUpstream.zsh new file mode 100755 index 0000000..c8403b3 --- /dev/null +++ b/scripts/preztoUpstream.zsh @@ -0,0 +1 @@ +git remote add upstream https://github.com/sorin-ionescu/prezto.git diff --git a/scripts/repo2ssh.sh b/scripts/repo2ssh.sh index 573f64a..c1715dc 100755 --- a/scripts/repo2ssh.sh +++ b/scripts/repo2ssh.sh @@ -1,2 +1,7 @@ #this command changes the git repo from HTTPS to SSH so you can use the key instead of typing in your password all the time. -git remote set-url origin git@github.com:steveokard/stevset.git +USER=steveokard +if [ -n "$1" ] +then + git remote set-url origin git@github.com:$USER/$1.git + git remote -v +fi diff --git a/spacemacs.zsh b/spacemacs.zsh index fe7f132..9bcbb93 100755 --- a/spacemacs.zsh +++ b/spacemacs.zsh @@ -1,16 +1,15 @@ #!/bin/zsh #This will install Spacemacs (again) #cleanup -echo "Removing old emacs" -if [ -e ~/.emacs.d/] - then - mv ~/.emacs.d ~/doom.d +if [ -d "$HOME/.emacs.d" ]; then + echo "Moved Doom Config" + mv ~/.emacs.d ~/doom.d fi #Select Stable or Develop -read -p "Should we use the development version of emacs?" dist -if [[ $dist = y ]] then +if read -q "REPLY?Should we use the development version of emacs? \n"; then git clone -b develop https://github.com/syl20bnr/spacemacs ~/.emacs.d else git clone https://github.com/syl20bnr/spacemacs ~/.emacs.d fi + diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index ec721b4..130bc09 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -1,37 +1,21 @@ -# -- general ------------------------------------------------------------------- -set -g default-terminal "screen-256color" # colors! -set -g xterm-keys on +#Tmux Plugins +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'wfxr/tmux-power' +set -g @plugin 'tmux-plugins/tmux-prefix-highlight' +set -g @plugin 'CrispyConductor/tmux-copy-toolkit' +set -g @plugin 'tmux-plugins/tmux-pain-control' +# -- general +set -g xterm-keys on # remap prefix to Control + a set -g prefix C-a unbind C-b bind C-a send-prefix -set -sg escape-time 0 #Mouse/Scrollback Tweaks -set -g history-limit 100000 -#setw -g mode-keys vi set-option -g mouse on set-window-option -g xterm-keys on -#set-option -g pane-active-border-fg yellow - -#New Keybindings -bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded" - -# split panes using | and - -bind | split-window -h -bind - split-window -v -unbind '"' -unbind % - -# switch panes using Alt-arrow without prefix -bind -n M-Left select-pane -L -bind -n M-Right select-pane -R -bind -n M-Up select-pane -U -bind -n M-Down select-pane -D - -# For nested tmux'es -bind a send-prefix #Powerline Settings run-shell "powerline-daemon -q" @@ -60,4 +44,15 @@ bind m \ bind M \ set-option -g mouse off \;\ display 'Mouse: OFF' +#plugin settings +# Prefix Highlight: 'L' for left only, 'R' for right only and 'LR' for both +set -g @tmux_power_prefix_highlight_pos 'LR' +run-shell "$HOME/.tmux/plugins/tmux-prefix-highlight/prefix_highlight.tmux" +#Themes +set -g @tmux_power_theme 'default' +run-shell "$HOME/.tmux/plugins/tmux-power/tmux-power.tmux" +#Pain Control +run-shell "$HOME/.tmux/plugins/tmux-pain-control/pain_control.tmux" +#init tmux plugin manager (keep this line at the very bottom of tmux.conf) +run '~/.tmux/plugins/tpm/tpm' diff --git a/udeps.sh b/udeps.sh index 8b0d8e2..7b7211f 100755 --- a/udeps.sh +++ b/udeps.sh @@ -1,8 +1,19 @@ #!/bin/bash #These are the programs I expect to find on any install +function dpkg_url() { + local tmp_deb="$(mktemp)" + local src_url=$1 + local args=${@:2} -echo "installing base dependencies" -sudo apt-get -my install git \ + wget -O $tmp_deb $src_url && + sudo dpkg -i $tmp_deb $args && + { rm -f $tmp_deb; true; } || # commands above succeeded, remove tmp file + { rm -f $tmp_deb; false; } # commands above failed, remove tmp file anyway +} + +# installing base dependencies +sudo apt-get -my install \ + git \ stow \ etckeeper \ tmux \ @@ -13,16 +24,40 @@ sudo apt-get -my install git \ mc \ curl \ aptitude \ - tree \ - ack + nnn \ + ack \ + fzf \ + ripgrep \ + grc \ + fd-find \ + ncdu -read -n1 -p $'Does this system need ssh access?\n' REPLY +read -n1 -p $'Does this system need a ssh server?\n' REPLY if [[ $REPLY == [Yy] ]]; then - sudo apt-get install openssh-server + sudo apt-get install openssh-server fail2ban fi read -n1 -p $'\nDoes this system have a GUI?\n' REPLY if [[ $REPLY == [Yy] ]]; then - sudo apt-get install synaptic - # else - # sudo apt-get install emacs-nox + sudo apt-get install synaptic emacs vim-gtk3 + else + sudo apt-get install emacs-nox fi +#Fix stupid Rust issue +if [ -f "/usr/.crates2.json" ]; then + sudo sed -i '/crates2/d' /var/lib/dpkg/info/ripgrep.list + sudo rm -f /usr/.crates2.json + sudo apt-get -my install bat + sudo sed -i '/crates2/d' /var/lib/dpkg/info/bat.list + sudo rm -f /usr/.crates2.json +fi + +#This section installs software outside apt + +#select exa or lsd +if [[ ! "which exa > /dev/null" ]]; then +dpkg_url http://mirrors.kernel.org/ubuntu/pool/universe/r/rust-exa/exa_0.9.0-4_amd64.deb +# wget https://github.com/Peltoche/lsd/releases/download/0.20.1/lsd_0.20.1_amd64.deb; sudo dpkg -i ./lsd_0.20.1_amd64.deb; rm lsd_0.20.1_amd64.deb +dpkg_url https://github.com/muesli/duf/releases/download/v0.6.2/duf_0.6.2_linux_amd64.deb +dpkg_url https://github.com/ClementTsang/bottom/releases/download/0.6.1/bottom_0.6.1_amd64.deb +#https://github.com/dandavison/delta/releases/download/0.8.0/delta-0.8.0-x86_64-unknown-linux-gnu.tar.gz +fi diff --git a/update.zsh b/update.zsh index 5b01a6b..c9dd278 100755 --- a/update.zsh +++ b/update.zsh @@ -1,12 +1,8 @@ #!/bin/zsh -echo "Remove Doom" -rm -r --interactive=never $HOME/.emacs.d $HOME/.doom.d +#delete current zsh config +ln -s ~/stevset/prezto/.zprezto ~/.zprezto +./udeps.sh +./prezto.zsh -echo "Install zinit" -sh -c "$(curl -fsSL https://raw.githubusercontent.com/zdharma/zinit/master/doc/install.sh)" -#This will install Zinit in ~/.zinit/bin. .zshrc will be updated with three lines of code that wi │ ll be added to the bottom. The lines will be sourcing zinit.zsh and setting up completion for com │ mand zinit. After installing and reloading the shell compile Zinit with zinit self-update. -rm ~/.zshrc ~/.zpreztorc ~/.zlogin ~/.zlogout ~/.zprofile ~/.zshenv -ln -s ~/stevset/zsh/.zshrc ~/.zshrc -ln -s ~/stevset/zsh/aliases.zsh ~/.zsh_aliases -ln -s ~/stevset/zsh/.zprofile ~/.zprofile -source ~/.zshrc +#Tmux Theme +git clone https://github.com/wfxr/tmux-power.git "$HOME/stevset/tmux/t-theme" diff --git a/vim/.spacevim b/vim/.spacevim index b847a46..d5d91a3 100644 --- a/vim/.spacevim +++ b/vim/.spacevim @@ -11,11 +11,11 @@ let g:spacevim_plug_home = '~/.vim/plugged' " Enable the existing layers in space-vim. " Refer to https://github.com/liuchengxu/space-vim/blob/master/layers/LAYERS.md for all available layers. let g:spacevim_layers = [ - \ 'fzf', 'better-defaults', 'which-key', + \ 'fzf', 'better-defaults', 'which-key', 'better-motion', 'airline', 'ctrlp', 'git', \ ] " Uncomment the following line if your terminal(-emulator) supports true colors. -" let g:spacevim_enable_true_color = 1 +let g:spacevim_enable_true_color = 1 " If you want to have more control over the layer, try using Layer command. " if g:spacevim.gui @@ -41,6 +41,6 @@ function! UserConfig() " Adding extras. " Uncomment the following line If you have installed the powerline fonts. " It is good for airline layer. - " let g:airline_powerline_fonts = 1 + let g:airline_powerline_fonts = 1 endfunction