+ (run-nimcoon "-dlm" query))
+
+;; Assumes only one process exists. Must capture the pid of the running NimCoon process and only kill it.
+(defun nimcoon-kill-background-processes()
+ "Kill NimCoon process running in the background. Useful for stopping background music."
+ (interactive)
+ (shell-command "kill `pgrep nimcoon` `pgrep mpv` `pgrep vlc`"))
+
+(defun nimcoon-search-video(query)
+ "Search for a video by QUERY."
+ (interactive "sSearch query: ")
+ (with-output-to-temp-buffer "*NimCoon search results*"
+ (call-process "nimcoon" nil "*NimCoon search results*" t "--non-interactive" query)
+ (with-current-buffer "*NimCoon search results*"
+ (org-mode))))
+
+(defun nimcoon-search-music(query)
+ "Search for a video by QUERY."
+ (interactive "sSearch query: ")
+ (with-output-to-temp-buffer "*NimCoon search results*"
+ (call-process "nimcoon" nil "*NimCoon search results*" t "--music" "--non-interactive" query)
+ (with-current-buffer "*NimCoon search results*"
+ (org-mode))))