diff --git a/.tmux-session-hydrate b/.tmux-session-hydrate new file mode 100644 index 0000000..9134a03 --- /dev/null +++ b/.tmux-session-hydrate @@ -0,0 +1,3 @@ +source "$XDG_CONFIG_HOME/tmux/.tmux-session-hydrate-default" +tmux rename-window -t procs nv-kickstart +tmux send-keys -t :nv-kickstart "cd $DIR_GIT_PROJECTS/other/kickstart.nvim" c-M diff --git a/box_setup.sh b/box_setup.sh index 060504e..04327d7 100755 --- a/box_setup.sh +++ b/box_setup.sh @@ -49,13 +49,12 @@ export BOX_SETUP_UPDATE_PKG_MANAGER_AND_DEFS_CMD="$update_pkg_manager_and_defs_c export BOX_SETUP_UPDATE_PKGS_CMD="$update_pkgs_cmd" # make dirs and copy configs/dotfiles -source ./src_files/.config/zsh/.zshenv +. ./src_files/shell/profile ./make_dirs.sh ./copy_dotfiles.sh $1 # install programs -source $ZDOTDIR/.zshenv -source $ZDOTDIR/.zshrc +. $ZDOTDIR/.zshrc ./install_programs.sh $1 echo "setting the default theme: $DEFAULT_THEME_NAME" diff --git a/copy_dotfiles.sh b/copy_dotfiles.sh index 291c8d3..9eaab9a 100755 --- a/copy_dotfiles.sh +++ b/copy_dotfiles.sh @@ -34,11 +34,14 @@ sym_link() { } echo "---- copying dotfiles ------------------" -source src_files/.config/zsh/.zshenv -copy_file src_files/.config/zsh/.zshenv $HOME # copy first, ensure $ZDOTDIR set -# copy_file src_files/.config/ksh/.profile $HOME # TODO: if using oksh, get it working +. ./src_files/shell/profile -# configs/executables/scripts from .config and .local +# copy over env/profile files used by shell(s) +copy_file src_files/shell/profile $XDG_CONFIG_HOME +copy_file src_files/shell/.profile $HOME +copy_file src_files/.config/zsh/.zshenv $HOME + +# copy over configs, executables, and scripts copy_dir src_files/.config $XDG_CONFIG_HOME copy_dir src_files/.local/bin $DIR_BIN copy_dir src_files/.local/scripts $DIR_SCRIPTS diff --git a/make_dirs.sh b/make_dirs.sh index 40deae8..23a9e2d 100755 --- a/make_dirs.sh +++ b/make_dirs.sh @@ -1,7 +1,7 @@ #!/bin/zsh echo "---- making system dirs ----------------" -source ./src_files/.config/zsh/.zshenv # ensure env vars set for use below +. ./src_files/shell/profile # ensure env vars set for use below # some standard/common directories, some overlap/use in XDG directories [[ ! -d "$DIR_LOCAL" ]] && mkdir -p "$DIR_LOCAL" diff --git a/src_files/.config/zsh/.zshenv b/src_files/.config/zsh/.zshenv index af2dad6..503c9c5 100644 --- a/src_files/.config/zsh/.zshenv +++ b/src_files/.config/zsh/.zshenv @@ -1,48 +1 @@ -# default programs -export BROWSER='brave' -export EDITOR='nvim' -export TERMINAL='kitty' - -# env vars used for my organization structure -export DIR_HOME_BOX="$HOME/dbox" -export DIR_NOTES="$DIR_HOME_BOX/notes" -export DIR_MUSIC="$DIR_HOME_BOX/music/listen" -export DIR_DEV="$HOME/dev" -export DIR_GIT_PROJECTS="$DIR_DEV/git" - -# util dirs; do not change without checking impact on xdg base dirs -export DIR_LOCAL="$HOME/.local" -export DIR_BIN="$DIR_LOCAL/bin" -export DIR_SCRIPTS="$DIR_LOCAL/scripts" -export DIR_USER_OPT="$HOME/opt" -export DIR_USER_LIB="$DIR_LOCAL/lib" - -# xdg base directory vars -export XDG_CONFIG_HOME="$HOME/.config" -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? - -# directory for theme/style stuff -export DIR_THEME_SETTINGS="$XDG_CONFIG_HOME/zz-this-box/themes" -export DEFAULT_THEME_NAME="tokyodark" - -# zsh -export ZDOTDIR="$XDG_CONFIG_HOME/zsh" # may already be set, set anyway - -# git -export GIT_EDITOR="$EDITOR" - -# obsidian -export OBSIDIAN_WORKSPACES_TO_CONFIGURE=("$DIR_NOTES") - -# reaper -export DIR_REAPER_PORTABLE_SHARED="$DIR_USER_OPT/reaper-portable/shared" -export DIR_REAPER_PORTABLE_LINUX="$DIR_USER_OPT/reaper-portable/linux" -export DIR_REAPER_PORTABLE_MACOS="$DIR_USER_OPT/reaper-portable/macos" - -# clean-up of home dir -export __CF_USER_TEXT_ENCODING="0x0:0x0" # TODO: does this actually accomplish anything? - +[ -r "$HOME/.config/profile" ] && . $HOME/.config/profile diff --git a/src_files/.config/zsh/.zshrc b/src_files/.config/zsh/.zshrc index 44574ae..e12b88c 100644 --- a/src_files/.config/zsh/.zshrc +++ b/src_files/.config/zsh/.zshrc @@ -35,7 +35,7 @@ alias weather='curl "wttr.in/dfw?2&F"' alias shrug='echo "¯\\_(ツ)_/¯"' # source extensions and system-specific files -[[ -a "$ZDOTDIR/zsh-general-dev" ]] && source "$ZDOTDIR/zsh-general-dev" +[[ -a "$ZDOTDIR/zsh-general-dev" ]] && . "$ZDOTDIR/zsh-general-dev" # programming and language setup [[ -n $(command -v mise) ]] && eval "$(mise activate zsh)" diff --git a/src_files/.config/zsh/zsh-general-dev b/src_files/.config/zsh/zsh-general-dev index cc5237a..0e9424e 100644 --- a/src_files/.config/zsh/zsh-general-dev +++ b/src_files/.config/zsh/zsh-general-dev @@ -1,5 +1,5 @@ # set env vars, path updates, etc -[[ -a $HOME/.local-box-vars ]] && source $HOME/.local-box-vars +[[ -a $HOME/.local-box-vars ]] && . $HOME/.local-box-vars # login shortcuts alias assume="source assume" diff --git a/src_files/.local/bin/launch-reaper b/src_files/.local/bin/launch-reaper index 2f2d26a..2dc1f2f 100755 --- a/src_files/.local/bin/launch-reaper +++ b/src_files/.local/bin/launch-reaper @@ -1,7 +1,7 @@ #!/bin/sh # trying the "portable install" option; using this launch script to point to that -source "$XDG_CONFIG_HOME/zsh/.zshenv" +. $XDG_CONFIG_HOME/profile reaper_portable_exec_linux="$DIR_REAPER_PORTABLE_LINUX/REAPER/reaper" [[ ! -x "$reaper_portable_exec_linux" ]] && { diff --git a/src_files/.local/scripts/tmux-session-init b/src_files/.local/scripts/tmux-session-init index 42349b8..5069ebc 100755 --- a/src_files/.local/scripts/tmux-session-init +++ b/src_files/.local/scripts/tmux-session-init @@ -7,7 +7,7 @@ tmux_switch_to() { tmux_hydrate() { local tmux_hydrate_path="$XDG_CONFIG_HOME/tmux/.tmux-session-hydrate-default" [[ -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 + [[ -f $tmux_hydrate_path ]] && tmux send-keys -t $1 ". $tmux_hydrate_path" c-M } tmux_existing_sessions=$(tmux list-sessions 2> /dev/null || echo '') diff --git a/src_files/bin_overrides_macos/launch-reaper b/src_files/bin_overrides_macos/launch-reaper index bbe95ce..9e7b023 100755 --- a/src_files/bin_overrides_macos/launch-reaper +++ b/src_files/bin_overrides_macos/launch-reaper @@ -1,7 +1,7 @@ #!/bin/sh # trying the "portable install" option; using this launch script to point to that -source "$XDG_CONFIG_HOME/zsh/.zshenv" +. $XDG_CONFIG_HOME/profile reaper_portable_exec_macos="$DIR_REAPER_PORTABLE_MACOS/REAPER.app/Contents/MacOS/REAPER" [[ ! -x "$reaper_portable_exec_macos" ]] && { diff --git a/src_files/shell/.profile b/src_files/shell/.profile new file mode 100644 index 0000000..503c9c5 --- /dev/null +++ b/src_files/shell/.profile @@ -0,0 +1 @@ +[ -r "$HOME/.config/profile" ] && . $HOME/.config/profile diff --git a/src_files/shell/profile b/src_files/shell/profile new file mode 100644 index 0000000..e3f0c4b --- /dev/null +++ b/src_files/shell/profile @@ -0,0 +1,51 @@ +# default programs +export BROWSER='brave' +export EDITOR='nvim' +export TERMINAL='kitty' + +# set ENV for ksh/oksh (should be ignored by zsh and bash) +export ENV="$HOME/.config/ksh/kshrc" + +# env vars used for my organization structure +export DIR_HOME_BOX="$HOME/dbox" +export DIR_NOTES="$DIR_HOME_BOX/notes" +export DIR_MUSIC="$DIR_HOME_BOX/music/listen" +export DIR_DEV="$HOME/dev" +export DIR_GIT_PROJECTS="$DIR_DEV/git" + +# util dirs; do not change without checking impact on xdg base dirs +export DIR_LOCAL="$HOME/.local" +export DIR_BIN="$DIR_LOCAL/bin" +export DIR_SCRIPTS="$DIR_LOCAL/scripts" +export DIR_USER_OPT="$HOME/opt" +export DIR_USER_LIB="$DIR_LOCAL/lib" + +# xdg base directory vars +export XDG_CONFIG_HOME="$HOME/.config" +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? + +# directory for theme/style stuff +export DIR_THEME_SETTINGS="$XDG_CONFIG_HOME/zz-this-box/themes" +export DEFAULT_THEME_NAME="tokyodark" + +# zsh +export ZDOTDIR="$XDG_CONFIG_HOME/zsh" # may already be set, set anyway + +# git +export GIT_EDITOR="$EDITOR" + +# obsidian +export OBSIDIAN_WORKSPACES_TO_CONFIGURE=("$DIR_NOTES") + +# reaper +export DIR_REAPER_PORTABLE_SHARED="$DIR_USER_OPT/reaper-portable/shared" +export DIR_REAPER_PORTABLE_LINUX="$DIR_USER_OPT/reaper-portable/linux" +export DIR_REAPER_PORTABLE_MACOS="$DIR_USER_OPT/reaper-portable/macos" + +# clean-up of home dir +export __CF_USER_TEXT_ENCODING="0x0:0x0" # TODO: does this actually accomplish anything? + diff --git a/theme_config.sh b/theme_config.sh index 8cc97c3..00379cf 100755 --- a/theme_config.sh +++ b/theme_config.sh @@ -8,7 +8,7 @@ sym_link() { } echo "---- configuring themes ----------------" -source src_files/.config/zsh/.zshenv +. ./src_files/shell/profile echo "copying theme imports into config dirs" omarchy_themes=(`find src_files/imports/themes-omarchy-* -mindepth 1 -maxdepth 1 -type d`)