th507 / screen-resolution-switcher Goto Github PK
View Code? Open in Web Editor NEWA simple command line screen resolution & dark-mode switcher written in Swift.
License: MIT License
A simple command line screen resolution & dark-mode switcher written in Swift.
License: MIT License
The current master
branch is unable to list the resolution on multiple screens.
Expected output (available on commit 9f33910):
# ./scres.swift -l
Display 0: 2880 x 1800 @ 1x @ 60Hz
Display 1: 3840 x 2160 @ 1x @ 60Hz
#
Actual output (on master):
# ./scres.swift -l
Display 0: 2880 x 1800 @ 1x @ 60Hz
#
In looking at the code (both manually and using git bisect
) it seems the next commit (f4fca5e) is the culprit. It creates an array of size 1 rather than use the previous maxDisplays
value. This seems to limit the tool to managing only the internal display.
Not working when trying to change resolution of the Mac mini without monitor connected I am getting
./scres.swift -s 0 3072 1920
This mode is unavailable
For example, lets say my list of resolutions for display 0 is as below
Supported Modes for Display 0:
1440 * 900 @ 60Hz
1152 * 720 @ 60Hz
1024 * 768 @ 60Hz
1024 * 640 @ 60Hz
1280 * 800 @ 60Hz
800 * 600 @ 60Hz
800 * 500 @ 60Hz
640 * 480 @ 60Hz
720 * 480 @ 60Hz
if I am using command "retina -s 0 1024", it is always selecting first resolution to switch. How can i select 1024640 resolution instead of 1024768.
First of all, thank you for this tool. I have a weird issue with M1 Mac mini and LG 4K display where the display resolution gets changed after sleep/wake, and while that is pretty annoying, I'm able to fix it pretty easily using the scres tool.
Now, the set command (-s) seems to find the first display resolution that matches with the input, and I can't find a way to provide the desired refresh rate. My display offers the same resolution in both 30Hz and 60Hz, and scres picks the 30Hz since it comes first, which is not what I want.
> scres -m | grep 3008
3008 x 1692 @ 2x @ 30Hz
⮕ 3008 x 1692 @ 2x @ 60Hz
3008 x 1692 @ 1x @ 30Hz
3008 x 1692 @ 1x @ 60Hz
> scres -s 3008
> scres -m | grep 3008
⮕ 3008 x 1692 @ 2x @ 30Hz
3008 x 1692 @ 2x @ 60Hz
3008 x 1692 @ 1x @ 30Hz
3008 x 1692 @ 1x @ 60Hz
I'm currently working around by hard coding to always prefer 60Hz in the code, but would be nice if the -s
command accepts the refresh rate as well, or sort the configurations by the refresh rate after retina scaling so that higher refresh rate is preferred.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.