dylanaraps / neofetch

🖼️ A command-line system information tool written in bash 3.2+
MIT License
21.91k stars 1.76k forks source link

Displaying image in macOS with iTerm2 #1053

Closed n8ta closed 6 years ago

n8ta commented 6 years ago

Description

I'm attempting to display a png with neofetch. I'm using iterm2 I've verified iterm2 images work using imagecat from https://www.iterm2.com/documentation-images.html. I've also checked that the path in my config is valid.

Neofetch version

5.0.1

Screenshot

https://imgur.com/a/TSmtTpX

Config file

https://pastebin.com/udfrSA0c

Verbose log

https://pastebin.com/dRfE25wi

umsretuza commented 6 years ago

This is true, I can verify this issue on macOS El Capitan. (iTerm2) screen shot 2018-07-14 at 8 31 57 am

shelldandy commented 6 years ago

image

Rolled back to v3.2.0 which doesn't have the issue on macOS

n8ta commented 6 years ago

@shelldandy Where can I find v3.2.0? And are you sure it works for images? Mine currently works for ascii.

shelldandy commented 6 years ago

image

100% sure, just clone that release and install it. Profit.

shelldandy commented 6 years ago

Easier to follow instructions...

1) Clone repo. 2) git checkout tags/3.2.0 3) ./neofetch 4) Test everything out... 5) make install

shelldandy commented 6 years ago
shelldandy commented 6 years ago

So IMHO 4.0.1 is kind of the best for macOS right now

image

daukadolt commented 6 years ago

@shelldandy , I've had the same ASCII problem on the latest version from HomeBrew. I get the following (screenshot attached) whenever I do

./neofetch --w3m path/to/img.png on versions that you've listed above as working.

screen shot 2018-07-28 at 3 01 49 am
shelldandy commented 6 years ago

@daukadolt my tests were only doing ./neofetch withou any additional params. so yeah food for thought 😛

shelldandy commented 6 years ago

you also have of course to install imgcat or other related stuff so the image stuff works

n8ta commented 6 years ago

@shelldandy Switching to version 3.2.0 solved my issue. Thank you!

konimex commented 6 years ago

Probably related: #1045, possibly fixed by #1048.

@UncleIroh can you test the latest master? Thanks.

n8ta commented 6 years ago

@konimex Issue was not resolved by this.

Verbose Log: https://pastebin.com/H4DH1RZ3

Screen: https://s15.postimg.cc/sl6ez4w6j/Screen_Shot_2018-08-24_at_6.00.47_PM.png

Config: https://pastebin.com/M6ngFYx0

konimex commented 6 years ago

My apologies, I forgot to push changes to upstream.

The git master has been updated, how's the result?

n8ta commented 6 years ago

@konimex Partial fix, the image shows up but the quality is notably worse than the old version.

Verbose Log: https://pastebin.com/iFaPUkRN

Screen (top new, bottom old) https://s15.postimg.cc/9peikrbdn/Screen_Shot_2018-08-24_at_11.17.12_PM.png

Config: Same

konimex commented 6 years ago

Alright. So the main problem is fixed.

However, the low-quality image is a different problem, so this is out-of-scope for this particular issue.

Originally, @dylanaraps pushed https://github.com/dylanaraps/neofetch/commit/ae7271578afacd7964ff7b610dccd75c5190d68 (which reduces the image quality) to "improve image mode performance". That's the source of your current issue.

I'm going to close this issue since the original problem is solved. But I suggest open a different issue to request to increase the image quality.

n8ta commented 6 years ago

@konimex Opened #1079, thanks for the help.

yuidev commented 5 years ago

It's not fixed. Still doesn't work.

legallyrobert commented 5 years ago

Can confirm, running iTerm2 build 3.2.6 on Mojave 10.14

Output is the same as the picture @UMS50 posted.

916253 commented 5 years ago

still doesn’t work ^ tested with iTerm 3.3 on 10.14.6 and the 10.15 betas

glics commented 5 years ago

iTerm 3.3.1 stable, Mojave 10.14.6, doesn't work

yuidev commented 5 years ago

09/01/19 newest stable build of both neofetch and iterm on mojave, still broken

On Fri, 23 Aug 2019 at 12:20, Giuseppe Careri notifications@github.com wrote:

