Helm/EXWM: Integrate Strawberry.

master
Pierre Neidhardt 2021-05-09 15:09:12 +02:00
parent 43f674f710
commit c33940e5cf
2 changed files with 23 additions and 7 deletions

View File

@ -113,12 +113,24 @@ KEYS is passed to `kbd'."
(ambrevar/exwm-global-set-key "s-v" #'helm-selector-magit)
(exwm-input-set-key (kbd "s-V") #'magit-status))
(exwm-input-set-key (kbd "s-v") #'magit-status)))
(when (fboundp 'emms-all)
(cond
((executable-find "strawberry")
(defun ambrevar/exwm-strawberry ()
(interactive)
(helm-exwm-switch "strawberry"))
(defun ambrevar/exwm-strawberry-other-window ()
(interactive)
(helm-exwm-switch "strawberry" nil :other-window))
(ambrevar/exwm-global-set-key "s-a" #'ambrevar/exwm-strawberry)
(ambrevar/exwm-global-set-key "s-A" #'ambrevar/exwm-strawberry-other-window))
((fboundp 'emms-all)
(exwm-input-set-key (kbd "s-a") #'emms-smart-browse)
(exwm-input-set-key (kbd "S-s-<kp-enter>") #'emms-pause)
(if (fboundp 'helm-emms)
(ambrevar/exwm-global-set-key "s-A" #'helm-emms)
(exwm-input-set-key (kbd "s-A") #'emms)))
(exwm-input-set-key (kbd "s-A") #'emms))))
(when (fboundp 'helm-pass)
(ambrevar/exwm-global-set-key "s-p" #'helm-pass))

View File

@ -293,13 +293,17 @@ With prefix argument, UPDATE the databases with custom uptions thanks to the
(and (not (string-match-p ffap-url-regexp candidate))
helm-ff-default-directory
(locate-dominating-file helm-ff-default-directory ".git")))
1)
2)
(helm-source-add-action-to-source-if
"Add to EMMS playlist"
(format "Add to %s playlist"
(if (executable-find "strawberry")
"strawberry"
"EMMS"))
(lambda (_candidate)
(when (require 'emms nil 'noerror)
(dolist (c (helm-marked-candidates))
(emms-add-directory-tree c))))
(let ((adder)))
(or (when (executable-find "strawberry")
(apply #'call-process
"strawberry" nil nil nil (helm-marked-candidates)))))
source
(lambda (candidate)
(or (file-directory-p candidate)