Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Update .zprofile
Update .zshrc
  • Loading branch information
AndreasBackx committed Oct 25, 2023
1 parent d1301e9 commit 879c50c
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 46 deletions.
70 changes: 54 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,6 @@

This repository contains most if not all of the changes made to my machines that run Arch Linux, Fedora, Ubuntu, or CentOS, but primarily Arch Linux as it's what I use on my personal computers. It should support both sway and i3.

## Example `~/.config/chezmoi/chezmoi.toml`

```toml
[data]
[data.monitors]
selected = "home"

[edit]
command = "code"
args = ["--wait"]

[git]
autoCommit = true
autoPush = true
```

## Unstaged File Templates

`.config/.local-variables`
Expand All @@ -28,6 +12,15 @@ selected = "home"
# Optionally name the location of your shell environment.
export ENV_LOCATION=""

# You can use variables from ~/.config/.variables.
export MONITOR_LEFT="$MONITOR_HOME_LEFT"
export MONITOR_CENTER="$MONITOR_HOME_CENTER"
export MONITOR_RIGHT="$MONITOR_HOME_RIGHT"
# export MONITOR_TV="$MONITOR_HOME_TV"
# export MONITOR_LAPTOP=""

# export MONITOR_HOME_CENTER_REFRESH_RATE="144.06"

# If you want to disable the monitors cli.
# export DISABLE_MONITORS="yes"

Expand Down Expand Up @@ -57,13 +50,52 @@ export GITHUB_TOKEN=""
## Installation

