Last active
January 3, 2022 17:50
-
-
Save koonix/353c058603027463cfff085db4e77875 to your computer and use it in GitHub Desktop.
Play music in terminal via mpv.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
clear -x; tput civis # hide cursor | |
mpv \ | |
--audio-display=no --term-osd-bar --force-window=no \ | |
--keep-open=yes --display-tags-clr --term-title='mpv' \ | |
--msg-level=cplayer=error,ffmpeg=fatal,ffmpeg/demuxer=error \ | |
--term-status-msg='File: ${filename}\n\nTitle: ${metadata/by-key/title}\nArtist: ${metadata/by-key/artist}\nAlbum: ${metadata/by-key/album}\n\n${!playlist-count==1:Playing ${playlist-pos-1}/${playlist-count}\n}${?pause==yes:(Paused) }${time-pos} / ${duration}' \ | |
--term-osd-bar-chars='[-> ]' "$@" | |
tput cnorm # cursor back to normal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment