diff --git a/assets/themes/chimera_theme.tres b/assets/themes/chimera_theme.tres index 6374aa9..7437c81 100644 --- a/assets/themes/chimera_theme.tres +++ b/assets/themes/chimera_theme.tres @@ -50,6 +50,7 @@ corner_radius_bottom_left = 5 [resource] Button/styles/hover = SubResource("StyleBoxFlat_gs8jf") Button/styles/normal = SubResource("StyleBoxFlat_p3csy") +Dialog/base_type = &"PanelContainer" Dialog/styles/panel = SubResource("StyleBoxFlat_xapbx") PanelContainer/styles/panel = SubResource("StyleBoxFlat_k1e5x") ProgressBar/styles/background = SubResource("StyleBoxFlat_v38kh") diff --git a/core/systems/frzr/frzr.gd b/core/systems/frzr/frzr.gd index c3a041c..b5126ac 100644 --- a/core/systems/frzr/frzr.gd +++ b/core/systems/frzr/frzr.gd @@ -35,6 +35,8 @@ func get_available_disks() -> Array[Disk]: if not line.contains("disk"): continue var parts := line.split(" ", false, 3) + if parts.size() < 4: + continue var disk := Disk.new() disk.name = parts[0] disk.path = "/dev/" + disk.name diff --git a/core/ui/menus/network_menu.gd b/core/ui/menus/network_menu.gd new file mode 100644 index 0000000..5ab524d --- /dev/null +++ b/core/ui/menus/network_menu.gd @@ -0,0 +1,36 @@ +extends Control + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + print(RenderingServer.get_video_adapter_name()) + print(RenderingServer.get_video_adapter_type()) + print(await get_current_card_device()) + +func get_current_card_device() -> String: + var cmd := Command.new("glxinfo") + cmd.dry_run = false + if await cmd.execute() != OK: + return "" + + for line in cmd.stdout.split("\n"): + if not "Device: " in line: + continue + + # Match on the last part of the string to get the device ID + # E.g. Device: AMD Radeon Graphics (renoir, LLVM 16.0.6, DRM 3.54, 6.5.5-arch1-1) (0x1636) + var regex := RegEx.new() + regex.compile("\\(0[xX][0-9a-fA-F]+\\)$") + var result := regex.search(line) + if not result: + continue + var match_str := result.get_string() + + return match_str.replace("0x", "").replace(")", "") + + return "" + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + pass diff --git a/core/ui/menus/network_menu.tscn b/core/ui/menus/network_menu.tscn index 647b06c..2c6615b 100644 --- a/core/ui/menus/network_menu.tscn +++ b/core/ui/menus/network_menu.tscn @@ -1,4 +1,6 @@ -[gd_scene format=3 uid="uid://bv456bg77othn"] +[gd_scene load_steps=2 format=3 uid="uid://bv456bg77othn"] + +[ext_resource type="Script" path="res://core/ui/menus/network_menu.gd" id="1_krc2r"] [node name="NetworkMenu" type="Control"] layout_mode = 3 @@ -7,3 +9,4 @@ anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 +script = ExtResource("1_krc2r") diff --git a/project.godot b/project.godot index 2b9154a..ecb1772 100644 --- a/project.godot +++ b/project.godot @@ -12,7 +12,7 @@ config_version=5 config/name="ChimeraOS Installer" run/main_scene="res://main.tscn" -config/features=PackedStringArray("4.1", "GL Compatibility") +config/features=PackedStringArray("4.2", "GL Compatibility") boot_splash/show_image=false config/icon="res://icon.svg"