Skip to content

Commit

Permalink
Add more dotfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
lgulich authored and lgulich committed Apr 11, 2024
1 parent 8cec676 commit aa12292
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 17 deletions.
4 changes: 4 additions & 0 deletions activity_watch/install_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ cd ${tmpdir}

release=$(curl -s https://api.github.com/repos/ActivityWatch/activitywatch/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')

# Override to use pre-release
release='v0.12.3b16'

wget https://github.com/ActivityWatch/activitywatch/releases/download/${release}/activitywatch-${release}-linux-x86_64.zip

unzip activitywatch-${release}-linux-x86_64.zip
mkdir -p ~/Code/installed/
rm -rf ~/Code/installed/activitywatch
cp -r ${tmpdir}/activitywatch ~/Code/installed/
4 changes: 4 additions & 0 deletions atuin/dotfile_manager.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
install_ubuntu:
- install.sh
install_macos:
- install.sh
5 changes: 5 additions & 0 deletions atuin/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

set -e

bash <(curl --proto '=https' --tlsv1.2 -sSf https://setup.atuin.sh)
50 changes: 37 additions & 13 deletions bash/bashrc.bash
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,9 @@ function find_file {
find ${search_path} -type f -name "${pattern}"
}


# Colcon
alias cb='colcon build --symlink-install --continue-on-error --packages-up-to'
alias cbs='colcon build --symlink-install --packages-select'
alias ct='colcon test --return-code-on-test-failure --packages-up-to'
alias cts='colcon test --return-code-on-test-failure --event-handlers console_direct+ --output-on-failure --packages-select'
alias src='source /workspaces/isaac_ros-dev/install/setup.bash'

# Git
alias ga='git add'
alias gb='git branch'
alias gc='git commit'
alias gca='git commit --amend'
alias gch='git checkout'
Expand All @@ -156,18 +149,49 @@ alias gs='git status'
alias nah='git reset --hard && git clean -df;'

git_submodule_reset() {
path=${1:-.}
git submodule deinit -f ${path}
git submodule update --recursive --init
submodule_path=${1:-.}
git submodule deinit -f ${submodule_path}
git submodule update --recursive --init --jobs 20
}

git_submodule_bump() {
git submodule update --recursive --remote
submodule_path=${1:-.}
git submodule deinit -f ${submodule_path}
git submodule update --recursive --remote --jobs 20
}

git_clean_up_branches() {
git fetch -p
for branch in $(git for-each-ref --format '%(refname) %(upstream:track)' refs/heads | awk '$2 == "[gone]" {sub("refs/heads/", "", $1); print $1}'); do
git branch -D "$branch"
done
}

# Autocomplete with up key.
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'

export ROS_DOMAIN_ID=33
# Colcon
alias cb='colcon build --symlink-install --continue-on-error --packages-up-to'
alias cbs='colcon build --symlink-install --packages-select'
alias ct='colcon test --return-code-on-test-failure --packages-up-to'
alias cts='colcon test --return-code-on-test-failure --event-handlers console_direct+ --ctest-args -R 'v' --output-on-failure --packages-select'
alias src='source /workspaces/isaac_ros-dev/install/setup.bash'
alias cbi='colcon build --continue-on-error --packages-up-to'

# Carter
CARTER_DEV_REPO='/mnt/nova_ssd/workspaces/carter-dev-lgulich'
CARTER_DEV_WS="${CARTER_DEV_REPO:?}/ros_ws/"
CONFIG_CONTAINER_NAME_SUFFIX='lgulich'
DOCKER_ARGS=(
"-e CYCLONEDDS_URI=/usr/local/share/middleware_profiles/cyclone_unicast_profile.xml"
)
alias cdc='cd /mnt/nova_ssd/workspaces/carter-dev'
alias cdcs='cd /mnt/nova_ssd/workspaces/carter-dev/ros_ws/src'
alias cdlg='cd /mnt/nova_ssd/workspaces/carter-dev-lgulich'
alias run_dev='cdlg && ${CARTER_DEV_REPO:?}/scripts/run_dev.sh ${CARTER_DEV_WS:?}'

source /opt/ros/humble/setup.bash

[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh
eval "$(atuin init bash)"
2 changes: 1 addition & 1 deletion cron/run_as_cron.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
env_file="${1:?}"
cmd="${2:?}"
. "$env_file"
exec /usr/bin/env -i "$SHELL" -c ". $env_file; $cmd"
exec /usr/bin/env -i "${SHELL:?}" -c ". ${env_file}; ${cmd}"
8 changes: 8 additions & 0 deletions git/gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,15 @@

[interactive]
diffFilter = diff-so-fancy --patch

[diff]
noprefix = false

[credential]
helper = store

[submodule]
fetchJobs = 20

[fetch]
parallel = 20
1 change: 0 additions & 1 deletion i3/helpers/init_workspaces.bash
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ declare -A startup_apps
startup_apps['alacritty']='1'
startup_apps['brave']='2'
startup_apps['slack']='10'
startup_apps['prospect-mail']='10'

startup_workspaces=(
'2'
Expand Down
2 changes: 1 addition & 1 deletion ros/aliases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ alias cdc='cd ${CARTER_DEV_REPO:?}'
alias cdcs='cd ${CARTER_DEV_WS:?}/src'
alias run_carter_dev='(cd ${CARTER_DEV_REPO:?} && ./scripts/run_dev.sh ${CARTER_DEV_WS})'

ros2() {
ros() {
local args=()
for arg in "$@"; do
if [[ "$arg" == "t" ]]; then
Expand Down
24 changes: 23 additions & 1 deletion zsh/zshrc.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi


# Oh my zsh configuration
export ZSH="${HOME}/.oh-my-zsh"
ZSH_THEME="powerlevel10k/powerlevel10k"
plugins=(
vi-mode
git
fzf
zsh-autosuggestions
ssh-agent
command-not-found
Expand All @@ -42,6 +42,9 @@ source "${ZSH}"/oh-my-zsh.sh
autoload -U +X compinit && compinit
autoload -U +X bashcompinit && bashcompinit

# Enable autocomplete for one-password
eval "$(op completion zsh)"; compdef _op op

# Often used directories.
export DOTFILES=~/Code/dotfiles

Expand Down Expand Up @@ -78,11 +81,30 @@ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/lgulich/.local/lib/python3.8/site
if [ -f /home/lgulich/Code/osmo/osmo/autocomplete.bash ]; then . '/home/lgulich/Code/osmo/osmo/autocomplete.bash'; fi

# History setup
HISTSIZE=10000000
SAVEHIST=10000000
PROMPT_COMMAND='history -a'
HISTTIMEFORMAT="%F %T "
HISTORY_IGNORE="(ls|pwd|exit)*"
setopt EXTENDED_HISTORY # Write the history file in the ':start:elapsed;command' format.
setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits.
setopt SHARE_HISTORY # Share history between all sessions.
setopt HIST_IGNORE_DUPS # Do not record an event that was just recorded again.
setopt HIST_IGNORE_ALL_DUPS # Delete an old recorded event if a new event is a duplicate.
setopt HIST_IGNORE_SPACE # Do not record an event starting with a space.
setopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the history file.
setopt HIST_VERIFY # Do not execute immediately upon history expansion.
setopt APPEND_HISTORY # append to history file (Default)
setopt HIST_NO_STORE # Don't store history commands
setopt HIST_REDUCE_BLANKS # Remove superfluous blanks from each command line being added to the history.
HIST_STAMPS="yyyy-mm-dd"

# Load google cloud stuff
if [ -f '/home/lgulich/Code/google-cloud-sdk/path.zsh.inc' ]; then . '/home/lgulich/Code/google-cloud-sdk/path.zsh.inc'; fi
if [ -f '/home/lgulich/Code/google-cloud-sdk/completion.zsh.inc' ]; then . '/home/lgulich/Code/google-cloud-sdk/completion.zsh.inc'; fi

eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"

eval "$(atuin init zsh)"
# Has to follow after atuin init.
ZSH_AUTOSUGGEST_STRATEGY=(history completion)

0 comments on commit aa12292

Please sign in to comment.