EXWM: Add support for EWW buffers in helm-pass-for-page

master
Pierre Neidhardt 2018-04-14 18:58:54 +05:30
parent 893c4a6985
commit 87170f0b09
1 changed files with 9 additions and 4 deletions

View File

@ -107,10 +107,15 @@
(interactive)
(require 'helm-pass)
(helm :sources 'helm-source-pass
:input (and exwm-title
(let* ((url (car (last (split-string exwm-title " "))))
(domain (split-string url "\\.")))
(concat (nth (- (length domain) 2) domain) "." (nth (1- (length domain)) domain))))
:input (cond
((derived-mode-p 'eww-mode)
(let* ((url (replace-regexp-in-string ".*//\\([^/]*\\).*" "\\1" (eww-current-url)))
(domain (split-string url "\\.")))
(concat (nth (- (length domain) 2) domain) "." (nth (1- (length domain)) domain))))
((and (derived-mode-p 'exwm-mode) exwm-title)
(let* ((url (car (last (split-string exwm-title " "))))
(domain (split-string url "\\.")))
(concat (nth (- (length domain) 2) domain) "." (nth (1- (length domain)) domain)))))
:buffer "*helm-pass*"))
(exwm-input-set-key (kbd "s-p") #'ambrevar/helm-pass-for-page))