diff options
author | jao <jao@gnu.org> | 2022-01-31 00:22:26 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-01-31 00:22:26 +0000 |
commit | df1affa6dedfbbf9f60c278dd140372020e2c5de (patch) | |
tree | 7b002a623fc84bbd41bb607864926ee8b4dc88ea | |
parent | a948928eacae3456270d6c8f2548c39d797d7a43 (diff) | |
download | elibs-df1affa6dedfbbf9f60c278dd140372020e2c5de.tar.gz elibs-df1affa6dedfbbf9f60c278dd140372020e2c5de.tar.bz2 |
mpris/streaming tweaks
-rw-r--r-- | exwm.org | 1 | ||||
-rw-r--r-- | init.org | 22 | ||||
-rw-r--r-- | lib/media/jao-mpris.el | 6 |
3 files changed, 19 insertions, 10 deletions
@@ -276,7 +276,6 @@ (jao-def-exwm-runner jao-exwm-proton-vpn 0 "*pvpn*" proton-vpn-status) (jao-def-exwm-runner jao-exwm-enwc 0 "*ENWC*" enwc) (jao-def-exwm-runner jao-exwm-bluetooth 0 "*Bluetooth*" bluetooth-list-devices) - (jao-def-exwm-runner jao-exwm-paradox 0 "*Packages*" paradox-list-packages nil) (jao-def-exwm-runner jao-exwm-packages 0 "*Packages*" list-packages nil) (jao-def-exwm-runner jao-exwm-proced 0 "*Proced*" proced) @@ -2909,7 +2909,6 @@ :config (defun jao-mpris-setup-aliases () (setq espotify-play-uri-function #'espotify-play-uri-with-dbus) - (defalias 'jao-streaming-list #'jao-term-ncmpcpp) (defalias 'jao-streaming-lyrics 'jao-show-lyrics) (defalias 'jao-streaming-toggle #'jao-mpris-play-pause) (defalias 'jao-streaming-next #'jao-mpris-next) @@ -2920,10 +2919,13 @@ (defalias 'jao-streaming-volume #'jao-mpris-vol) (defalias 'jao-streaming-volume-down #'jao-mpris-vol-down))) + (defalias 'jao-streaming-like #'ignore) + (defalias 'jao-streaming-dislike #'ignore) + (jao-mpris-setup-aliases) (jao-mpris-register "mopidy" :system (if jao-modeline-in-minibuffer-p -10 70)) - (jao-mpris-register "chromium" :session) (jao-mpris-register "firefox" :session) + (jao-mpris-register "chromium" :session) #+end_src *** spotify @@ -2957,7 +2959,9 @@ (defalias 'jao-streaming-seek #'jao-spt-seek) (defalias 'jao-streaming-seek-back #'jao-spt-seek-back) (defalias 'jao-streaming-volume #'jao-spt-vol) - (defalias 'jao-streaming-volume-down #'jao-spt-vol-down))) + (defalias 'jao-streaming-volume-down #'jao-spt-vol-down) + (defalias 'jao-streaming-like #'jao-spt-like) + (defalias 'jao-streaming-dislike #'jao-spt-dislike))) (defvar jao-spt-on nil) (defun jao-spt-on-p () jao-spt-on) @@ -3049,7 +3053,9 @@ (transient-define-prefix jao-transient-streaming () [:description - (lambda () (format "Spotify using %s" (if jao-spt-on "spt" "MPRIS"))) + (lambda () (format "Streaming using %s (%s)" + (if jao-spt-on "spt" "MPRIS") + (if jao-spt-on "" jao-mpris-player))) ["Search" ("a" "album" jao-streaming-album) ("A" "artist" jao-streaming-artist) @@ -3069,10 +3075,10 @@ ("L" "lyrics" jao-streaming-lyrics) ("w" "currently playing" jao-streaming-current) ("T" "toggle player" jao-streaming-toggle-player)] - ["Act" :if jao-spt-on-p - ("k" "like" jao-spt-like) - ("K" "dislike" jao-spt-dislike) - ("S" "toggle shuffling" jao-spt-toggle-shuffle)]]) + ["Act" + ("k" "like" jao-streaming-like) + ("K" "dislike" jao-streaming-dislike) + ("S" "toggle shuffling" jao-spt-toggle-shuffle :if jao-spt-on-p)]]) (transient-define-prefix jao-transient-media () [["Play" diff --git a/lib/media/jao-mpris.el b/lib/media/jao-mpris.el index c9f917a..b7e9aea 100644 --- a/lib/media/jao-mpris.el +++ b/lib/media/jao-mpris.el @@ -28,8 +28,11 @@ (require 'jao-themes) (require 'jao-minibuffer) +(defvar jao-mpris-player "chromium") + (defun jao-mpris--playerctl (&rest args) - (shell-command-to-string (format "playerctl %s" + (shell-command-to-string (format "playerctl -p %s %s" + jao-mpris-player (mapconcat #'shell-quote-argument args " ")))) (defmacro jao-playerctl--def (name &rest args) @@ -160,6 +163,7 @@ ;;;###autoload (defun jao-mpris-register (name &optional bus order) + (setq jao-mpris-player name) (dbus-register-signal (or bus :session) name "/org/mpris/MediaPlayer2" |