feat: 更新版本号至0.2.3并调整启动配置

移除音频启动脚本并新增系统设置配置文件
This commit is contained in:
2025-09-01 17:29:41 +08:00
parent 00e46bf8c1
commit 35955cb947
4 changed files with 104 additions and 30 deletions

View File

@@ -1,4 +1,4 @@
_G._HOST = _G._HOST .. " (LeonOS 0.2.2)" _G._HOST = _G._HOST .. " (LeonOS 0.2.3)"
local fs = rawget(_G, "fs") local fs = rawget(_G, "fs")
_G._RC_ROM_DIR = _RC_ROM_DIR or (...) and fs.exists("/leonos") and "/leonos" or "/rom" _G._RC_ROM_DIR = _RC_ROM_DIR or (...) and fs.exists("/leonos") and "/leonos" or "/rom"
@@ -32,7 +32,7 @@ local rc = {
_VERSION = { _VERSION = {
major = 0, major = 0,
minor = 2, minor = 2,
patch = 2 patch = 3
}, },
queueEvent = pull(os, "queueEvent"), queueEvent = pull(os, "queueEvent"),
startTimer = pull(os, "startTimer"), startTimer = pull(os, "startTimer"),

View File

@@ -1,27 +0,0 @@
-- LeonOS Startup Music
local rc = ...
local peripheral = require("peripheral")
local speaker = peripheral.find("speaker")
-- 检查是否连接了扬声器
if speaker then
-- 简单的开机音乐C大调音阶
-- 格式: {instrument = 乐器, pitch = 音高(半音), duration = 持续时间}
local notes = {
{instrument = "harp", pitch = 6, duration = 0.25}, -- C4
{instrument = "harp", pitch = 8, duration = 0.25}, -- D4
{instrument = "harp", pitch = 10, duration = 0.25}, -- E4
{instrument = "harp", pitch = 11, duration = 0.25}, -- F4
{instrument = "harp", pitch = 13, duration = 0.25}, -- G4
{instrument = "harp", pitch = 15, duration = 0.25}, -- A4
{instrument = "harp", pitch = 17, duration = 0.25}, -- B4
{instrument = "harp", pitch = 18, duration = 0.5} -- C5
}
-- 播放音乐
for _, note_info in ipairs(notes) do
-- 播放音符使用默认音量1.0
speaker.playNote(note_info.instrument, 1.0, note_info.pitch)
rc.sleep(note_info.duration)
end
end

View File

@@ -0,0 +1,101 @@
-- setting definitions
local settings = require("settings")
settings.define("list.show_hidden", {
description = "Show hidden files in list's output",
type = "boolean",
default = false
})
settings.define("bios.compat_mode", {
description = "Attempt some LeonOS compatibility by injecting APIs into _G.",
type = "boolean",
default = false
})
settings.define("shell.tracebacks", {
description = "Show error tracebacks in the shell.",
type = "boolean",
default = false
})
settings.define("edit.scroll_offset", {
description = "How many lines to keep between the cursor and the screen edge.",
type = "number",
default = 3
})
settings.define("edit.force_highlight", {
description = "Whether to use the highlighting editor, even on basic computers.",
type = "boolean",
default = false
})
settings.define("edit.scroll_factor", {
description = "Related to how many lines the editor should jump at a time when scrolling. Determined by term_height/scroll_factor. Adjust this for performance.",
type = "number",
default = 8
})
settings.define("edit.color_separator", {
description = "What color separating characters (e.g. ()[];{}) should be.",
type = "string",
default = "lightBlue"
})
settings.define("edit.color_operator", {
description = "What color operators (e.g. +-/*) should be.",
type = "string",
default = "lightGray"
})
settings.define("edit.color_keyword", {
description = "What color keywords (e.g. local, for, if) should be.",
type = "string",
default = "orange"
})
settings.define("edit.color_boolean", {
description = "What color booleans (true/false) should be.",
type = "string",
default = "purple"
})
settings.define("edit.color_comment", {
description = "What color comments should be.",
type = "string",
default = "gray"
})
settings.define("edit.color_global", {
description = "What color globals (e.g. print, require) should be.",
type = "string",
default = "lime"
})
settings.define("edit.color_string", {
description = "What color strings should be.",
type = "string",
default = "red"
})
settings.define("edit.color_number", {
description = "What color numbers (e.g. 2, 0xF3, 0.42) should be.",
type = "string",
default = "magenta"
})
settings.define("bios.restrict_globals", {
description = "Disallow global variables",
type = "boolean",
default = false
})
settings.define("bios.parallel_startup", {
description = "Run startup scripts from /startup in parallel",
type = "boolean",
default = false
})
settings.load()

View File

@@ -1,5 +1,5 @@
-- LeonOS installer -- LeonOS installer
local INSTALLER_VERSION = "0.2.2" local INSTALLER_VERSION = "0.2.3"
local DEFAULT_ROM_DIR = "/leonos" local DEFAULT_ROM_DIR = "/leonos"
print("Start loading LeonOS installer ("..INSTALLER_VERSION..")...") print("Start loading LeonOS installer ("..INSTALLER_VERSION..")...")