Add hostname to tmux
This commit is contained in:
parent
30fed0d178
commit
0ed8b2069b
3 changed files with 51 additions and 23 deletions
|
|
@ -9,7 +9,7 @@ in
|
|||
description = "Nix configuration";
|
||||
windows = [
|
||||
{
|
||||
name = "nix";
|
||||
name = "";
|
||||
path = "${homeDirectory}/.config/nix";
|
||||
ai = true;
|
||||
git = true;
|
||||
|
|
@ -22,7 +22,7 @@ in
|
|||
description = "Homelab Deployment";
|
||||
windows = [
|
||||
{
|
||||
name = "homelab";
|
||||
name = "";
|
||||
path = homePath "Documents/Projects/Homelab-deploy";
|
||||
ai = true;
|
||||
git = true;
|
||||
|
|
@ -35,7 +35,7 @@ in
|
|||
description = "Obsidian notes";
|
||||
windows = [
|
||||
{
|
||||
name = "note";
|
||||
name = "";
|
||||
path = homePath "Obsidian/Personal";
|
||||
ai = true;
|
||||
git = false;
|
||||
|
|
@ -48,7 +48,7 @@ in
|
|||
description = "Academic programs";
|
||||
windows = [
|
||||
{
|
||||
name = "pro";
|
||||
name = "";
|
||||
path = homePath "Documents/Programs";
|
||||
ai = true;
|
||||
git = true;
|
||||
|
|
@ -61,14 +61,14 @@ in
|
|||
description = "Personal blog project";
|
||||
windows = [
|
||||
{
|
||||
name = "code";
|
||||
name = "c";
|
||||
path = homePath "Documents/Projects/personal-blog";
|
||||
ai = true;
|
||||
git = true;
|
||||
shell = true;
|
||||
}
|
||||
{
|
||||
name = "content";
|
||||
name = "p";
|
||||
path = homePath "Documents/Projects/personal-blog/content";
|
||||
ai = true;
|
||||
git = false;
|
||||
|
|
@ -80,7 +80,7 @@ in
|
|||
description = "Personal Homepage";
|
||||
windows = [
|
||||
{
|
||||
name = "homepage";
|
||||
name = "";
|
||||
path = homePath "Documents/Projects/Homepage";
|
||||
ai = true;
|
||||
git = true;
|
||||
|
|
@ -93,14 +93,14 @@ in
|
|||
description = "Material design shortcut";
|
||||
windows = [
|
||||
{
|
||||
name = "code";
|
||||
name = "c";
|
||||
path = homePath "Documents/Projects/Material Design Shortcut/MDShortcut-code";
|
||||
ai = true;
|
||||
git = true;
|
||||
shell = true;
|
||||
}
|
||||
{
|
||||
name = "paper";
|
||||
name = "p";
|
||||
path = homePath "Documents/Projects/Material Design Shortcut/MDShortcut-paper";
|
||||
ai = true;
|
||||
git = true;
|
||||
|
|
@ -113,21 +113,21 @@ in
|
|||
description = "DAKI3 course";
|
||||
windows = [
|
||||
{
|
||||
name = "code";
|
||||
name = "c";
|
||||
path = homePath "Documents/Projects/AI systems & infrastructure/Codes";
|
||||
ai = true;
|
||||
git = true;
|
||||
shell = true;
|
||||
}
|
||||
{
|
||||
name = "slides";
|
||||
name = "s";
|
||||
path = homePath "Documents/Projects/AI systems & infrastructure/Slides";
|
||||
ai = true;
|
||||
git = true;
|
||||
shell = false;
|
||||
}
|
||||
{
|
||||
name = "blog";
|
||||
name = "b";
|
||||
path = homePath "Documents/Projects/personal-blog/content/ai-system";
|
||||
ai = false;
|
||||
git = false;
|
||||
|
|
@ -140,7 +140,7 @@ in
|
|||
description = "DAKI3 group supervision";
|
||||
windows = [
|
||||
{
|
||||
name = "group";
|
||||
name = "";
|
||||
path = homePath "Documents/Projects/DAKI3 Semester Project Group";
|
||||
ai = true;
|
||||
git = true;
|
||||
|
|
@ -153,7 +153,7 @@ in
|
|||
description = "Material Meeting Slides";
|
||||
windows = [
|
||||
{
|
||||
name = "slides";
|
||||
name = "";
|
||||
path = homePath "Documents/Projects/Material Project Group Meeting";
|
||||
ai = true;
|
||||
git = true;
|
||||
|
|
@ -166,14 +166,14 @@ in
|
|||
description = "Inverse material design";
|
||||
windows = [
|
||||
{
|
||||
name = "code";
|
||||
name = "c";
|
||||
path = homePath "Documents/Projects/Inverse Design of Disordered Materials/DiffDisMatter-dev";
|
||||
ai = true;
|
||||
git = true;
|
||||
shell = true;
|
||||
}
|
||||
{
|
||||
name = "paper";
|
||||
name = "p";
|
||||
path = homePath "Documents/Projects/Inverse Design of Disordered Materials/mc-denoising-paper";
|
||||
ai = true;
|
||||
git = true;
|
||||
|
|
@ -186,7 +186,7 @@ in
|
|||
description = "Temp misc project";
|
||||
windows = [
|
||||
{
|
||||
name = "misc";
|
||||
name = "";
|
||||
path = homePath "Documents/Misc/2025/AI model train and infer-Wan";
|
||||
ai = true;
|
||||
git = false;
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
set -g status-left-length 40
|
||||
set -g status-right-length 30
|
||||
set -g status-left '#{?client_prefix,#[bg=#fb4934],#[bg=#a89984]}#[fg=#282828] #S #[bg=#282828] '
|
||||
set -g status-right '#{?pane_in_mode,[COPY],} %H:%M '
|
||||
set -g status-right '#{?pane_in_mode,[COPY],} #H | %H:%M '
|
||||
|
||||
# Window status format
|
||||
set -g window-status-format ' #I:#W '
|
||||
|
|
|
|||
|
|
@ -187,12 +187,19 @@ while IFS= read -r window_config; do
|
|||
|
||||
# Create nvim window (default behavior unless explicitly disabled)
|
||||
if [ "$NVIM_ENABLED" != "false" ]; then
|
||||
# Determine window name based on whether WINDOW_NAME is empty or "none"
|
||||
if [ -z "$WINDOW_NAME" ] || [ "$WINDOW_NAME" = "none" ]; then
|
||||
NVIM_WINDOW_NAME="nvim"
|
||||
else
|
||||
NVIM_WINDOW_NAME="${WINDOW_NAME}-nvim"
|
||||
fi
|
||||
|
||||
if [ "$WINDOW_INDEX" = 1 ]; then
|
||||
# First window - rename the existing session window
|
||||
tmux rename-window -t "$SESSION_NAME:$WINDOW_INDEX" "${WINDOW_NAME}-nvim"
|
||||
tmux rename-window -t "$SESSION_NAME:$WINDOW_INDEX" "$NVIM_WINDOW_NAME"
|
||||
else
|
||||
# Subsequent windows - create new window
|
||||
tmux new-window -t "$SESSION_NAME:$WINDOW_INDEX" -n "${WINDOW_NAME}-nvim" -c "$WINDOW_PATH"
|
||||
tmux new-window -t "$SESSION_NAME:$WINDOW_INDEX" -n "$NVIM_WINDOW_NAME" -c "$WINDOW_PATH"
|
||||
fi
|
||||
tmux send-keys -t "$SESSION_NAME:$WINDOW_INDEX" "nvim" C-m
|
||||
sleep 0.5 # Brief delay to ensure nvim loads
|
||||
|
|
@ -202,7 +209,14 @@ while IFS= read -r window_config; do
|
|||
|
||||
# Create AI window if enabled
|
||||
if [ "$AI_ENABLED" = "true" ]; then
|
||||
tmux new-window -t "$SESSION_NAME:$WINDOW_INDEX" -n "${WINDOW_NAME}-ai" -c "$WINDOW_PATH"
|
||||
# Determine window name based on whether WINDOW_NAME is empty or "none"
|
||||
if [ -z "$WINDOW_NAME" ] || [ "$WINDOW_NAME" = "none" ]; then
|
||||
AI_WINDOW_NAME="ai"
|
||||
else
|
||||
AI_WINDOW_NAME="${WINDOW_NAME}-ai"
|
||||
fi
|
||||
|
||||
tmux new-window -t "$SESSION_NAME:$WINDOW_INDEX" -n "$AI_WINDOW_NAME" -c "$WINDOW_PATH"
|
||||
tmux send-keys -t "$SESSION_NAME:$WINDOW_INDEX" "claude -c" C-m
|
||||
tmux split-window -t "$SESSION_NAME:$WINDOW_INDEX" -h -c "$WINDOW_PATH"
|
||||
tmux split-window -t "$SESSION_NAME:$WINDOW_INDEX.2" -v -c "$WINDOW_PATH"
|
||||
|
|
@ -212,7 +226,14 @@ while IFS= read -r window_config; do
|
|||
|
||||
# Create git window if enabled
|
||||
if [ "$GIT_ENABLED" = "true" ]; then
|
||||
tmux new-window -t "$SESSION_NAME:$WINDOW_INDEX" -n "${WINDOW_NAME}-git" -c "$WINDOW_PATH"
|
||||
# Determine window name based on whether WINDOW_NAME is empty or "none"
|
||||
if [ -z "$WINDOW_NAME" ] || [ "$WINDOW_NAME" = "none" ]; then
|
||||
GIT_WINDOW_NAME="git"
|
||||
else
|
||||
GIT_WINDOW_NAME="${WINDOW_NAME}-git"
|
||||
fi
|
||||
|
||||
tmux new-window -t "$SESSION_NAME:$WINDOW_INDEX" -n "$GIT_WINDOW_NAME" -c "$WINDOW_PATH"
|
||||
tmux send-keys -t "$SESSION_NAME:$WINDOW_INDEX" "lazygit" C-m
|
||||
tmux setw -t "$SESSION_NAME:$WINDOW_INDEX" monitor-activity off
|
||||
WINDOW_INDEX=$((WINDOW_INDEX + 1))
|
||||
|
|
@ -220,7 +241,14 @@ while IFS= read -r window_config; do
|
|||
|
||||
# Create shell window if enabled
|
||||
if [ "$SHELL_ENABLED" = "true" ]; then
|
||||
tmux new-window -t "$SESSION_NAME:$WINDOW_INDEX" -n "${WINDOW_NAME}-shell" -c "$WINDOW_PATH"
|
||||
# Determine window name based on whether WINDOW_NAME is empty or "none"
|
||||
if [ -z "$WINDOW_NAME" ] || [ "$WINDOW_NAME" = "none" ]; then
|
||||
SHELL_WINDOW_NAME="shell"
|
||||
else
|
||||
SHELL_WINDOW_NAME="${WINDOW_NAME}-shell"
|
||||
fi
|
||||
|
||||
tmux new-window -t "$SESSION_NAME:$WINDOW_INDEX" -n "$SHELL_WINDOW_NAME" -c "$WINDOW_PATH"
|
||||
WINDOW_INDEX=$((WINDOW_INDEX + 1))
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue