Add script functionality

This commit is contained in:
2025-10-28 20:14:32 +01:00
parent b1a6654d1c
commit 48ab557769
5 changed files with 127 additions and 0 deletions

25
scripts/hxi Executable file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/zsh
# Runs the IDE
SESSIONID="IDE-${RANDOM}"
TMUX=$(where tmux)
# Set editor to helix, if unset
if [ -z ${EDITOR+x} ]; then
EDITOR=$(where hx)
fi
# Open a new session with a random name
$TMUX new-session -d -s $SESSINID $EDITOR
$TMUX rename-window -t ${SESSIONID}:0 "TMUX IDE"
# check, if a layout file is present, and run it.
if [ -f ./.tmux.layout ]; then
source ./.tmux.layout
fi
# Finally, select the editor window in the current session,
# and attach to the session
$TMUX select-window -t ${SESSIONID}:0
$TMUX select-pane -t 0
$TMUX attach-session -t ${SESSIONID}