Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Maxattax97/miscellaneous
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxattax97 committed Sep 17, 2024
2 parents 75ae079 + 9c88e5e commit 407a041
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 386 deletions.
55 changes: 35 additions & 20 deletions .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -40,32 +40,41 @@ zshrc_probe() {
zshrc_enter_tmux() {
if [[ -n "$(command -v tmux)" ]]; then
local session_count=$(tmux ls 2>/dev/null | wc -l)
if [[ "$session_count" -eq "0" ]]; then
if type tmuxp > /dev/null 2>&1; then
local host_config="${HOME}/.tmuxp/$(hostname).yml"
if type tmuxp > /dev/null 2>&1; then
if [[ -z "$TMUX" ]]; then
# If we haven't entered tmux yet, then load the tmuxp
# configuration for the current host, and attach if it already
# exists.
local host_config="${HOME}/.tmuxp/$(hostname).yaml"
if [ -s "${host_config}" ]; then
tmuxp load "${host_config}"
tmuxp load -y "${host_config}"
else
tmuxp load "${HOME}/.tmuxp/main.yaml"
tmuxp load -y "${HOME}/.tmuxp/main.yaml"
fi
else
tmux -2 new-session -s "Main"
elif [[ -n "$TMUX" ]]; then
# If we are already in a tmux session, just display the banner for this shell.
zshrc_display_banner
fi
else
# Make sure we are not already in a tmux session
if [[ -z "$TMUX" ]]; then
# Session id is date and time to prevent conflict
# TODO: Make session number more... meaningful?
local session_id="$(date +%H%M%S)"

# Create a new session (without attaching it) and link to base session
# to share windows
tmux -2 new-session -d -t Main -s "$session_id"

# Attach to the new session & kill it once orphaned
tmux -2 attach-session -t "$session_id" \; set-option destroy-unattached
local session_count=$(tmux ls 2>/dev/null | wc -l)
if [[ "$session_count" -eq "0" ]]; then
tmux -2 new-session -s "Main"
else
zshrc_display_banner
# Make sure we are not already in a tmux session
if [[ -z "$TMUX" ]]; then
# Session id is date and time to prevent conflict
# TODO: Make session number more... meaningful?
local session_id="$(date +%H%M%S)"

# Create a new session (without attaching it) and link to base session
# to share windows
tmux -2 new-session -d -t Main -s "$session_id"

# Attach to the new session & kill it once orphaned
tmux -2 attach-session -t "$session_id" \; set-option destroy-unattached
else
zshrc_display_banner
fi
fi
fi
else
Expand Down Expand Up @@ -343,6 +352,12 @@ zshrc_setup_completion() {
fi
fi

#if type pipx > /dev/null 2>&1; then
#if [ ! -s "${HOME}/.zsh_completions/_pipx" ]; then
#register-python-argcomplete pipx > "${HOME}/.zsh_completions/_pipx"
#fi
#fi

# Takes a lot of extra time ...
#if type molecule > /dev/null 2>&1; then
# Because it may be in a venv, we will have to do this on-demand.
Expand Down
1 change: 0 additions & 1 deletion config/SpaceVim.d/SpaceVim.d

This file was deleted.

174 changes: 0 additions & 174 deletions config/SpaceVim.d/autoload/bootstrap.vim

This file was deleted.

Loading

0 comments on commit 407a041

Please sign in to comment.