diff options
Diffstat (limited to 'init.org')
-rw-r--r-- | init.org | 166 |
1 files changed, 26 insertions, 140 deletions
@@ -2927,138 +2927,6 @@ (global-set-key (kbd "<f4>") #'jao-toggle-audio-applet) #+end_src -*** emms -***** configuration - #+BEGIN_SRC emacs-lisp - (use-package emms - :pin gnu - :ensure t - :init - (setq emms-score-file "~/.emacs.d/score" - emms-stream-bookmarks-file "~/.emacs.d/streams" - emms-history-file "~/.emacs.d/cache/emms-history" - emms-cache-file "~/.emacs.d/cache/emms-cache" - emms-show-format "%s") - - (setq emms-source-file-default-directory "~/var/lib/music/" - emms-player-list '(emms-player-mpd) - emms-player-mpd-server-name "localhost" - emms-player-mpd-server-port "6600" - emms-player-mpd-music-directory emms-source-file-default-directory) - - (setq emms-volume-change-function 'emms-volume-mpd-change - emms-volume-change-amount 10 - emms-info-ogginfo-coding-system 'utf-8) - - ;; from http://www.shellarchive.co.uk/index.html#%20Prettify%20emms - (setq emms-browser-info-genre-format "%i· %n" - emms-browser-info-artist-format "%i· %n" - emms-browser-info-album-format "%i◨ %n" - emms-browser-info-title-format "%i♪ %n") - - (setq emms-last-played-format-alist - '(((emms-last-played-seconds-today) . "Today at %H:%M") - (604800 . "%a at %H:%M") - ((emms-last-played-seconds-month) . "%d") - ((emms-last-played-seconds-year) . "%m-%d") - (t . ""))) - - :hook ((emms-player-started . emms-player-mpd-show)) - - :config - (eval-after-load "emms-info" - '(add-to-list 'emms-info-functions 'emms-info-mpd))) - - (emms-all) - (emms-mode-line -1) - (emms-playing-time 1) - (emms-playing-time-disable-display) - - (use-package jao-emms-random-album - :after emms - :commands (jao-emms-random-album-next) - :init (setq jao-emms-random-album-notify-icon jao-notify-audio-icon)) - - (use-package jao-emms-info-track - :after emms - :init (setq jao-emms-show-icon jao-notify-audio-icon) - :config (jao-emms-info-setup 50)) - - (use-package jao-emms-lyrics - :after emms - :init (setq jao-lyrics-info-function 'jao-emms-lyrics-track-data)) - - (defvar jao-emms-random-album-notify--pause-icon - "/usr/share/icons/Tango/scalable/actions/media-playback-pause.svg") - - (defun jao-emms--show-status (s status) - (jao-notify (format "%s%s%s" - (cadr s) - (cdr (assoc (car s) status)) - (caddr s)) - "emms" - (if (string= "pause" (cdr (assoc "state" status))) - jao-emms-random-album-notify--pause-icon - jao-notify-audio-icon))) - - (defun jao-emms--osd-status (s &optional pref suff) - (emms-player-mpd-get-status (list s (or pref "") (or suff "")) - 'jao-emms--show-status)) - - #+END_SRC -***** helper functions - #+begin_src emacs-lisp - (defun jao-emms-volume-delta (d) - (funcall emms-volume-change-function d)) - - (defun jao-emms-show-volume () - (jao-emms--osd-status "volume" "Volume " "%")) - - (defalias 'jao-emms-update-cache 'emms-player-mpd-update-all-reset-cache) - - (defun jao-emms-load-streams () - (interactive) - (emms-play-playlist (expand-file-name "~/var/lib/music/streams.list"))) - - (defun jao-emms-search () - (interactive) - (let ((by (completing-read "Search by: " - '("artist" - "composer" - "performer" - "title" - "album" - "names")))) - (if (string= "names" by) - (emms-browser-search-by-names) - (emms-browser-search (list (intern (concat "info-" by))))))) - - (defun jao-emms-echo () - (interactive) - (emms-show) - (jao-emms-update-echo-string) - (emms-show)) - #+end_src -***** Media global aliases - #+begin_src emacs-lisp - (defalias 'jao-player-connect 'emms-player-mpd-connect) - (defalias 'jao-player-toggle 'emms-pause) - (defalias 'jao-player-next 'emms-next) - (defalias 'jao-player-previous 'emms-previous) - (defalias 'jao-player-stop 'emms-stop) - (defalias 'jao-player-start 'emms-start) - (defalias 'jao-player-seek-forward 'emms-seek-forward) - (defalias 'jao-player-seek-backward 'emms-seek-backward) - (defalias 'jao-player-play 'emms-start) - (defalias 'jao-player-search 'jao-emms-search) - (defalias 'jao-player-vol-delta 'jao-emms-volume-delta) - (defalias 'jao-player-volume 'jao-emms-show-volume) - (defalias 'jao-player-osd 'jao-emms-show-osd) - (defalias 'jao-player-echo 'jao-emms-echo) - (defalias 'jao-player-list 'emms-playlist-mode-go) - (defalias 'jao-player-browse 'emms-browser) - (defalias 'jao-player-random-album 'jao-emms-random-album-next) - #+end_src *** mpris #+begin_src emacs-lisp (use-package jao-mpris @@ -3156,6 +3024,28 @@ (define-key mpdel-browser-mode-map (kbd "n") #'next-line) (define-key mpdel-browser-mode-map (kbd "p") #'previous-line) #+END_SRC +*** mpc + #+begin_src emacs-lisp + (use-package elmpd :ensure t) + + (use-package jao-mpc + :demand t + :commands jao-mpc-setup) + + (jao-mpc-setup) + + (defalias 'jao-player-connect 'jao-mpc-connect) + (defalias 'jao-player-toggle 'jao-mpc-toggle) + (defalias 'jao-player-next 'jao-mpc-next) + (defalias 'jao-player-previous 'jao-mpc-previous) + (defalias 'jao-player-stop 'jao-mpc-stop) + (defalias 'jao-player-seek-forward 'jao-mpc-seek-forward) + (defalias 'jao-player-seek-backward 'jao-mpc-seek-backward) + (defalias 'jao-player-play 'jao-mpc-play) + (defalias 'jao-player-echo 'jao-mpc-echo-current) + (defalias 'jao-player-list 'jao-mpc-show-playlist) + (defalias 'jao-player-browse 'jao-mpc-show-albums) + #+end_src *** hydras #+begin_src emacs-lisp (require 'jao-lyrics) @@ -3163,7 +3053,7 @@ (defun jao-show-some-lyrics (arg) (interactive "P") (if (string-blank-p (or jao-mpris-track-string "")) - (jao-show-lyrics arg 'jao-emms-lyrics-track-data) + (jao-show-lyrics arg 'jao-mpc-lyrics-track-data) (jao-show-lyrics arg 'jao-mpris-artist-title))) (defalias 'jao-player-show-lyrics 'jao-show-some-lyrics) @@ -3185,7 +3075,7 @@ (interactive) (jao-notify "Volume" (format "%s%%" (jao-player-volume)))) - (use-package jao-emms-random-album) + (use-package jao-random-album :demand t) (pretty-hydra-define jao-hydra-spotify (global-map "s-s" :color blue :quit-key "q") @@ -3202,7 +3092,6 @@ "Browse" (("b" mpdel-pop-to-browser "browser") ("l" mpdel-playlist-open "playing list") - ;; ("m" jao-counsel-spotify-change-mpris "change mpris provider") ("c" (mpdel-core-replace-current-playlist) "clear list" :color red) ("s-s" jao-hydra-spotify/body nil)))) @@ -3230,11 +3119,8 @@ ("U" jao-mixer-capture-up "capture up" :color red) ("V" (jao-mixer-get-level "Capture") "show")) "Utilities" - (("C" jao-emms-update-cache "refresh cache") - ("c" jao-player-connect "reconnect to mpd") - ("r" jao-emms-random-album-toggle "toggle random album" - :toggle jao-emms-random-album-p) - ("N" jao-player-random-album "random album") + (("c" jao-player-connect "reconnect to mpd") + ("N" jao-random-album-next "random album") ("s-m" jao-hydra-media/body nil)))) #+end_src |