Terminal command to show connected displays/monitors/resolutions?

后端 未结 2 1357
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-01 23:26

Is there a way to get the information about connected monitors and displays and their resolutions via the terminal in OS X?

I have some installations that run on multip

2条回答
  •  滥情空心
    2021-02-02 00:15

    You can also use a command-line tool called cscreen:

    # install homebrew if you don't have it already
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    
    # install cscreen
    brew install --cask cscreen
    
    # list displays
    cscreen -l
    

    output:

    DisplayID  Index     Depth     Width     Height  Refresh
           1       1        32      1440        900    60
           2       2        32      1920       1080    60
    use -h to display all usage options
    

    Note:

    • The first time you try to open the cscreen the os will not allow it because it isn't signed.
    • You have to go to Security & Privacy in System Preferences and allow it.

    Homebrew package search

提交回复
热议问题