From c33940e5cfeb7134fa7ccf82484dfe1119741e41 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Sun, 9 May 2021 15:09:12 +0200 Subject: [PATCH] Helm/EXWM: Integrate Strawberry. --- .emacs.d/lisp/init-exwm.el | 16 ++++++++++++++-- .emacs.d/lisp/init-helm.el | 14 +++++++++----- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/.emacs.d/lisp/init-exwm.el b/.emacs.d/lisp/init-exwm.el index 8941ef52..bc4ae1f4 100644 --- a/.emacs.d/lisp/init-exwm.el +++ b/.emacs.d/lisp/init-exwm.el @@ -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-") #'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)) diff --git a/.emacs.d/lisp/init-helm.el b/.emacs.d/lisp/init-helm.el index edd51bdb..769292d8 100644 --- a/.emacs.d/lisp/init-helm.el +++ b/.emacs.d/lisp/init-helm.el @@ -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)