commit 746a7e0ec2a371693957bad628b2d36a5547409e parent 53981f698e5e39861098d86b0077bd80b8be9faf Author: Anders Damsgaard <anders@adamsgaard.dk> Date: Thu, 25 Oct 2018 10:06:58 +0200 Start more ssh/gpg services, connect to idkfa on mstdeb Diffstat:
M | links/bin/tmux-utility.sh | | | 32 | +++++++++++++++++++++----------- |
1 file changed, 21 insertions(+), 11 deletions(-)
diff --git a/links/bin/tmux-utility.sh b/links/bin/tmux-utility.sh @@ -6,31 +6,41 @@ if ! tmux has-session -t $SESSION then # Start services mpd ~/.mpd/mpd.conf + eval "$(gpg-agent)" + GPG_TTY=$(tty) + export GPG_TTY + eval "$(ssh-agent)" + # Add ssh key if not already added if [ "$(uname)" = "Darwin" ]; then - ssh-add -K + ssh-add -l | grep -q '\.ssh/id_rsa' || ssh-add -K else - ssh-add + ssh-add -l | grep -q '\.ssh/id_rsa' || ssh-add fi # Create new session, name it, name the window, detach tmux new-session -s $SESSION -n misc -d - tmux send-keys -t $SESSION "echo $PWD" C-m - tmux send-keys -t $SESSION "mutt" C-m + if [ "$(hostname)" = "mstdeb" ]; then + tmux send-keys -t $SESSION C-m "$HOME/bin/idkfa-ssh" C-m - tmux split-window -h -t $SESSION - tmux send-keys -t $SESSION "$HOME/bin/google-cloud-lamps-instance1-ssh.sh" C-m + else + tmux send-keys -t $SESSION "echo $PWD" C-m + tmux send-keys -t $SESSION "mutt" C-m - tmux select-pane -t $SESSION:1.1 - tmux split-window -p 33 -v -t $SESSION - tmux send-keys -t $SESSION "fortune" C-m - #tmux send-keys -t $SESSION "$EDITOR $HOME/iawriter/todo.md" C-m + tmux split-window -h -t $SESSION + tmux send-keys -t $SESSION "$HOME/bin/google-cloud-lamps-instance1-ssh.sh" C-m + + tmux select-pane -t $SESSION:1.1 + tmux split-window -p 33 -v -t $SESSION + tmux send-keys -t $SESSION "fortune" C-m + #tmux send-keys -t $SESSION "$EDITOR $HOME/iawriter/todo.md" C-m + fi tmux new-window -t $SESSION -n "board" tmux select-pane -t $SESSION:2.1 tmux send-keys -t $SESSION "board $HOME" C-m - tmux new-window -t $SESSION + tmux new-window -t $SESSION -n "mpc" tmux select-pane -t $SESSION:3.1 tmux send-keys -t $SESSION "ncmpcpp" C-m