first commit

This commit is contained in:
Jeremie Fraeys 2023-11-22 17:23:39 -05:00
commit b0fb0be8a3
4 changed files with 95 additions and 0 deletions

1
poetry Symbolic link
View file

@ -0,0 +1 @@
/Users/jfraeys/Library/Application Support/pypoetry/venv/bin/poetry

56
stow_setup Executable file
View file

@ -0,0 +1,56 @@
#!/usr/bin/env bash
# make sure we have pulled in and updated any submodules
git submodule init
git submodule update
# what directories should be installable by all users including the root user
base=(
zsh
)
# folders that should, or only need to be installed for a local user
useronly=(
git
)
# files to ignore during stow
ignore_files=(
".DS_Store"
"__setup"
"bin"
"git"
"setup.sh"
)
# run the stow command for the passed-in directory ($2) in location $1
stowit() {
usr=$1
app=$2
# -v verbose
# -R recursive
# -t target
# --ignore files to ignore
stow -v -R -t "${usr}" --ignore "$(IFS="|"; echo "${ignore_files[*]}")" "${app}"
}
echo ""
echo "Stowing apps for user: ${USER}"
# install apps available to local users and root
for app in "${base[@]}"; do
stowit "${HOME}" "${app}"
done
# install only user space folders
for app in "${useronly[@]}"; do
if [[ ! "$(whoami)" = "root" ]]; then
stowit "${HOME}" "${app}"
fi
done
echo ""
echo "##### ALL DONE"

25
tmux_sessionizer Executable file
View file

@ -0,0 +1,25 @@
#!/usr/bin/env bash
if [[ $# -eq 1 ]]; then
selected=$1
else
selected=$(find ~/projects ~/ ~/Documents ~/.config -mindepth 1 -maxdepth 1 -type d | fzf)
fi
if [[ -z $selected ]]; then
exit 0
fi
selected_name=$(basename "$selected" | tr . _)
tmux_running=$(pgrep tmux)
if [[ -z $TMUX ]] && [[ -z $tmux_running ]]; then
tmux new-session -s $selected_name -c $selected
exit 0
fi
if ! tmux has-session -t=$selected_name 2> /dev/null; then
tmux new-session -ds $selected_name -c $selected
fi
tmux switch-client -t $selected_name

13
tmux_windownizer Executable file
View file

@ -0,0 +1,13 @@
#!/usr/bin/env bash
branch_name=$(basename $1)
session_name=$(tmux display-message -p "#S")
clean_name=$(echo $branch_name | tr "./" "__")
target="$session_name:$clean_name"
if ! tmux has-session -t $target 2> /dev/null; then
tmux neww -dn $clean_name
fi
shift
tmux send-keys -t $target "$*"