add cpu module with /proc/stat collector, visible grid cells, dark background, and fullscreen dashboard

This commit is contained in:
Eric Smith 2026-05-20 12:59:50 -04:00
parent 5aabc1f7ef
commit 499df2846c
6 changed files with 190 additions and 3 deletions

View file

@ -3,6 +3,36 @@ extends Control
@onready var grid: DashboardGrid = %DashboardGrid
var _modules: Array = []
func _ready() -> void:
get_window().mode = Window.MODE_FULLSCREEN
_set_background()
_add_modules()
func _set_background() -> void:
var bg := StyleBoxFlat.new()
bg.bg_color = Color(0.08, 0.08, 0.12, 1.0)
add_theme_stylebox_override("panel", bg)
func _add_modules() -> void:
var cpu := preload("res://panels/cpu/cpu_module.tscn").instantiate()
grid.place_module(cpu, 0, 0)
_modules.append(cpu)
# Start a timer to refresh all modules every second
var timer := Timer.new()
timer.timeout.connect(_refresh_modules)
timer.autostart = true
timer.wait_time = 1.0
add_child(timer)
func _refresh_modules() -> void:
var data: Dictionary = {}
for mod in _modules:
if is_instance_valid(mod) and mod.has_method("refresh"):
mod.refresh(data)