Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request - Artwork For Cmus? #495

Open
ghost opened this issue Aug 3, 2016 · 10 comments
Open

Request - Artwork For Cmus? #495

ghost opened this issue Aug 3, 2016 · 10 comments

Comments

@ghost
Copy link

ghost commented Aug 3, 2016

Hello,

Would it be possible to have cmus display artwork, or can it do this already?

As an example Ranger a console based file manager using w3m can display images.

http://ranger.nongnu.org/

@mahkoh
Copy link
Member

mahkoh commented Oct 8, 2016

Do you mean like this: http://ranger.nongnu.org/screenshots/ranger-screenshot_large-image-preview.png

Or via some external program?

@ghost
Copy link
Author

ghost commented Oct 10, 2016

Yes, album art displayed in the app and like how deadbeef is with images of the album art displayed on the left side of the screen in this image below;

f7d3c756-7bc6-11e6-9d11-5ee53fd13601

@mahkoh
Copy link
Member

mahkoh commented Apr 24, 2017

I do not believe that this will ever be implemented.

@ghost
Copy link
Author

ghost commented Oct 9, 2017

Sorry for late reply...

thanks

@yagarea
Copy link

yagarea commented Feb 18, 2021

w3m has great API for in terminal image preview. Filemanager ranger uses that:

a

This could be very elegant and effective solution.

@gunqqer
Copy link

gunqqer commented Feb 20, 2021

There's also a rust program, viu, which also can do this. I have a working script to show artwork (although a biiit pixelated, gives the real command line feel to it)

#!/bin/bash
#note: does not work with remote URLs, only URIs, image *must* be local
imageViewer="/home/gunqqer/.cargo/bin/viu"
playerName=cmus


currentUrl="$(urlencode -d "$(playerctl --player=$playerName metadata mpris:artUrl)" | sed 's/^file:\/\///')"
clear
viu "$currentUrl"
while true; do
	url="$(urlencode -d "$(playerctl --player=$playerName metadata mpris:artUrl)" | sed 's/^file:\/\///')"
	if [ "$currentUrl" != "$url" ]; then
		currentUrl="$url"
		clear
		$imageViewer "$url"
	fi
	sleep 10
done

edit: original script was pretty bad, better now

@nefthy
Copy link
Collaborator

nefthy commented Feb 20, 2021

Terminals do not have sufficient capabilities to display images. w3m and ranger do some funky x11 hackery to draw the image over the terminal window. I do not see that going into cmus.

@gunqqer
Copy link

gunqqer commented Feb 20, 2021

Yeah, tbh, while it would be nice to have it in cmus, trying to get w3m/w3mimgdisplay working is not fun at all. Not only are those tools difficult to work with, they don't even work well enough. If you try switching virtual desktops it'll get rid of the image.

Something like FBI or FIM could work better, but that would just be making a new window to display the image which defeats the purpose of having an inbuilt image. So I'd say if you want image viewing you can use my script or make your own way to view images however you want them.

@lochlainn
Copy link

@gunqqer if that script is living in a repository now, it would be really useful to link it in the wiki! I'm sure some other people would like to use it as well.

@gunqqer
Copy link

gunqqer commented Apr 28, 2021

@lochlainn Well, here ya are: https://github.com/gunqqer/musicScripts
https://github.com/gunqqer/musicScripts/blob/master/viu.sh
Feel free to submit PRs if you want to improve it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants
@flyingmutant @nefthy @mahkoh @lochlainn @yagarea @gunqqer and others