Compare commits

...

2 Commits

Author SHA1 Message Date
7e796b558e Simplify tmux-session-hydrate logic; update tmux key binds 2025-09-25 13:34:42 -05:00
9a5595245c Replace asdf with mise 2025-09-25 13:32:51 -05:00
12 changed files with 33 additions and 58 deletions

View File

@@ -54,7 +54,7 @@ export BOX_SETUP_UPDATE_PKGS_CMD="$update_pkgs_cmd"
# make dirs and copy configs/dotfiles
source ./src_files/.config/zsh/.zshenv
./make_dirs.sh
./copy_configs.sh $2
./copy_dotfiles.sh $2
# install programs
source $ZDOTDIR/.zshenv

View File

@@ -1,13 +1,13 @@
#!/bin/zsh
execute() { echo "executing: $@" && "$@" }
echo_and_execute() { echo "executing: $@" && "$@" }
copy_file() {
local from=$1
local to=$2
local filename=$(basename $from)
[[ -e $to/$filename ]] && execute rm $to/$filename
execute cp -p $from $to/$filename
[[ -e $to/$filename ]] && rm $to/$filename
echo_and_execute cp -p $from $to/$filename
}
copy_dir() {
@@ -16,8 +16,8 @@ copy_dir() {
pushd $from > /dev/null
local directories=(`find . -mindepth 1 -maxdepth 1 -type d`)
for dir in $directories; do
[[ -d $to/$dir ]] && execute rm -rf $to/$dir
execute cp -rp $dir $to/$dir
[[ -d $to/$dir ]] && rm -rf $to/$dir
echo_and_execute cp -rp $dir $to/$dir
done
local files=(`find . -mindepth 1 -maxdepth 1 -type f`)
for file in $files; do

View File

@@ -0,0 +1,4 @@
[tools]
go = "1"
python = "3"
ruby = "3"

View File

@@ -0,0 +1,18 @@
tmux_omitted_dirs=(
$HOME
$DIR_HOME_BOX
$DIR_DEV
$DIR_GIT_PROJECTS
)
[[ ! ${tmux_omitted_dirs[(re)$(pwd)]} ]] && {
tmux new-window -d -n $EDITOR
tmux send-keys -t :$EDITOR "$EDITOR ." c-M
tmux new-window -d -n debug
tmux new-window -d -n run
tmux rename-window cmd
tmux send-keys -t :cmd "clear; [[ -d .git ]] && git status" c-M
}
clear

View File

@@ -1,13 +0,0 @@
tmux_omitted_dirs=(
$HOME
$DIR_HOME_BOX
$DIR_DEV
$DIR_GIT_PROJECTS
)
[[ ! ${tmux_omitted_dirs[(re)$(pwd)]} ]] &&
tmux new-window -d -n cmd &&
tmux rename-window $EDITOR &&
$EDITOR .
clear

View File

@@ -1,11 +0,0 @@
## example template
tmux new-window -d -n cmd
tmux send-keys -t :cmd "echo 'in cmd'" c-M
tmux new-window -d -n another
tmux send-keys -t :another "echo 'in another'" c-M
tmux rename-window $EDITOR
$EDITOR .
clear

View File

@@ -1,7 +0,0 @@
tmux new-window -d -n ncspot
tmux new-window -d -n fitness
tmux send-keys -t :fitness "cd $DIR_HOME_BOX/life/fitness/audio" c-M
tmux rename-window ncmpcpp
ncmpcpp

View File

@@ -1,8 +0,0 @@
tmux rename-window drawing
tmux new-window -n thinking
tmux send-keys -t :thinking "$EDITOR $(date "+%Y%m%d")-scratch" c-M
tmux send-keys -t :drawing "cd $DIR_SCRATCH_DRAWINGS" c-M
tmux send-keys -t :drawing "gimp" c-M

View File

@@ -1,6 +1,7 @@
# default programs
export BROWSER='brave'
export EDITOR='nvim'
export TERMINAL='ghostty'
# env vars used for my organization structure
export DIR_HOME_BOX="$HOME/dbox"
@@ -23,7 +24,7 @@ export XDG_CACHE_HOME="$HOME/.cache"
export XDG_DATA_HOME="$DIR_LOCAL/share"
export XDG_STATE_HOME="$DIR_LOCAL/state"
export XDG_DATA_DIRS="/usr/local/share:/usr/share"
#export XDG_CONFIG_DIRS="/etc/xdg" # TODO: does this work on macos?
#export XDG_CONFIG_DIRS="/etc/xdg" # TODO: does this work on macOS?
# zsh
export ZDOTDIR="$XDG_CONFIG_HOME/zsh" # may already be set, set anyway
@@ -31,12 +32,6 @@ export ZDOTDIR="$XDG_CONFIG_HOME/zsh" # may already be set, set anyway
# git
export GIT_EDITOR="$EDITOR"
# language support/tools
export ASDF_DIR="$XDG_CONFIG_HOME/asdf"
export ASDF_CONFIG_FILE="$ASDF_DIR/.asdfrc"
export ASDF_DATA_DIR="$DIR_LOCAL/.asdf"
export ASDF_TOOL_VERSIONS_FILENAME=".asdf_tool_versions"
# clean-up of home dir
export __CF_USER_TEXT_ENCODING="0x0:0x0"

View File

@@ -33,6 +33,7 @@ alias ncspotkeys="$EDITOR $DIR_GIT_PROJECTS/other/ncspot/doc/users.md"
[[ -a "$ZDOTDIR/zsh-general-dev" ]] && source "$ZDOTDIR/zsh-general-dev"
[[ -a "$ZDOTDIR/zsh-life-system" ]] && source "$ZDOTDIR/zsh-life-system"
# TODO: refactor the below; simplify or at least move elsewhere
# dev/lang setup
[[ -n $(command -v mise) ]] && eval "$(mise activate zsh)"
export DEVKITARM=/opt/devkitpro/devkitARM
. $(brew --prefix asdf)/libexec/asdf.sh

View File

@@ -7,8 +7,6 @@ tmux_switch_to() {
tmux_hydrate() {
local tmux_hydrate_files_dir="$XDG_CONFIG_HOME/tmux/session-hydrate-files"
local tmux_hydrate_path="$tmux_hydrate_files_dir/.tmux-session-hydrate-default"
[[ $1 = "thinking" ]] && tmux_hydrate_path="$tmux_hydrate_files_dir/.tmux-session-hydrate-thinking"
[[ $1 = "listening" ]] && tmux_hydrate_path="$tmux_hydrate_files_dir/.tmux-session-hydrate-listening"
[[ -f $2/.tmux-session-hydrate ]] && tmux_hydrate_path="$2/.tmux-session-hydrate"
[[ -f $tmux_hydrate_path ]] && tmux send-keys -t $1 "source $tmux_hydrate_path" c-M
}
@@ -27,8 +25,6 @@ tmux_target_path=''
if [[ $tmux_target_path = "." ]]; then tmux_target_name=$(basename $(pwd)) && tmux_target_path=$(pwd);
elif [[ $tmux_target_path = "hub" ]]; then tmux_target_name="hub" && tmux_target_path="$HOME";
elif [[ $tmux_target_path = "thinking" ]]; then tmux_target_name="thinking" && tmux_target_path="$DIR_SCRATCH_NOTES";
elif [[ $tmux_target_path = "listening" ]]; then tmux_target_name="listening" && tmux_target_path="$DIR_MUSIC";
elif [[ -n $tmux_target_path ]]; then tmux_target_name=$(basename "$tmux_target_path" | tr . _);
fi