A modern, interactive terminal-based tool for switching display resolutions on macOS with an intuitive interface featuring centered cursor navigation and fast scrolling.
- π₯οΈ Multi-Display Support: Switch resolutions on multiple displays independently
- π― Centered Cursor Navigation: Cursor stays centered while content scrolls smoothly
- β‘ Fast Navigation: Page Up/Down for quick scrolling through resolution lists
- π± HiDPI Support: Clear identification of HiDPI (Retina) modes
- π’ Mode Numbers: Shows actual displayplacer mode numbers for reference
- π Smart Sorting: HiDPI modes first, then by resolution size and refresh rate
- πΎ Preserve Settings: Non-selected displays maintain their current modes
- π± Responsive UI: Adapts to any terminal size with proper viewport management
- macOS: This tool is designed specifically for macOS
- displayplacer: Install via Homebrew
brew install displayplacer
- Python 3.7+: Built-in on modern macOS (uses built-in curses library)
-
Download the script:
curl -O https://raw.githubusercontent.com/rodrigopolo/macos-display-switcher/main/display_switcher.py
-
Make it executable:
chmod +x display_switcher.py
-
Run it:
python3 display_switcher.py
Simply run the script to launch the interactive interface:
python3 display_switcher.pyβββββββββββββββββββββββββββββββββββββββββββββββ
β Display Resolution Switcher β
βββββββββββββββββββββββββββββββββββββββββββββββ
Current:
29 inch external screen (3) [PRI]: 2560x1080 @60Hz
24 inch external screen (1): 1920x1080 @60Hz
Displays (ββ):
βΊ 29 inch external screen (3)
24 inch external screen (1)
Modes for 29 inch external screen (3) (ββ):
βΊ [ 26] 2560x1080 (HiDPI) @60Hz [CUR]
[ 27] 1920x1080 (HiDPI) @60Hz
[ 28] 1680x1050 (HiDPI) @60Hz
β more modes below β
ββ Display | ββ Mode | PgUp/PgDn Fast | Enter Apply | Q Quit
| Key | Action |
|---|---|
β β |
Switch between displays |
β β |
Navigate resolution modes |
Page Up Page Down |
Fast scroll through modes |
Enter |
Apply selected resolution |
Q or Esc |
Quit |
- [PRI]: Indicates the primary display
- [CUR]: Shows the currently active resolution
- [123]: Mode number (matches displayplacer's numbering)
- (HiDPI): Indicates high-density/Retina display modes
- βΊ Cursor: Shows currently selected item
- β/β indicators: Show when more items are available above/below
- Discovery: Calls
displayplacer listto enumerate all connected displays and their supported resolutions - Parsing: Extracts display information including mode numbers, resolutions, refresh rates, and HiDPI status
- Sorting: Organizes modes with HiDPI first, then by resolution width (largest first), then by refresh rate
- Navigation: Provides smooth centered-cursor navigation through the mode list
- Application: Constructs and executes
displayplacercommands to apply the selected resolution
Modes are intelligently sorted for optimal user experience:
- HiDPI modes first - Most commonly used on Retina displays
- By width (descending) - Larger resolutions appear first
- By refresh rate (descending) - Higher refresh rates preferred
Example order:
2560x1600 (HiDPI) @60Hz
1920x1200 (HiDPI) @60Hz
1680x1050 (HiDPI) @60Hz
2560x1600 @60Hz
1920x1200 @60Hz
1680x1050 @60Hz
Perfect for laptop users who occasionally connect external displays.
Ideal for:
- Developers with multiple monitors
- Creative professionals with mixed display types
- Users with different resolution preferences per display
The tool clearly identifies and prioritizes HiDPI modes, making it easy to:
- Switch between native and scaled resolutions
- Find the optimal resolution for your workflow
- Understand the relationship between physical and logical resolutions
Error: displayplacer not found. Install with: brew install displayplacerSolution: Install displayplacer using Homebrew: brew install displayplacer
This can happen if displayplacer cannot detect displays properly.
Solution: Try running displayplacer list manually to verify displayplacer is working.
The interface adapts to terminal size, but very small terminals may not display properly. Solution: Resize your terminal to at least 80x24 characters.
If a resolution fails to apply, you'll see an error message. Common causes:
- Display doesn't support the selected mode
- Display connection issues
- macOS display restrictions
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.
- Clone the repository
- The tool uses only built-in Python libraries, so no additional dependencies are needed
- Test with multiple display configurations if possible
This project is licensed under the MIT License - see the LICENSE file for details.
Copyright Β© 2024 Rodrigo Polo
- Built on top of the excellent displayplacer utility
- Inspired by the need for a more user-friendly display resolution management tool on macOS