```zsh
echo ".cfg" >> .gitignore
git clone --bare [email protected]:AndreasBackx/dotfiles.git $HOME/.cfg
alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
mkdir -p .config-backup
config checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | xargs -I{} mv {} .config-backup/{}
config checkout
config config --local status.showUntrackedFiles no

touch ~/.config/.secrets
touch ~/.config/.local-variables

source ~/.zprofile
source ~/.zshenv
source ~/.zshrc

# Homebrew
git clone https://github.com/Homebrew/brew ~/.homebrew
brew update

# oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --keep-zshrc

# spaceship-prompt
git clone [email protected]:denysdovhan/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt" --depth=1
ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme"

# starship-prompt (for non-zsh)
curl -sS https://starship.rs/install.sh | sh

# zsh-autosuggestions
git clone [email protected]:zsh-users/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
chmod 755 ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions -R

# zsh-syntax-highlighting
git clone [email protected]:zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
chmod 755 ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting -R

# zsh-completions
git clone [email protected]:zsh-users/zsh-completions ${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions

# zsh-autocomplete
git clone [email protected]:marlonrichert/zsh-autocomplete ${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-autocomplete

# autoupdate
git clone [email protected]:TamCore/autoupdate-oh-my-zsh-plugins.git ${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/autoupdate

# fzf
## Arch Linux
paru -S fzf
Expand All @@ -74,6 +106,12 @@ sudo apt-get install fzf
## MacOS
brew install fzf

# pyenv
git clone [email protected]:pyenv/pyenv.git $PYENV_ROOT
cd $PYENV_ROOT && src/configure && make -C src
git clone [email protected]:pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv
git clone [email protected]:pyenv/pyenv-update.git $(pyenv root)/plugins/pyenv-update

# ddcutil i2c
sudo groupadd --system i2c
sudo usermod $(whoami) -aG i2c
Expand Down
29 changes: 17 additions & 12 deletions dot_zprofile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ export LANG=en_GB.UTF-8
export PROMPT_EOL_MARK=""

# autoupdate
export DISABLE_AUTO_UPDATE=true
export UPDATE_ZSH_DAYS=30

## Linux / MacOS ##
machine=$(uname -s)
machine=`uname -s`
if [[ $machine == "Linux" ]]; then
# Linux specific commands.

Expand Down Expand Up @@ -61,10 +61,24 @@ export TEXMFVAR=$XDG_CACHE_HOME/texlive/texmf-var
export WINEPREFIX="$XDG_DATA_HOME"/wine
export LESSHISTFILE="$XDG_CACHE_HOME"/less/history

export PYENV_ROOT="$XDG_DATA_HOME/pyenv"
PATH="$PYENV_ROOT/shims:$PATH"
PATH="$PYENV_ROOT/bin:$PATH"
# $ENV_LOCATION should be set in .local-variables.
if [[ "$ENV_LOCATION" != "devserver" ]] && type "pyenv" > /dev/null; then
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
fi


alias irssi=irssi --config="$XDG_CONFIG_HOME"/irssi/config --home="$XDG_DATA_HOME"/irssi
alias svn="svn --config-dir $XDG_CONFIG_HOME/subversion"
alias wget=wget --hsts-file="$XDG_DATA_HOME/wget-hsts"

if type "exa" > /dev/null; then
alias ls="exa"
fi

# wlroots
# Use legacy mode for gamma changing for redshift.
# export WLR_DRM_NO_ATOMIC=1
Expand Down Expand Up @@ -110,15 +124,6 @@ PATH="/usr/local/bin:$PATH"
PATH="$HOME/.bin:$PATH"
PATH="$HOME/.local/bin:$PATH"

export PYENV_ROOT="$XDG_DATA_HOME/pyenv"
PATH="$PYENV_ROOT/shims:$PATH"
PATH="$PYENV_ROOT/bin:$PATH"
# $ENV_LOCATION should be set in .local-variables.
if [[ "$ENV_LOCATION" != "devserver" ]] && type "pyenv" >/dev/null; then
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
fi

if [[ $machine == "Darwin" ]]; then
# MacOS specific commands.
export HOMEBREW_HOME="$HOME/.homebrew"
Expand Down Expand Up @@ -150,7 +155,7 @@ PATH="$PATH:$XDG_DATA_HOME/npm/bin/"

## EXEC ###
if [ -z "$DISPLAY" ] && [ -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq 1 ]; then
exec sway >/var/log/sway.log 2>&1
exec sway > /var/log/sway.log 2>&1
elif [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_CONNECTION" ]]; then
if [[ $TERM == "xterm-kitty" ]]; then
tmux attach-session -t ssh_tmux || tmux new-session -s ssh_tmux
Expand Down
50 changes: 32 additions & 18 deletions dot_zshrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
source ~/.bin/hg_commit.zsh

# setopt noglob
source ~/.bin/taste_tester.zsh

## OH MY ZSH ##
plugins=(
Expand All @@ -18,40 +17,55 @@ export LS_COLORS="di=34:ln=35:so=32:pi=33:ex=31:bd=34;46:cd=34;43:su=30;41:sg=30
SPACESHIP_TIME_SHOW="true"
SPACESHIP_TIME_FORMAT="[%T]"
SPACESHIP_PROMPT_ORDER=(
dir # Current directory section
git # Git section (git_branch + git_status)
dir # Current directory section
git # Git section (git_branch + git_status)
hg_commit
golang # Go section
rust # Rust section
golang # Go section
rust # Rust section
)

if [[ "$ENV_LOCATION" != "devserver" ]]; then
SPACESHIP_PROMPT_ORDER+=(
python # Python section
python # Python section
)
fi

SPACESHIP_PROMPT_ORDER+=(
exec_time # Execution time
line_sep # Line break
jobs # Background jobs indicator
exit_code # Exit code section
char # Prompt character
exec_time # Execution time
line_sep # Line break
jobs # Background jobs indicator
exit_code # Exit code section
char # Prompt character
)
SPACESHIP_RPROMPT_ORDER=(
taste_tester
)
SPACESHIP_RPROMPT_ORDER=()

if [[ -z "$TMUX" ]]; then
# Only show host if not running in tmux.
SPACESHIP_RPROMPT_ORDER+=(host)
fi

SPACESHIP_RPROMPT_ORDER+=(
time # Time stamps section
time # Time stamps section
)

source $HOME/.oh-my-zsh/oh-my-zsh.sh
compinit -d $XDG_CACHE_HOME/zsh/zcompdump-$ZSH_VERSION
# source ${ZSH_CUSTOM}/plugins/zsh-autocomplete/zsh-autocomplete.plugin.zsh

if type "exa" >/dev/null; then
alias ls="exa"
fi
# # Delay zsh-autocomplete
# zstyle ':autocomplete:*' delay 0.1

# # Disable autocomplete history
# () {
# local -a prefix=( '\e'{\[,O} )
# local -a up=( ${^prefix}A ) down=( ${^prefix}B )
# local key=
# for key in $up[@]; do
# bindkey "$key" up-line-or-history
# done
# for key in $down[@]; do
# bindkey "$key" down-line-or-history
# done
# }
compinit -d $XDG_CACHE_HOME/zsh/zcompdump-$ZSH_VERSION

0 comments on commit 879c50c

Please sign in to comment.