From f3cc55c2ff838ff46d137d813c4b7c86fbf5da68 Mon Sep 17 00:00:00 2001 From: jao Date: Tue, 12 Mar 2024 00:57:59 +0000 Subject: reactivating mopidy, not sure for how long --- init.el | 18 ++++++++++++++---- lib/media/jao-mpris.el | 4 ++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/init.el b/init.el index 05aed48..9411777 100644 --- a/init.el +++ b/init.el @@ -2798,9 +2798,16 @@ (interactive "P") (jao-show-lyrics force #'jao-mpris-artist-title)) +(defun jao-mpc-mopidy-playlist () + (interactive) + (jao-mpc-show-playlist jao-mopidy-port)) + (use-package jao-mpris :demand t) (defun jao-mpris-setup-aliases () + (setq espotify-play-uri-function #'espotify-play-uri-with-dbus) + (setq jao-mpris-player "mopidy") + (defalias 'jao-streaming-list #'jao-mpc-mopidy-playlist) (defalias 'jao-streaming-lyrics #'jao-mpris-lyrics) (defalias 'jao-streaming-toggle #'jao-mpris-play-pause) (defalias 'jao-streaming-next #'jao-mpris-next) @@ -2811,8 +2818,9 @@ (defalias 'jao-streaming-volume #'jao-mpris-vol) (defalias 'jao-streaming-volume-down #'jao-mpris-vol-down)) -(jao-mpris-register "playerctld" - :session (if jao-mode-line-in-minibuffer -10 70)) +;; (jao-mpris-register "playerctld" +;; :session (if jao-mode-line-in-minibuffer -10 70)) +;; (jao-mpris-register "mopidy" :session 70) ;;;; mpc (use-package jao-mpc @@ -2895,9 +2903,10 @@ (defalias 'jao-streaming-dislike #'jao-spt-dislike) (defalias 'jao-streaming-toggle-shuffle #'jao-spt-toggle-shuffle))) -(defvar jao-spt-on nil) (jao-def-exec-in-term "spt" "spt" (jao-afio-goto-scratch)) +(defvar jao-spt-on t) + (defun jao-streaming-toggle-player () (interactive) (if jao-spt-on @@ -2906,6 +2915,7 @@ (jao-mpris-setup-aliases)) (jao-spt-setup-aliases) (setq jao-mpris-player "spt")) + (setq jao-spt-on (not jao-spt-on)) (message "%s activated " jao-mpris-player)) (jao-streaming-toggle-player) @@ -2957,7 +2967,7 @@ ("k" "like" jao-streaming-like) ("K" "dislike" jao-streaming-dislike) ("S" "toggle shuffle" jao-streaming-toggle-shuffle) - ("t" "toggle player" jao-streaming-toggle-player)]]) + ("T" "toggle player" jao-streaming-toggle-player)]]) (transient-define-prefix jao-transient-media () [["Play" diff --git a/lib/media/jao-mpris.el b/lib/media/jao-mpris.el index e98709b..3bb2636 100644 --- a/lib/media/jao-mpris.el +++ b/lib/media/jao-mpris.el @@ -1,6 +1,6 @@ ;;; jao-mpris.el --- mpris players control -*- lexical-binding: t; -*- -;; Copyright (C) 2020, 2021, 2022 jao +;; Copyright (C) 2020, 2021, 2022, 2024 jao ;; Author: jao ;; Keywords: multimedia @@ -119,7 +119,7 @@ (duration (cond (duration duration) ((stringp len) len) ((numberp len) (jao-mpris--fmt-time (/ len 1e6) ""))))) - (format "> %s %s %s%s%s" + (format "%s %s %s%s%s" (jao--put-face (format "%s" (or track "")) 'jao-themes-f00) (jao--put-face (or title "") 'jao-themes-f01) (jao--put-face (or artist "") 'jao-themes-f11) -- cgit v1.2.3