From 91efeb74b823e84ca0bcb1b93bb8f16d917df207 Mon Sep 17 00:00:00 2001 From: KAAAsS Date: Tue, 17 Oct 2023 11:38:32 +0800 Subject: [PATCH] =?UTF-8?q?feat(constraints):=20gui=20=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20MacOS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- knotfiles/constraints.nu | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/knotfiles/constraints.nu b/knotfiles/constraints.nu index e3ba879..0740db3 100644 --- a/knotfiles/constraints.nu +++ b/knotfiles/constraints.nu @@ -21,15 +21,23 @@ module os { } } +export use os + # 图形界面约束 export def gui [] { use pkg.nu - pkg check_install? libxrandr + if (os linux) { + # Linux 暂时只考虑 X11 + pkg check_install? libxrandr + } else if (os darwin) { + # MacOS 都是图形界面 + true + } else { + false + } } -export use os - # 获得默认的约束 export def default_constraints [] { {