This commit is contained in:
m3tam3re 2024-03-20 05:57:37 +01:00
commit e65ba78cc8

22
zellij_ps.fish Executable file
View File

@ -0,0 +1,22 @@
#!/usr/bin/env fish
# This is a small zellij project switcher
#
# Please add additiones folders to the folders variable
set folders ~/projects ~/Projekte
if count $argv > 1
set selected $argv[1]
else
set selected (fd --type d --max-depth 1 . $folders | fzf)
end
set selected_name (basename "$selected" | tr . _)
set zellij_running (pgrep -c zellij)
if test -n "$ZELLIJ_SESSION_NAME"
echo -e "You are in a Zellij Session!\nPlease use the session manager to switch sessions.">&2
else
cd $selected; zellij --layout prog attach -c $selected_name options
end