Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Mainboard page #14

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Adding Mainboard page #14

wants to merge 4 commits into from

Conversation

ahoneybun
Copy link
Member

This is just WIP as it does currently error out on the page.

Copy link
Member

@edfloreshz edfloreshz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found some small details

src/app.rs Show resolved Hide resolved
src/app.rs Outdated Show resolved Hide resolved
@ahoneybun
Copy link
Member Author

I think we may want to use this crate like how osrelease is pulled:

https://docs.rs/smbios-lib/0.9.2/smbioslib/

@sungsphinx sungsphinx added the enhancement New feature or request label Oct 18, 2024
@ahoneybun
Copy link
Member Author

It looks like hostnamectl does not need root and it provides board information.

Copy link
Member

@sungsphinx sungsphinx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The page displays info that should probably not be on the motherboard page:

image

src/app.rs Outdated Show resolved Hide resolved
Co-authored-by: Dexter Reed <[email protected]>
@ahoneybun
Copy link
Member Author

@sungsphinx I need to get it to build on 24.10 for testing on my end.

Copy link
Member

@edfloreshz edfloreshz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ahoneybun
Copy link
Member Author

Yea it certainly has more info then we may want.

screenshot-2024-11-04-13-31-03

@ahoneybun
Copy link
Member Author

I don't know how to trim out more content @sungsphinx but this at least gets a nice starting point.

@edfloreshz
Copy link
Member

I don’t believe it has more info than what’s needed, is just the right amount imo

@sungsphinx
Copy link
Member

@edfloreshz I don't think it should show stuff like Operating System, Icon Name and Static Hostname, etc. Just motherboard related info.

@ahoneybun Maybe we could parse a json output from hostnamectl:

hostnamectl --json={pretty or short}

@ahoneybun
Copy link
Member Author

ahoneybun commented Nov 5, 2024

@edfloreshz I don't think it should show stuff like Operating System, Icon Name and Static Hostname, etc. Just motherboard related info.

@ahoneybun Maybe we could parse a json output from hostnamectl:

hostnamectl --json={pretty or short}
aaronh@pop-os:~$ hostnamectl --json=pretty
{
	"Hostname" : "pop-os",
	"StaticHostname" : "pop-os",
	"PrettyHostname" : null,
	"DefaultHostname" : "localhost",
	"HostnameSource" : "static",
	"IconName" : "computer-desktop",
	"Chassis" : "desktop",
	"Deployment" : null,
	"Location" : null,
	"KernelName" : "Linux",
	"KernelRelease" : "6.9.3-76060903-generic",
	"KernelVersion" : "#202405300957~1728589823~24.04~3d61696 SMP PREEMPT_DYNAMIC Thu O",
	"OperatingSystemPrettyName" : "Pop!_OS 24.04 LTS",
	"OperatingSystemCPEName" : null,
	"OperatingSystemHomeURL" : "https://pop.system76.com",
	"HardwareVendor" : "System76",
	"HardwareModel" : "Thelio",
	"HardwareSerial" : null,
	"FirmwareVersion" : "F15a Z5",
	"FirmwareVendor" : "System76",
	"FirmwareDate" : 1582156800000000,
	"MachineID" : "dfcbb39e233116762e17fd0666578a76",
	"BootID" : "7b5f89cae03a4b63aa7cf84a74e2c982",
	"ProductUUID" : null
}
aaronh@pop-os:~$ hostnamectl --json=short
{"Hostname":"pop-os","StaticHostname":"pop-os","PrettyHostname":null,"DefaultHostname":"localhost","HostnameSource":"static","IconName":"computer-desktop","Chassis":"desktop","Deployment":null,"Location":null,"KernelName":"Linux","KernelRelease":"6.9.3-76060903-generic","KernelVersion":"#202405300957~1728589823~24.04~3d61696 SMP PREEMPT_DYNAMIC Thu O","OperatingSystemPrettyName":"Pop!_OS 24.04 LTS","OperatingSystemCPEName":null,"OperatingSystemHomeURL":"https://pop.system76.com","HardwareVendor":"System76","HardwareModel":"Thelio","HardwareSerial":null,"FirmwareVersion":"F15a Z5","FirmwareVendor":"System76","FirmwareDate":1582156800000000,"MachineID":"dfcbb39e233116762e17fd0666578a76","BootID":"7b5f89cae03a4b63aa7cf84a74e2c982","ProductUUID":null}

@sungsphinx
Copy link
Member

Should have mentioned certain only lines/blocks/whatever it is in JSON files that relate to the motherboard lol.

@ahoneybun
Copy link
Member Author

It looks like inxi --machine might be better?

I can't seem to build the project though:

[2024-11-05T18:52:12Z WARN  sctk_adwaita::buttons] Ignoring unknown button type:
thread 'main' panicked at src/app.rs:386:77:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[2024-11-05T18:52:12Z ERROR iced_winit::platform_specific::wayland::event_loop] SCTK failed to send Control::AboutToWait. TrySendError { kind: Disconnected }

@sungsphinx
Copy link
Member

I had the same when I was attempting the Hardware Security page (#6), I think the command has a bit of a delay, and rust decides: nah I'm good thanks 1 second is too long

@edfloreshz
Copy link
Member

How about getting the JSON a de-serializing it to a struct that only contains the fields we need?

@ahoneybun
Copy link
Member Author

How about getting the JSON a de-serializing it to a struct that only contains the fields we need?

That's fine I just don't know how to do that, I can certainly change the output to JSON though!

@edfloreshz
Copy link
Member

Refer to this, you can read a JSON and access specific untyped values by key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants