2016-11-14 16:05:26 +03:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#!/bin/sh
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								export SSH_AUTH_SOCK="${HOME}/.ssh/ssh_auth_sock"
							 | 
						
					
						
							
								
									
										
										
										
											2017-06-12 13:43:17 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								cmd="$1"
							 | 
						
					
						
							
								
									
										
										
										
											2016-11-14 16:05:26 +03:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								shift
							 | 
						
					
						
							
								
									
										
										
										
											2016-11-17 15:14:47 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								get_hosts() {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    awk -F",| " '{print $1}' "${HOME}/.ssh/known_hosts"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								}
							 | 
						
					
						
							
								
									
										
										
										
											2016-12-06 12:03:04 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								result=$(get_hosts | sort -uV | dmenu -p ssh ${1+"$@"}) || exit 1
							 | 
						
					
						
							
								
									
										
										
										
											2016-11-14 16:05:26 +03:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								exec $cmd $result
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# call from ~/.i3/config:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# bindsym $mod+Control+Return exec ~/bin/dmenu_ssh '/usr/bin/urxvtc -e ssh' -i -b -fn "$font"
							 |