dylanaraps / neofetch

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

Display wrong resolution info on Mac #1067

Open ApolloBian opened 6 years ago

ApolloBian commented 6 years ago

Description

I'm running neofetch on MacBook and it doesn't display screen resolution right

Neofetch version

Neofetch 5.0.1

Screenshot

ApolloBian commented 6 years ago

It's the get_resolution func that needs to be fixed

konimex commented 6 years ago

I'm not sure what went wrong here.

Both show 3840 x 2160.

ApolloBian commented 6 years ago

@konimex the refresh rate is wrong, it shows @4kHz

konimex commented 6 years ago

Can you provide a full log?

Also, can you provide a text output (not image screenshot) of system_profiler SPDisplaysDataType)? The awk is a bit.. broken here. I guess.

iandrewt commented 6 years ago

Ah, looks like the output of system_profiler SPDisplaysDataType changed in Mojave. Like, breakingly different it seems. We'll need to add a check for Mojave to fix this one I think

I don't have a Retina Mac with Mojave on it unfortunately though so it'll be blind awk repair

ApolloBian commented 6 years ago

@konimex Here is the full output of system_profiler SPDisplaysDataType:

Graphics/Displays:

    Intel Iris Pro:

      Chipset Model: Intel Iris Pro
      Type: GPU
      Bus: Built-In
      VRAM (Dynamic, Max): 1536 MB
      Vendor: Intel
      Device ID: 0x0d26
      Revision ID: 0x0008
      Metal: Supported, feature set macOS GPUFamily1 v4
      Displays:
        DELL U2718Q:
          Resolution: 3840 x 2160 (2160p 4K UHD - Ultra High Definition)
          UI Looks like: 1920 x 1080 @ 60 Hz
          Framebuffer Depth: 24-Bit Color (ARGB8888)
          Display Serial Number: 5DWRH7AU05LL
          Main Display: Yes
          Mirror: Off
          Online: Yes
          Rotation: Supported
          Automatically Adjust Brightness: No
          Connection Type: DisplayPort
        DELL U2718Q:
          Resolution: 2160 x 3840
          UI Looks like: 1080 x 1920 @ 60 Hz
          Framebuffer Depth: 24-Bit Color (ARGB8888)
          Display Serial Number: 5DWRH7AQ12UL
          Mirror: Off
          Online: Yes
          Rotation: 90
          Automatically Adjust Brightness: No
          Connection Type: DisplayPort

Hope it helps!

strafe commented 6 years ago

@iandrewt I'm seeing the wrong resolution on High Sierra. image image

dylanaraps commented 5 years ago

ping @iandrewt

Omega1902 commented 5 years ago

@iandrewt I have the same issue as @strafe with the wrong resolution My MacBook Pro 15" has a real resolution of 2880x1800 bildschirmfoto 2018-10-17 um 09 04 06 1

strafe commented 5 years ago

Seems to be a problem with screenresolution rather than neofetch. image image


After running brew uninstall --ignore-dependencies screenresolution the fallback to system_profiler's output is accurate, although as mentioned in the changelog where screenresolution was introduced, there is a noticeable pause before the resolution is printed.

iandrewt commented 5 years ago

@Omega1902 are you running at 1440x900@2x?

Also, I'm pretty sure the 13" MacBook Pro defaults to 1440x900@2x now instead of 1280x800@2x like on pre-2016 models. The 15" is similar, defaulting to 1680x1050@2x instead of 1440x900@2x.

@dylanaraps are we intending to show the "UI Looks Like" or "Resolution"?

dylanaraps commented 5 years ago

Resolution (Full pixel w/h)

iandrewt commented 5 years ago

Alright.

I might try doing a full rewrite of macOS resolution detection. My new MacBook Air has another edge case: 1440x900 @ eXtendedHz

iandrewt commented 5 years ago

We'll have to remove screenresolution support if we want full pixel w/h, it outputs the "UI Looks Like" resolution. I'll try find a faster alternative to system_profiler too.

Omega1902 commented 5 years ago

@iandrewt yes I did, without realizing... I changed to scaled resolution and now 1440x900@2x is displayed in neofetch. Thanks! And thanks for the great work you do with the whole program ;)

dylanaraps commented 5 years ago

@iandrewt let's remove screenresolution support for now.

kode54 commented 4 years ago

Hey, look, I fixed it. Should I send a PR?

https://github.com/kode54/neofetch/commit/54376dbe8edd57422721ebb05821c9cf7c686142

image

Yeaaaah, try not to mind the Hack too much. My MBP is in the shop, awaiting a new top case and battery replacement, to the tune of $300. And this Hack has better specs anyway.

dylanaraps commented 4 years ago

Sure, send a PR my way!

strafe commented 3 years ago

@dylanaraps since the maintainer of screenresolution is incredibly inactive and hasn't responded to certain PRs for 4+ years. We could always switch back to the upstream version if he ever decides to merge some of the outstanding PRs.

Could we consider:

AgentRin commented 3 years ago

So I installed NeoFetch about 2 months ago. Since then I upgraded my Radeon Sapphire GPU to a Radeon RX 580. NeoFetch still shows the old GPU, but when I directly run system_profiler SPDisplaysDataType it shows the correct card.

Screen Shot 2021-01-01 at 3 09 20 PM

Screen Shot 2021-01-01 at 3 09 49 PM

Is there a cache to flush?

vscsilva commented 3 years ago

Neofetch still shows the wrong resolution.

image

Output of screenresolution: image

PatrickBK commented 2 years ago

Seems to be a problem with screenresolution rather than neofetch. image image

After running brew uninstall --ignore-dependencies screenresolution the fallback to system_profiler's output is accurate, although as mentioned in the changelog where screenresolution was introduced, there is a noticeable pause before the resolution is printed.

Yes, removing screenresolution works and in my experience neofetch doesn't slow down when doing so. Thanks :-)

Schermafbeelding 2021-12-13 om 15 05 34

strafe commented 2 years ago

Yes, removing screenresolution works and in my experience neofetch doesn't slow down when doing so. Thanks :-)

You can compare the speeds for yourself with the time command, on my machine both are "fast" but system_profiler is an order of magnitude slower than screensolution on average.

kode54 commented 2 years ago

Unfortunately, screenresolution doesn't know how to retrieve the physical versus scaled down resolutions of a display. This is needed to retrieve the 1x versus 2x sizes of a display which is using scaling. Scaling is an arbitrary integer scale, but Apple mostly only supports 2x on desktop machines.

strafe commented 2 years ago

There is an open PR on screenresolution to add a new argument that returns the native resolution.

cikupin commented 2 years ago

on brew, I think we need to remove screenresolution from brew formula dependencies, to force it using system_profiler SPDisplaysDataType

https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/neofetch.rb#L14

I've just submit an issue to homebrew. Hope that it can be fixed. https://github.com/Homebrew/homebrew-core/issues/94002

strafe commented 2 years ago

That's not going to be accepted because screenresolution is still used in neofetch, you'd need to make a PR removing it first. I think a better solution is to switch to the working fork on a private tap though.