summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--init.el5
-rw-r--r--lib/media/jao-mpc.el19
2 files changed, 16 insertions, 8 deletions
diff --git a/init.el b/init.el
index f93d836..53631a4 100644
--- a/init.el
+++ b/init.el
@@ -1655,7 +1655,8 @@
(jao-when-linux (require 'jao-custom-multimedia))
;;;; mpc
-(use-package jao-mpc :demand t)
+(use-package jao-mpc
+ :demand t)
(defmacro jao-defun-play (name &optional mpc-name)
(let ((arg (gensym)))
@@ -1746,6 +1747,8 @@
(global-set-key (kbd "s-m") #'jao-transient-media)
+(jao-mpc-setup nil 70)
+
;;; Graphical window system
(defvar jao-exwm-enabled nil)
diff --git a/lib/media/jao-mpc.el b/lib/media/jao-mpc.el
index 4f5081c..82c38ba 100644
--- a/lib/media/jao-mpc.el
+++ b/lib/media/jao-mpc.el
@@ -1,6 +1,6 @@
;;; jao-mpc.el --- Using mpc to interact with mpd -*- lexical-binding: t; -*-
-;; Copyright (C) 2021, 2022, 2024 jao
+;; Copyright (C) 2021, 2022, 2024, 2025 jao
;; Author: jao <mail@jao.io>
;; Keywords: convenience
@@ -106,7 +106,8 @@
(jao--put-face (or artist "") 'jao-themes-f01)
(jao--put-face (if composer (format " [%s]" composer) "")
'jao-themes-f01)
- (jao--put-face (if album (format " (%s)" album) "") 'jao-themes-f11)
+ (jao--put-face (if album (format " (%s)" album) "")
+ 'jao-themes-f11)
(jao--put-face tims (if times 'jao-themes-f00 'jao-themes-dimm))))
""))
@@ -131,9 +132,11 @@
(make-process :name (format "jao-mpc-idleloop (%s)" port)
:buffer nil
:noquery t
- :command `("mpc" "-p" ,(format "%s" (or port jao-mpc-port))
- "idleloop" "player")
- :filter (lambda (_p _s) (jao-mpc--set-current-str port)))))
+ :command
+ `("mpc" "-p" ,(format "%s" (or port jao-mpc-port))
+ "idleloop" "player")
+ :filter (lambda (_p _s)
+ (jao-mpc--set-current-str port)))))
(defvar jao-mpc--browser-port nil)
@@ -157,7 +160,8 @@
(let ((a (or album (string-trim (thing-at-point 'line))))
(p (or port jao-mpc--browser-port)))
(jao-mpc--cmd "clear" p)
- (jao-mpc--cmd (if idp (concat "add " a) (format "findadd album \"%s\"" a)) p)
+ (jao-mpc--cmd (if idp (concat "add " a) (format "findadd album \"%s\"" a))
+ p)
(jao-mpc--cmd "play" p)))
(define-key jao-mpc-albums-mode-map (kbd "n") #'next-line)
@@ -190,7 +194,8 @@
(define-key jao-mpc-playlist-mode-map (kbd "n") #'next-line)
(define-key jao-mpc-playlist-mode-map (kbd "p") #'previous-line)
(define-key jao-mpc-playlist-mode-map (kbd "q") #'bury-buffer)
-(define-key jao-mpc-playlist-mode-map (kbd ".") #'jao-mpc--playlist-goto-current)
+(define-key jao-mpc-playlist-mode-map (kbd ".")
+ #'jao-mpc--playlist-goto-current)
(define-key jao-mpc-playlist-mode-map (kbd "RET") #'jao-mpc--playlist-play)
(define-key jao-mpc-playlist-mode-map (kbd "C") #'jao-mpc-clear)