mirror of
https://github.com/stumpwm/stumpwm-contrib.git
synced 2026-09-10 07:26:25 -04:00
Merge pull request #311 from catap/ssh-title
Introduce `*swm-ssh-default-term-title-opt*`
This commit is contained in:
commit
d41a2ed1a9
|
|
@ -31,6 +31,14 @@ Default terminal to open an ssh connection is ~urxvtc~. To change it, use
|
|||
(setq swm-ssh:*swm-ssh-default-term* "xterm")
|
||||
#+END_SRC
|
||||
|
||||
** *swm-ssh-default-term-title-opt*
|
||||
Default terminal's title option is ~-T~ which is used to setup title to
|
||||
a connection host. It works with both ~xterm~ and ~urxvtc~ out of the
|
||||
box. ~nil~ disable it. To change it, use
|
||||
#+BEGIN_SRC lisp
|
||||
(setq swm-ssh:*swm-ssh-default-termt-itle-opt* "--title")
|
||||
#+END_SRC
|
||||
|
||||
** *swm-ssh-known-host-path*
|
||||
Path to thee list of know host bz SSH client. Defaults to =~/.ssh/known_hosts=.
|
||||
Change it with
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
(defpackage #:swm-ssh
|
||||
(:use #:cl #:stumpwm)
|
||||
(:export #:*swm-ssh-default-term*
|
||||
#:*swm-ssh-default-term-title-opt*
|
||||
#:*swm-ssh-known-hosts-path*)
|
||||
(:import-from #:cl-ppcre))
|
||||
|
||||
|
|
@ -14,6 +15,8 @@
|
|||
|
||||
(defvar *swm-ssh-default-term* "urxvtc")
|
||||
|
||||
(defvar *swm-ssh-default-term-title-opt* "-T")
|
||||
|
||||
(defun collect-hosts (&optional (ssh-known-hosts *swm-ssh-known-hosts-path*))
|
||||
(with-open-file (stream ssh-known-hosts :direction :input)
|
||||
(loop for line = (read-line stream nil)
|
||||
|
|
@ -32,4 +35,12 @@
|
|||
(when entry
|
||||
(let ((host (car entry)))
|
||||
(stumpwm:run-shell-command
|
||||
(format nil "~A -T ~A -e ssh ~A" *swm-ssh-default-term* host host))))))
|
||||
(if *swm-ssh-default-term-title-opt*
|
||||
(format nil "~A ~A ~A -e ssh ~A"
|
||||
*swm-ssh-default-term*
|
||||
*swm-ssh-default-term-title-opt*
|
||||
host
|
||||
host)
|
||||
(format nil "~A -e ssh ~A"
|
||||
*swm-ssh-default-term*
|
||||
host)))))))
|
||||
|
|
|
|||
Loading…
Reference in a new issue