Finish script and documentation
This commit is contained in:
19
scripts/hxi
19
scripts/hxi
@@ -1,25 +1,26 @@
|
||||
#!/usr/bin/zsh
|
||||
# Runs the IDE
|
||||
|
||||
PARAMS=$@
|
||||
SESSIONID="IDE-${RANDOM}"
|
||||
TMUX=$(where tmux)
|
||||
MUX=$(where tmux)
|
||||
|
||||
# Set editor to helix, if unset
|
||||
if [ -z ${EDITOR+x} ]; then
|
||||
if [[ -v EDITOR ]]; 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"
|
||||
$MUX new-session -d -s $SESSIONID -x "$(tput cols)" -y "$(tput lines)" $EDITOR $PARAMS
|
||||
$MUX 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
|
||||
if [ -f ./.layout.tmux ]; then
|
||||
source ./.layout.tmux
|
||||
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}
|
||||
$MUX select-window -t ${SESSIONID}:0
|
||||
$MUX select-pane -t 0
|
||||
$MUX attach-session -t ${SESSIONID}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#!/bin/sh
|
||||
mkdir -p ~/.local/bin
|
||||
cp ~/.config/tmux/scripts/hxi ~/.local/bin
|
||||
ln -s ~/.config/tmux/scripts/hxi ~/.local/bin/hxi
|
||||
|
||||
Reference in New Issue
Block a user