Removable check
This commit is contained in:
parent
c888b2ebd7
commit
e9a1168bec
@ -5,6 +5,7 @@
|
||||
"driver": "mesa-stable",
|
||||
"icon": "video-display",
|
||||
"experimental": false,
|
||||
"removable": false,
|
||||
"detection": "lspci -D | grep -iE 'VGA|3D' | grep -i amd"
|
||||
},
|
||||
{
|
||||
@ -12,6 +13,7 @@
|
||||
"driver": "mesa-hybrid",
|
||||
"icon": "video-display",
|
||||
"experimental": false,
|
||||
"removable": false,
|
||||
"detection": "lspci -D | grep -iE 'VGA|3D' | grep -i amd"
|
||||
},
|
||||
{
|
||||
@ -19,6 +21,7 @@
|
||||
"driver": "mesa-git",
|
||||
"icon": "video-display",
|
||||
"experimental": true,
|
||||
"removable": false,
|
||||
"detection": "lspci -D | grep -iE 'VGA|3D' | grep -i amd"
|
||||
},
|
||||
{
|
||||
@ -26,6 +29,7 @@
|
||||
"driver": "mesa-stable",
|
||||
"icon": "video-display",
|
||||
"experimental": false,
|
||||
"removable": false,
|
||||
"detection": "lspci -D | grep -iE 'VGA|3D' | grep -i intel"
|
||||
},
|
||||
{
|
||||
@ -33,6 +37,7 @@
|
||||
"driver": "mesa-hybrid",
|
||||
"icon": "video-display",
|
||||
"experimental": false,
|
||||
"removable": false,
|
||||
"detection": "lspci -D | grep -iE 'VGA|3D' | grep -i intel"
|
||||
},
|
||||
{
|
||||
@ -40,6 +45,7 @@
|
||||
"driver": "mesa-git",
|
||||
"icon": "video-display",
|
||||
"experimental": true,
|
||||
"removable": false,
|
||||
"detection": "lspci -D | grep -iE 'VGA|3D' | grep -i intel"
|
||||
},
|
||||
{
|
||||
@ -47,6 +53,7 @@
|
||||
"driver": "pika-rocm-meta",
|
||||
"icon": "amd",
|
||||
"experimental": false,
|
||||
"removable": true,
|
||||
"detection": "lspci -D | grep -iE 'VGA|3D' | grep -i amd"
|
||||
},
|
||||
{
|
||||
@ -54,6 +61,7 @@
|
||||
"driver": "vulkan-amdgpu-pro",
|
||||
"icon": "amd",
|
||||
"experimental": false,
|
||||
"removable": true,
|
||||
"detection": "lspci -D | grep -iE 'VGA|3D' | grep -i amd"
|
||||
},
|
||||
{
|
||||
@ -61,6 +69,7 @@
|
||||
"driver": "amf-amdgpu-pro",
|
||||
"icon": "amd",
|
||||
"experimental": false,
|
||||
"removable": true,
|
||||
"detection": "lspci -D | grep -iE 'VGA|3D' | grep -i amd"
|
||||
},
|
||||
{
|
||||
@ -68,6 +77,7 @@
|
||||
"driver": "amdvlk",
|
||||
"icon": "amd",
|
||||
"experimental": false,
|
||||
"removable": true,
|
||||
"detection": "lspci -D | grep -iE 'VGA|3D' | grep -i amd"
|
||||
},
|
||||
{
|
||||
@ -75,6 +85,7 @@
|
||||
"driver": "opencl-legacy-amdgpu-pro-icd",
|
||||
"icon": "amd",
|
||||
"experimental": false,
|
||||
"removable": true,
|
||||
"detection": "lspci -D | grep -iE 'VGA|3D' | grep -i amd"
|
||||
},
|
||||
{
|
||||
@ -82,6 +93,7 @@
|
||||
"driver": "amdgpu-pro-oglp",
|
||||
"icon": "amd",
|
||||
"experimental": false,
|
||||
"removable": true,
|
||||
"detection": "lspci -D | grep -iE 'VGA|3D' | grep -i amd"
|
||||
},
|
||||
{
|
||||
@ -89,6 +101,7 @@
|
||||
"driver": "nvidia-driver-525",
|
||||
"icon": "nvidia",
|
||||
"experimental": false,
|
||||
"removable": true,
|
||||
"detection": "lspci -D | grep -iE 'VGA|3D' | grep -i nvidia | cut -d: -f 4"
|
||||
},
|
||||
{
|
||||
@ -96,6 +109,7 @@
|
||||
"driver": "nvidia-driver-525-open",
|
||||
"icon": "nvidia",
|
||||
"experimental": true,
|
||||
"removable": true,
|
||||
"detection": "lspci -D | grep -iE 'VGA|3D' | grep -i nvidia | cut -d: -f 4"
|
||||
},
|
||||
{
|
||||
@ -103,6 +117,7 @@
|
||||
"driver": "nvidia-driver-535",
|
||||
"icon": "nvidia",
|
||||
"experimental": false,
|
||||
"removable": true,
|
||||
"detection": "lspci -D | grep -iE 'VGA|3D' | grep -i nvidia | cut -d: -f 4"
|
||||
},
|
||||
{
|
||||
@ -110,6 +125,7 @@
|
||||
"driver": "nvidia-driver-535-open",
|
||||
"icon": "nvidia",
|
||||
"experimental": true,
|
||||
"removable": true,
|
||||
"detection": "lspci -D | grep -iE 'VGA|3D' | grep -i nvidia | cut -d: -f 4"
|
||||
},
|
||||
{
|
||||
@ -117,6 +133,7 @@
|
||||
"driver": "nvidia-driver-545",
|
||||
"icon": "nvidia",
|
||||
"experimental": false,
|
||||
"removable": true,
|
||||
"detection": "lspci -D | grep -iE 'VGA|3D' | grep -i nvidia | cut -d: -f 4"
|
||||
},
|
||||
{
|
||||
@ -124,6 +141,7 @@
|
||||
"driver": "nvidia-driver-545-open",
|
||||
"icon": "nvidia",
|
||||
"experimental": true,
|
||||
"removable": true,
|
||||
"detection": "lspci -D | grep -iE 'VGA|3D' | grep -i nvidia | cut -d: -f 4"
|
||||
},
|
||||
{
|
||||
@ -131,6 +149,7 @@
|
||||
"driver": "nvidia-driver-550",
|
||||
"icon": "nvidia",
|
||||
"experimental": true,
|
||||
"removable": true,
|
||||
"detection": "lspci -D | grep -iE 'VGA|3D' | grep -i nvidia | cut -d: -f 4"
|
||||
},
|
||||
{
|
||||
@ -138,6 +157,7 @@
|
||||
"driver": "nvidia-driver-550-open",
|
||||
"icon": "nvidia",
|
||||
"experimental": true,
|
||||
"removable": true,
|
||||
"detection": "lspci -D | grep -iE 'VGA|3D' | grep -i nvidia | cut -d: -f 4"
|
||||
},
|
||||
{
|
||||
@ -145,6 +165,7 @@
|
||||
"driver": "xone-dkms",
|
||||
"icon": "input-gaming",
|
||||
"experimental": false,
|
||||
"removable": true,
|
||||
"detection": "lsusb | grep -i xbox"
|
||||
},
|
||||
{
|
||||
@ -152,6 +173,7 @@
|
||||
"driver": "intel-gpu-compute",
|
||||
"icon": "intel",
|
||||
"experimental": false,
|
||||
"removable": true,
|
||||
"detection": "lspci -D | grep -iE 'VGA|3D' | grep -i intel"
|
||||
}
|
||||
]
|
||||
|
@ -1,5 +1,13 @@
|
||||
{
|
||||
"app_name": "PikaOS Driver Manager",
|
||||
"app_dev": "Cosmo",
|
||||
"loading_label_label": "Scanning for drivers..."
|
||||
"loading_label_label": "Downloading driver database...",
|
||||
"loading_no_internet_box_text_title": "Network Error!",
|
||||
"loading_no_internet_box_text_description": "An Internet Connection is needed to download the driver database.",
|
||||
"device_label_label_prefix": "Device: ",
|
||||
"driver_install_button_label": "Install",
|
||||
"driver_install_button_tooltip_text": "Install the driver package.",
|
||||
"driver_remove_button_label": "Uninstall",
|
||||
"driver_remove_button_tooltip_text": "Uninstall the driver package.",
|
||||
"driver_expander_row_title_suffix": " (WARNING: THIS DRIVER IS EXPERMINTAL USE AT YOUR OWN RISK!)"
|
||||
}
|
@ -142,7 +142,7 @@ pub fn build_ui(app: &adw::Application) {
|
||||
if Path::new("/tmp/run-pkdm-detect.sh").exists() {
|
||||
fs::remove_file("/tmp/run-pkdm-detect.sh").expect("Bad permissions on /tmp/pika-installer-gtk4-target-manual.txt");
|
||||
}
|
||||
fs::write("/tmp/run-pkdm-detect.sh", "#! /bin/bash\nset -e\n".to_owned() + driver["detection"].as_str().to_owned().unwrap()).expect("Unable to write file");
|
||||
fs::write("/tmp/run-pkdm-detect.sh", "#! /bin/bash\nset -e\nexport LANG=en_US.UTF-8\n".to_owned() + driver["detection"].as_str().to_owned().unwrap()).expect("Unable to write file");
|
||||
let _ = cmd!("chmod", "+x", "/tmp/run-pkdm-detect.sh").read();
|
||||
let result = cmd!("/tmp/run-pkdm-detect.sh").stdout_capture().read();
|
||||
if result.is_ok() {
|
||||
@ -150,6 +150,7 @@ pub fn build_ui(app: &adw::Application) {
|
||||
let driver_device = result.unwrap();
|
||||
let driver_icon = driver["icon"].as_str().to_owned().unwrap().to_string();
|
||||
let driver_experimental = driver["experimental"].as_bool().unwrap();
|
||||
let driver_removeble= driver["removable"].as_bool().unwrap();
|
||||
let command_version_label = Command::new("/usr/lib/pika/drivers/generate_package_info.sh")
|
||||
.args(["version", &driver_name])
|
||||
.output()
|
||||
@ -171,6 +172,7 @@ pub fn build_ui(app: &adw::Application) {
|
||||
.to_string(),
|
||||
icon: driver_icon,
|
||||
experimental: driver_experimental,
|
||||
removeble: driver_removeble,
|
||||
};
|
||||
driver_package_array.push(found_driver_package)
|
||||
}
|
||||
@ -199,8 +201,8 @@ pub fn build_ui(app: &adw::Application) {
|
||||
println!("Network Error!");
|
||||
let loading_no_internet_box_text = adw::StatusPage::builder()
|
||||
.icon_name("network-cellular-offline")
|
||||
.title(t!("first_setup_gameutils_box_text_title"))
|
||||
.description(t!("first_setup_gameutils_box_text_description"))
|
||||
.title(t!("loading_no_internet_box_text_title"))
|
||||
.description(t!("loading_no_internet_box_text_description"))
|
||||
.build();
|
||||
loading_no_internet_box_text.add_css_class("compact");
|
||||
|
||||
@ -275,7 +277,7 @@ fn get_drivers(
|
||||
});
|
||||
for (device, group) in device_groups {
|
||||
let device_label = gtk::Label::builder()
|
||||
.label("Device: ".to_owned() + &device)
|
||||
.label(t!("device_label_label_prefix").to_owned().to_string() + &device)
|
||||
.halign(gtk::Align::Center)
|
||||
.valign(gtk::Align::Center)
|
||||
.build();
|
||||
@ -318,8 +320,8 @@ fn get_drivers(
|
||||
.margin_top(5)
|
||||
.margin_bottom(5)
|
||||
.valign(gtk::Align::Center)
|
||||
.label("Install")
|
||||
.tooltip_text("Install the driver package.")
|
||||
.label(t!("driver_install_button_label"))
|
||||
.tooltip_text(t!("driver_install_button_tooltip_text"))
|
||||
.sensitive(false)
|
||||
.build();
|
||||
driver_install_button.add_css_class("suggested-action");
|
||||
@ -328,8 +330,8 @@ fn get_drivers(
|
||||
.margin_top(5)
|
||||
.margin_bottom(5)
|
||||
.valign(gtk::Align::Center)
|
||||
.label("Uninstall")
|
||||
.tooltip_text("Uninstall the driver package.")
|
||||
.label(t!("driver_remove_button_label"))
|
||||
.tooltip_text(t!("driver_remove_button_tooltip_text"))
|
||||
.sensitive(false)
|
||||
.build();
|
||||
let driver_action_box = gtk::Box::builder().homogeneous(true).build();
|
||||
@ -338,7 +340,7 @@ fn get_drivers(
|
||||
if driver.clone().experimental == true {
|
||||
driver_expander_row.set_title(
|
||||
&(driver.clone().driver
|
||||
+ " (WARNING: THIS DRIVER IS EXPERMINTAL USE AT YOUR OWN RISK!)"),
|
||||
+ &t!("driver_expander_row_title_suffix").to_string()),
|
||||
);
|
||||
driver_expander_row.add_css_class("midLabelWARN");
|
||||
} else {
|
||||
@ -358,7 +360,7 @@ fn get_drivers(
|
||||
.unwrap();
|
||||
if command_installed_status.status.success() {
|
||||
driver_install_button.set_sensitive(false);
|
||||
if !driver.clone().driver.contains("mesa") {
|
||||
if driver.clone().removeble == false {
|
||||
driver_remove_button.set_sensitive(true);
|
||||
}
|
||||
} else {
|
||||
|
@ -17,6 +17,7 @@ pub struct DriverPackage {
|
||||
description: String,
|
||||
icon: String,
|
||||
experimental: bool,
|
||||
removeble: bool,
|
||||
}
|
||||
|
||||
use build_ui::build_ui;
|
||||
|
Loading…
Reference in New Issue
Block a user