Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.4k views
in Technique[技术] by (71.8m points)

mac os如何用命令行修改系统分辨率,或者如何用代码修改系统分辨率?

问题出现的环境背景及自己尝试过哪些方法

现在想用electron开发一个桌面应用可以设置macos的系统分辨率,想到的是用node调用applesctrpt脚本,但是会弹出可视化界面,想使用node运行shell命令来修改分辨率,不知道有什么命令可以用
尝试安装了cscreen,然后比如运行cscreen -d 64 -x 1680 -y 1050这种配置会报错,只能修改成很小的,比如cscreen -d 64 -x 800 -y 600,请问还有什么更好的方法?### 问题描述

相关代码

var exec = require('child_process').exec;
function execute(cmd){
    
    exec(cmd, function(error, stdout, stderr) {
        if(error){
            console.error(error);
        }
        else{
            console.log("success");
        }
    });
    
}
execute('cscreen -d 64 -x 1680 -y 1050');

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...