;;; nimcoon.el -*- lexical-binding: t; -*- ;;; ;;; Usage in Doom Emacs ;;; Place or symlink the file into ~/.doom.d/ ;;; (load! "nimcoon") ;;; Non-interactive functions to respond to URL clicks (defun nimcoon-play-url (url) "Play given url in NimCoon" (start-process "nimcoon" nil "nimcoon" url)) ;; Play all YouTube URLs in NimCoon (setq browse-url-browser-function (quote (("youtu\\.?be" . nimcoon-play-url) ("." . browse-url-default-browser)))) ;;; Interactive functions (defun nimcoon-feeling-lucky-music(query) (interactive "sSearch query: ") (call-process "nimcoon" nil 0 nil "-m" "-l" (format "'%s'" query))) (defun nimcoon-feeling-lucky-video(query) (interactive "sSearch query: ") (call-process "nimcoon" nil 0 nil "-l" (format "'%s'" query))) (defun nimcoon-download-video(query) (interactive "sSearch query: ") (call-process "nimcoon" nil 0 nil "-d" "-l" (format "'%s'" query))) (defun nimcoon-download-music(query) (interactive "sSearch query: ") (call-process "nimcoon" nil 0 nil "-d" "-l" "-m" (format "'%s'" query))) ;;; Keybindings (map! :leader ;;; N --- NimCoon (:prefix-map ("N" . "NimCoon") (:prefix ("d" . "Download") :desc "Video" "v" #'nimcoon-download-video :desc "Music" "m" #'nimcoon-download-music) :desc "Video" "v" #'nimcoon-feeling-lucky-video :desc "Music" "m" #'nimcoon-feeling-lucky-music))