59 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
			
		
		
	
	
			59 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
| ### Session --------------------------------------------------------------
 | ||
| # -sXX : XX session ID or name
 | ||
| # -nWINDOW_NAME : Name of the window…
 | ||
| # -d : Don't attache to the new session/window/pane/…
 | ||
| # -tXX:YY.ZZ :
 | ||
| #   XX : session ID or name
 | ||
| #   YY : (optional) Window ID
 | ||
| #   ZZ : (optional) Pane ID
 | ||
| #   YY and ZZ should exists to be able to change the parameters,…
 | ||
| # monitor-activity : permet de mettre en avant une fenêtre quand son contenu reçoit un événement
 | ||
| # 'exec ${SHELL}' : Allow to keep the pane running after the program exists
 | ||
| 
 | ||
| # Manage a new window and splits for authentication
 | ||
| 
 | ||
| # If a session already exists {{{
 | ||
| #if-shell -b 'tmux has-session' {
 | ||
| 
 | ||
| 	## Temp window to ensure a ssh-agent is running
 | ||
| 	#new-window -nAuth 'ssh-agent -a "${SSH_AGENT_SOCK}" ; logout'
 | ||
| 
 | ||
| 	## Window for authentication tools
 | ||
| 	#display-message "Create a new window for Authentication"
 | ||
| 	#new-window -nAuth 'gpg --quiet --for-your-eyes-only --decrypt ~/.password-store/test.gpg ; logout'
 | ||
| 	#split-window -h 'ssh-add -l | grep -qi -- "(ed25519)" || ssh-add ~/.ssh/id_ed25519 ; logout'
 | ||
| 	#set-window-option synchronize-panes on
 | ||
| #}
 | ||
| # }}}
 | ||
| 
 | ||
| # If file was source OUTSIDE of a running tmux {{{
 | ||
| if-shell -b 'test -z $TMUX' {
 | ||
| 
 | ||
| 	## Attach the last session
 | ||
| 	attach-session
 | ||
| 
 | ||
| 	## Temp window to ensure a ssh-agent is running
 | ||
| 	new-window -nSSH-Agent 'ssh-agent -a "${SSH_AGENT_SOCK}" ; logout'
 | ||
| 
 | ||
| 	## Window for authentication tools
 | ||
| 	display-message "Create a new window for Authentication"
 | ||
| 	new-window -nAuthTerm 'gpg --quiet --for-your-eyes-only --decrypt ~/.password-store/test.gpg ; tmux detach'
 | ||
| 	split-window -h 'ssh-add -l | grep -qi -- "(ed25519)" || ssh-add ~/.ssh/id_ed25519 ; logout'
 | ||
| 	set-window-option synchronize-panes on
 | ||
| 
 | ||
| 	#detach-client
 | ||
| }
 | ||
| # }}}
 | ||
| # If file was source from a running tmux {{{
 | ||
| if-shell -b 'test -n $TMUX' {
 | ||
| 	## Temp window to ensure a ssh-agent is running
 | ||
| 	new-window -nSSH-Agent 'ssh-agent -a "${SSH_AGENT_SOCK}" ; logout'
 | ||
| 
 | ||
| 	## Window for authentication tools
 | ||
| 	display-message "Create a new window for Authentication"
 | ||
| 	new-window -nAuthTmux 'gpg --quiet --for-your-eyes-only --decrypt ~/.password-store/test.gpg ; logout'
 | ||
| 	split-window -h 'ssh-add -l | grep -qi -- "(ed25519)" || ssh-add ~/.ssh/id_ed25519 ; logout'
 | ||
| 	set-window-option synchronize-panes on
 | ||
| }
 | ||
| # }}}
 |