iTerm 3.3.1 stable, Mojave 10.14.6, doesn't work

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dylanaraps/neofetch/issues/1053?email_source=notifications&email_token=AJ3KSAU6WFAKUABW6P6WIZTQF62VBA5CNFSM4FJWQRR2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD47ZMXI#issuecomment-524260957, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ3KSATGHRE5MTNT62WPGNDQF62VBANCNFSM4FJWQRRQ .

ghost commented 3 years ago

Catalina 10.15.6 iTerm 3.3.12

now it looks working.

user790235692 commented 3 years ago

Catalina 10.15.6 ITerm 3.3.12

neofetch --crop_mode fill --w3m /Users/lucas/Desktop/one_punch.png

image

it's not working for me  🙁

ghost commented 3 years ago

@Twistere

Is that --w3m the backend option? I think you should use the value iterm2 not w3m.

https://github.com/dylanaraps/neofetch/wiki/Image-Backends#iterm2

user790235692 commented 3 years ago

@Twistere

Is that --w3m the backend option? I think you should use the value iterm2 not w3m.

https://github.com/dylanaraps/neofetch/wiki/Image-Backends#iterm2

Thanks it's work 😊

codebysandwich commented 2 years ago

neofetch version 7.1.0 macos version 10.15.7 iterm2 version 3.4.14 can't load image

Goldeneye128 commented 2 years ago

Same problem as others. When i Launch neofetch with Iterm2 no image will come up. Just some ASCII char. I use the --iterm2 command.

I use neofetch version 7.1.0 macos version 12.1 iterm2 version 3.4.14 cannot load image at launch, only after launch.

leana8959 commented 2 years ago

I do get a image, but the size of the image is too small. How can I fix this ?

image

Thank you :)

n8ta commented 2 years ago

@leana8959 If your image is too small it probably won't be scaled up. Does the same thing happen with a larger say 1000x1000 image?

leana8959 commented 2 years ago

@n8ta My image is a photo taken with my DSLR, it's considerably bigger than 1000x1000. Is it because it's too large so it doesn't work ?

bozoputer commented 2 years ago

@leana8959 i had the same issue and this fixed it for me, after several hours of trying all sorts of stuff to no avail 😭

hope it helps!

leana8959 commented 2 years ago

@ekathuria Thank you! The method you mentioned worked! However, as I turn off the option to render the image at retina resolution, the image quality is quite poor. Is there any workaround for this? I suppose we'll need to tell ImageMagick to crop the image 2 times bigger than the area, so it has retina pixel density. Thanks again.

bozoputer commented 2 years ago

@leana8959 not sure. again, i only stumbled across that solution by way of luck and after many hours of weeping and gnashing of teeth as far as trying other things. i'm not familiar with the ImageMagick settings, as i didn't mess around with them at all.

nf
lubeats669 commented 1 year ago

@bozoputer Hi, could you help me to get an image png on neofetch? I tried many things. I installed Kitty, iterm2, and nothing. I only know the trick is the config but I don't know which modify. I have modified the backend part but nothing. Please give me your support. Currently I use macOS Monterey and neofetch 7.1

bozoputer commented 1 year ago

@lubeats669 As mentioned, I was only able to get it working with a lot of luck and with the solution I linked to above.

Notably, I received a new MacBook Pro for work last year and was unable to get an image working on that machine no matter what I tried, so the whole endeavor seems pretty hit or miss to me.

At any rate, I'm no longer using neofetch (or iTerm2).

lubeats669 commented 1 year ago

image

@bozoputer I was able to get it, after several hours of sending you the message to the forum. Now what I need is to execute a script that can be docked and can execute neofetch showing the system information and the custom logo. You know how to do it? I'm still looking for info and I'm very close. I am not a programmer. Greetings from Lima Peru.

bozoputer commented 1 year ago

@lubeats669 Looks like you're using the zsh shell, so you need to create a .zshrc file in your home directory if one doesn't already exist (the dot before zshrc in the filename is imperative) and add neofetch to it (i.e., simply add the word neofetch inside the file--see below).

.zshrc

After you save the file, run source ~/.zshrc in the terminal and you should be good to go.

lubeats669 commented 1 year ago

@bozoputer Hi, to get a custom image I used Kitty terminal and I have had to install imagemagick, both was installed using brew. And now I want to do an app o shorcut in dock bar where I could do a click and load kitty terminal with custom system info

