Skip check if hx is running in with helide

This commit is contained in:
Tyler Mayoff 2025-03-07 16:54:41 -05:00
parent c478e6bd0e
commit 5e62cf1093
No known key found for this signature in database
GPG key ID: FAE8714D991290A9

View file

@ -20,23 +20,24 @@
# Get the running command in the current pane # Get the running command in the current pane
RUNNING_COMMAND=$(zellij action list-clients | awk 'NR==2 {print $3}') RUNNING_COMMAND=$(zellij action list-clients | awk 'NR==2 {print $3}')
echo $RUNNING_COMMAND > out.txt
# Check if the command running in the current pane is helix (hx) # Check if the command running in the current pane is helix (hx)
if echo "$RUNNING_COMMAND" | grep -q "hx$"; then # if echo "$RUNNING_COMMAND" | grep -q "hx$"; then
# The current pane is running helix, use zellij actions to open the file # The current pane is running helix, use zellij actions to open the file
zellij action write 27 zellij action write 27
zellij action write-chars ":open $1" zellij action write-chars ":open $1"
zellij action write 13 zellij action write 13
else # else
# The current pane is not running helix, so open helix in a new pane # # The current pane is not running helix, so open helix in a new pane
zellij action new-pane # zellij action new-pane
sleep 0.3 # sleep 0.3
zellij action write-chars "hx $1" # zellij action write-chars "hx $1"
zellij action write 13 # zellij action write 13
# warning from before I got it working # # warning from before I got it working
# zellij action new-pane --name "WARNING" -- "echo" "please open helix in a pane right next to the sidebar (to the right of it) using 'hx path_to_file'" # # zellij action new-pane --name "WARNING" -- "echo" "please open helix in a pane right next to the sidebar (to the right of it) using 'hx path_to_file'"
fi # fi
''; '';
executable = true; executable = true;
}; };