Restructuring the repo

This commit is contained in:
Alexander Gehrke 2020-04-02 10:38:36 +02:00
parent 21e3cf65e6
commit 3d67598c27
45 changed files with 368 additions and 77 deletions

29
misc/guiterm Executable file
View file

@ -0,0 +1,29 @@
#!/bin/zsh
if [[ "${0:t}" == "guiterm" ]]; then
<<-HELP
Symlink to g\$progname to start \$progname in tmux in a new terminal or
reattach a tmux session named \$progname in a new terminal
Symlink to g.\$progname to start \$progname in tmux in a new terminal
regardless of existing tmux sessions"
Example symlink names:
gmutt: start mutt in a terminal or open the existing one
g.zsh: open a terminal running a new zsh session
HELP
exit 1
fi
prog=${${0:t}[2,-1]}
if [[ "$prog[1]" == "." ]]; then
prog=${prog[2,-1]}
action="tmux new-session ${prog}"
elif tmux list-sessions | grep -qe "^${prog}:"; then
action="tmux attach -t ${prog}"
else
action="tmux new-session -s ${prog} ${prog}"
fi
#exec alacritty --title G${prog} -e ${=action}
exec alacritty -t G${prog} -e ${=action}