bozoputer commented 1 year ago

@lubeats669 Whichever terminal you use (iTerm2, Kitty, Warp, etc.) if you want neofetch to run when you open it (whether via Finder, the Dock, Alfred, etc.) you will need to create a .zshrc file as described above.

In your comment you say you want to "execute a script ...[that] can execute neofetch". Although it can do much more, for your intents and purposes, the .zshrc file is that script.

lubeats669 commented 1 year ago

@bozoputer Hi again, I was trying to create the file you mentioned in your previous answer, but I can't get the symbol after the first brew word, I've even searched in the character viewer. Could you send me the transcribed code if you don't mind? Thanks in advance.

image

bozoputer commented 1 year ago

@lubeats669 not sure what you mean by "first brew word".

this should help you, though:

  1. navigate to your home directory in the terminal (simply type the command cd)
  2. list the files in your home directory by typing ls -a. if a .zshrc file is present, open it using vim or nano (google for info on how to do this). if no .zshrc file is listed, proceed to step 3.
  3. create a .zshrc file in the home directory by typing the command touch .zshrc (again, the . is imperative).
  4. finally, follow these instructions (i.e., add neofetch to the file, save and exit, then run source .zshrc. i've excluded the ~ in the source command here since you should already be in your home directory).
lubeats669 commented 1 year ago

friend, from the message that you wrote me together with the image of the code of the script that I have to create, I had already understood the idea, but the problem that I have is that I cannot enter the symbol that looks like the letter E after the first word " brew " inside the code you sent me. Could you do me the huge favor of writing me the code of the script in your reply message? I am immensely grateful for your time and I apologize for my ignorance. I am very curious and I do not rest until I find something, but said symbol, as I mentioned before, I cannot find it even in the system's character viewer.

image

image

bozoputer commented 1 year ago

@lubeats669 you only need to type the word neofetch (circled in red in the screenshot). ignore everything else--the other stuff was just part of the screenshot (it does other things for my shell) and is not related to neofetch in any way whatsoever.

i thought circling neofetch in red would make this clear, along with simply add the word neofetch inside the file.

lubeats669 commented 1 year ago

Thank you very much my friend, finally I can run neofetch with just one click. I was trying to run neofetch from Kitty because it is the only terminal that adjusts with images in the sense of space and text and for that I wanted to run the code from the dock and searching the internet I found that I had to create a small app to run my script either just the word neofetch or neofetch --kitty and now with your solution of the .zshrc file I am surprised that just by opening any version of the terminal, neofetch is executed. Thank you very much for your time and I apologize for not having correctly read your initial message about adding said word to .zshrc, which by the way I did not have in my home directory. Tell me in the same way I can execute any command line just by opening terminal, is that how .zshrc works?

bozoputer commented 1 year ago

Yay! Glad you were able to get everything set up how you wanted it!

Tell me in the same way I can execute any command line just by opening terminal, is that how .zshrc works?

I'm definitely no expert--what little I do know I learned by struggling as you have with this issue, and Googling--but the .zshrc is just a type of configuration file for the terminal that allows you to customize the behavior of the shell.

My suggestion is to have a look at shell scripting (i.e., writing bash scripts) if you want to do more extensive things.

Cheers!

lubeats669 commented 1 year ago

Great to know that, I thought you were a programmer. By the way, you can already show a custom image in Neofetch from your new MacBook Pro that you mentioned in another previous comment. As I said, you only have to install ImageMagick using Brew in terminal, then you only need to modify the config.conf file inside .config/neofetch and that's it. Getting to that solution took me 3 days, between reading and countless tests, I even installed ubuntu linux in a virtual machine to be able to check if some of the methods I found on the internet worked and maybe I could transfer it to macOS, finally among so much reading I discovered that install the specific app and with that, the problem was fixed.

bozoputer commented 1 year ago

@lubeats669 ”I thought you were a programmer…”

lol. so did i, my friend 🙃

lubeats669 commented 1 year ago

I've not understood. ha ha ha

poloxue commented 10 months ago

I found a replacement for Neofetch -> [fastfech](). It displayed the image successfully on my macOS.

image

It is much faster than neofetch. No delay.

I got it from this awesome-fetch site.