Sean Rhodes has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/58854 )
Change subject: [WIP] util: Add GUI to change CMOS settings ......................................................................
[WIP] util: Add GUI to change CMOS settings
A simply GUI to change settings in coreboot's CBFS, via the nvramtool utility.
Not sure if it's even wanted upstream, but if it is, I'll tidy it up and make it work with any CMOS values.
Signed-off-by: Sean Rhodes sean@starlabs.systems Change-Id: Ie654f6aca57a792be0c295afc081a95ed4d875d1 --- M 3rdparty/blobs A util/coreboot-configurator/README.md A util/coreboot-configurator/debian/changelog A util/coreboot-configurator/debian/compat A util/coreboot-configurator/debian/control A util/coreboot-configurator/debian/files A util/coreboot-configurator/debian/rules A util/coreboot-configurator/debian/source/format A util/coreboot-configurator/meson.build A util/coreboot-configurator/meson_options.txt A util/coreboot-configurator/screenshots/coreboot-configurator.gif A util/coreboot-configurator/screenshots/coreboot-configurator.png A util/coreboot-configurator/src/labtop-series/README.txt A util/coreboot-configurator/src/labtop-series/aboutwindow.cpp A util/coreboot-configurator/src/labtop-series/aboutwindow.h A util/coreboot-configurator/src/labtop-series/aboutwindow.ui A util/coreboot-configurator/src/labtop-series/coreboot_configurator.cpp A util/coreboot-configurator/src/labtop-series/coreboot_configurator.h A util/coreboot-configurator/src/labtop-series/coreboot_configurator.ui A util/coreboot-configurator/src/labtop-series/images.qrc A util/coreboot-configurator/src/labtop-series/main.cpp A util/coreboot-configurator/src/labtop-series/meson.build A util/coreboot-configurator/src/labtop-series/readcfg.cpp A util/coreboot-configurator/src/labtop-series/readcfg.h A util/coreboot-configurator/src/labtop-series/toggle-off.svg A util/coreboot-configurator/src/labtop-series/toggle-on.svg A util/coreboot-configurator/src/meson.build A util/coreboot-configurator/src/static/aboutIcon.png A util/coreboot-configurator/src/static/coreboot-configurator.desktop A util/coreboot-configurator/src/static/coreboot_configurator.svg A util/coreboot-configurator/src/static/meson.build A util/coreboot-configurator/src/static/org.jagoli.nvramtool.policy A util/coreboot-configurator/src/static/org.jagoli.reboot.policy 33 files changed, 3,720 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/54/58854/1
diff --git a/3rdparty/blobs b/3rdparty/blobs index f388b67..bb02df0 160000 --- a/3rdparty/blobs +++ b/3rdparty/blobs @@ -1 +1 @@ -Subproject commit f388b6794e6f1f93b847de353f5eab8ba3e3b328 +Subproject commit bb02df075fd707e0cb3945b237f7b99f86a154a3 diff --git a/util/coreboot-configurator/README.md b/util/coreboot-configurator/README.md new file mode 100644 index 0000000..84bac58 --- /dev/null +++ b/util/coreboot-configurator/README.md @@ -0,0 +1,102 @@ +# coreboot-configurator ![alt text](https://cdn.shopify.com/s/files/1/2059/5897/files/Star_50x.png?v=1513954416 "Star Labs Systems") + +A simply GUI to change settings in coreboot's CBFS, via the nvramtool utility. + +Requires the same version of coreboot as coreboot-configurator i.e. coreboot 6 with coreboot-configurator 6 + + +![coreboot-configurator](screenshots/coreboot-configurator.gif) +# How to install +## Ubuntu, Linux Mint, elementary OS, Zorin OS and other derivates +##### Install +``` +sudo add-apt-repository ppa:starlabs/ppa +sudo apt update +sudo apt install coreboot-configurator +``` +##### Uninstall +``` +sudo apt purge coreboot-configurator +``` + +## Debian +##### Install +``` +echo "deb http://ppa.launchpad.net/starlabs/ppa/ubuntu focal main" | sudo tee -a /etc/apt/sources.list.d/starlabs-ubuntu-ppa-focal.list +sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 17A20BAF70BEC3904545ACFF8F21C26C794386E3 +sudo apt update +sudo apt install coreboot-configurator +``` + +##### Uninstall +``` +sudo apt purge coreboot-configurator +``` + +## Manjaro +##### Install +``` +sudo pacman -Syu coreboot-configurator +``` +##### Uninstall +``` +sudo pacman -Rns coreboot-configurator +``` + +## Other Distributions +##### Install +``` +git clone https://github.com/StarLabsLtd/coreboot-configurator.git +cd coreboot-configurator +meson build +ninja -C build install +``` +##### Uninstall +``` +sudo ninja -C uninstall +``` + +Settings currently available are: +#### Hyper Threading +###### Allows multiple threads to be run on each core. +**Enable** / Disable +#### Intel VT-d +###### Allows virtualisation to use hardware features. +**Enable** / Disable +#### Thermal Design Power +###### Set the maximum amount of power the processor can use. +**15W** / 20W / 25W +#### Intel Management Engine +###### Allows disabling of enabling the Intel ME. Requires shutting down to change states. +Enable / **Disable** +#### Wireless +###### Enables or disables the built in wireless card. +**Enable** / Disable +#### Webcam +###### Enables or disables the built in webcam. +**Enable** / Disable +#### Microphone +###### Enables or disables the built in microphone. +**Enable** / Disable +#### Clock Gating +###### Enables or disables the 8254 legacy timer. Reduces power consumption when enabled but must be disabled for distributions such as Qubes. +**Enable** / Disable +#### Keyboard Backlight Timeout +###### Adjust the amount of time before the keyboard backlight turns off after not being used. +**30 seconds** / 1 minute / 3 minutes / 5 minutes / Never +#### Fn Ctrl Reverse +###### Swap the functions of the Fn and Ctrl keys. +Enable / **Disable** +#### Power On After Fail +**Enable** / Disable + +## Copying or Reusing +Included scripts are free software licensed under the terms of the [GNU General Public License, version 3](https://www.gnu.org/licenses/gpl-3.0.txt). + +Thanks to [corevantage](https://github.com/JaGoLi/corevantage) that this was forked and inspired from. + +# [© Star Labs® / All Rights Reserved.](https://starlabs.systems) +Any issues or questions, please contact us at [support@starlabs.systems](mailto:supportstarlabs.systems) + +View our full range of Linux laptops at: [https://starlabs.systems%5D(https://starlabs.systems) + diff --git a/util/coreboot-configurator/debian/changelog b/util/coreboot-configurator/debian/changelog new file mode 100644 index 0000000..88ddd7e --- /dev/null +++ b/util/coreboot-configurator/debian/changelog @@ -0,0 +1,44 @@ +coreboot-configurator (7+a) focal; urgency=medium + + * Version 7 to match coreboot 7 + + -- Sean Rhodes sean@starlabs.systems Tue, 24 Aug 2021 07:35:16 +0100 + +coreboot-configurator (6.h) hirsute; urgency=medium + + * Version 6 to match coreboot 6 + * Adds support to disable or enable VT-d, wireless, webcam, microphone and clock gating + * Adds support to select TDP + + -- Sean Rhodes sean@starlabs.systems Fri, 11 Jun 2021 08:40:38 +0100 + +coreboot-configurator (5) hirsute; urgency=medium + + * Version 5 to match coreboot 5 + * Adds support to disable or enable IME + + -- Sean Rhodes sean@starlabs.systems Thu, 29 Apr 2021 14:39:40 +0100 + +coreboot-configurator (3) hirsute; urgency=medium + + * Added qt5-default dependancy + + -- Sean Rhodes sean@starlabs.systems Wed, 14 Apr 2021 16:44:13 +0100 + +coreboot-configurator (2) hirsute; urgency=medium + + * Fixed values that a read + + -- Sean Rhodes sean@starlabs.systems Tue, 13 Apr 2021 16:40:04 +0100 + +coreboot-configurator (1) hirsute; urgency=medium + + * Fixed icon + + -- Sean Rhodes sean@starlabs.systems Tue, 13 Apr 2021 11:47:04 +0100 + +coreboot-configurator (0) hirsute; urgency=medium + + * Initial release. + + -- Sean Rhodes sean@starlabs.systems Mon, 12 Apr 2021 21:14:48 +0100 diff --git a/util/coreboot-configurator/debian/compat b/util/coreboot-configurator/debian/compat new file mode 100644 index 0000000..f599e28 --- /dev/null +++ b/util/coreboot-configurator/debian/compat @@ -0,0 +1 @@ +10 diff --git a/util/coreboot-configurator/debian/control b/util/coreboot-configurator/debian/control new file mode 100644 index 0000000..8ff9edd --- /dev/null +++ b/util/coreboot-configurator/debian/control @@ -0,0 +1,11 @@ +Source: coreboot-configurator +Section: utils +Priority: optional +Maintainer: Star Labs admin@starlabs.systems +Build-Depends: debhelper (>= 7), build-essential, cmake, qtbase5-dev, inkscape, meson +Standards-Version: 4.1.1 + +Package: coreboot-configurator +Depends: nvramtool, ${shlibs:Depends}, ${misc:Depends}, libqt5gui5 +Architecture: all +Description: Graphical interface to change settings available in coreboot CBFS diff --git a/util/coreboot-configurator/debian/files b/util/coreboot-configurator/debian/files new file mode 100644 index 0000000..f408157 --- /dev/null +++ b/util/coreboot-configurator/debian/files @@ -0,0 +1 @@ +coreboot-configurator_7+a_source.buildinfo utils optional diff --git a/util/coreboot-configurator/debian/rules b/util/coreboot-configurator/debian/rules new file mode 100755 index 0000000..a27f2125 --- /dev/null +++ b/util/coreboot-configurator/debian/rules @@ -0,0 +1,11 @@ +#!/usr/bin/make -f +#export DH_VERBOSE = 1 + +%: + dh $@ --buildsystem=meson + +override_dh_install: + dh_install + +override_dh_missing: + dh_missing --fail-missing diff --git a/util/coreboot-configurator/debian/source/format b/util/coreboot-configurator/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/util/coreboot-configurator/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/util/coreboot-configurator/meson.build b/util/coreboot-configurator/meson.build new file mode 100644 index 0000000..970ba52 --- /dev/null +++ b/util/coreboot-configurator/meson.build @@ -0,0 +1,10 @@ +project( + 'coreboot-configurator', + 'cpp', + version: '0', + license: ['GPL3', 'CC BY-SA 4.0'], + meson_version: '>= 0.52.0', + default_options: ['prefix=/usr'], +) + +subdir('src') diff --git a/util/coreboot-configurator/meson_options.txt b/util/coreboot-configurator/meson_options.txt new file mode 100644 index 0000000..c3ee313 --- /dev/null +++ b/util/coreboot-configurator/meson_options.txt @@ -0,0 +1,6 @@ +option( + 'sizes', + type: 'array', + choices: ['24', '48', '96', '16', '32', '64', '128', '256', '512'], + description: 'Choose icon size(s)', +) diff --git a/util/coreboot-configurator/screenshots/coreboot-configurator.gif b/util/coreboot-configurator/screenshots/coreboot-configurator.gif new file mode 100644 index 0000000..3438cd6 --- /dev/null +++ b/util/coreboot-configurator/screenshots/coreboot-configurator.gif Binary files differ diff --git a/util/coreboot-configurator/screenshots/coreboot-configurator.png b/util/coreboot-configurator/screenshots/coreboot-configurator.png new file mode 100644 index 0000000..6d07b61 --- /dev/null +++ b/util/coreboot-configurator/screenshots/coreboot-configurator.png Binary files differ diff --git a/util/coreboot-configurator/src/labtop-series/README.txt b/util/coreboot-configurator/src/labtop-series/README.txt new file mode 100644 index 0000000..7621f5e --- /dev/null +++ b/util/coreboot-configurator/src/labtop-series/README.txt @@ -0,0 +1,86 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +/* RTC_BOOT_BYTE (coreboot hardcoded) */ +384 1 e 2 boot_option +388 4 h 0 reboot_counter + + +/* coreboot config options: console */ +395 4 e 3 debug_level + +/* coreboot config options: cpu */ +400 1 e 1 hyper_threading +408 1 e 1 vtd +416 2 e 7 power_profile +424 1 e 5 me_state + +/* coreboot config options: Devices */ +500 1 e 1 wireless +508 1 e 1 webcam +516 1 e 1 microphone +524 1 e 1 legacy_8254_timer +536 1 e 1 usb_always_on + +/* coreboot config options: EC */ +600 3 e 4 kbl_timeout +608 1 e 1 fn_ctrl_swap +616 2 e 8 max_charge +624 2 e 9 fan_mode + +/* coreboot config options: southbridge */ +700 2 e 6 power_on_after_fail + +/* coreboot config options: check sums */ +984 16 h 0 check_sum + +/* embedded controller settings (outwith the checksummed area) */ +1000 1 h 1 fn_lock_state +1008 8 h 1 trackpad_state +1016 2 h 10 kbl_brightness +1024 1 h 1 kbl_state + +/* Setting Group: 1 */ +1 0 Disable +1 1 Enable + +2 0 Fallback +2 1 Normal + +3 0 Emergency +3 1 Alert +3 2 Critical +3 3 Error +3 4 Warning +3 5 Notice +3 6 Info +3 7 Debug +3 8 Spew + +4 0 30 seconds +4 1 1 minute +4 2 3 minutes +4 3 5 minutes +4 4 Never + +5 0 Enable +5 1 Disable + +6 0 Disable +6 1 Enable +6 2 Keep + +7 0 Power Saver +7 1 Balanced +7 2 Performance + +8 0 100% +8 1 80% +8 2 60% + +9 0 Normal +9 1 Aggressive +9 2 Quiet + +10 0 Off +10 1 Low +10 2 High diff --git a/util/coreboot-configurator/src/labtop-series/aboutwindow.cpp b/util/coreboot-configurator/src/labtop-series/aboutwindow.cpp new file mode 100644 index 0000000..e070396 --- /dev/null +++ b/util/coreboot-configurator/src/labtop-series/aboutwindow.cpp @@ -0,0 +1,25 @@ +#include "aboutwindow.h" +#include "ui_aboutwindow.h" + +#include <QScreen> +#include <QIcon> + +aboutWindow::aboutWindow(QWidget *parent) : QWidget(parent), ui(new Ui::aboutWindow) +{ + ui->setupUi(this); + + // set window title and icon + this->setWindowTitle("About"); + this->setWindowIcon(QIcon::fromTheme("coreboot_configurator")); + + // Center window on screen + move(QGuiApplication::screens().at(0)->geometry().center() - frameGeometry().center()); + + // connect OK to closing window + connect(ui->okButton, &QDialogButtonBox::accepted, this, &QWidget::close); +} + +aboutWindow::~aboutWindow() +{ + delete ui; +} diff --git a/util/coreboot-configurator/src/labtop-series/aboutwindow.h b/util/coreboot-configurator/src/labtop-series/aboutwindow.h new file mode 100644 index 0000000..435947c --- /dev/null +++ b/util/coreboot-configurator/src/labtop-series/aboutwindow.h @@ -0,0 +1,23 @@ +#ifndef ABOUTWINDOW_H +#define ABOUTWINDOW_H + +#include <QWidget> + +namespace Ui +{ +class aboutWindow; +} + +class aboutWindow : public QWidget +{ + Q_OBJECT + + public: + explicit aboutWindow(QWidget *parent = nullptr); + ~aboutWindow(); + + private: + Ui::aboutWindow *ui; +}; + +#endif // ABOUTWINDOW_H diff --git a/util/coreboot-configurator/src/labtop-series/aboutwindow.ui b/util/coreboot-configurator/src/labtop-series/aboutwindow.ui new file mode 100644 index 0000000..e6a39a1 --- /dev/null +++ b/util/coreboot-configurator/src/labtop-series/aboutwindow.ui @@ -0,0 +1,127 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>aboutWindow</class> + <widget class="QWidget" name="aboutWindow"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>475</width> + <height>245</height> + </rect> + </property> + <property name="minimumSize"> + <size> + <width>475</width> + <height>245</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>475</width> + <height>245</height> + </size> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="0"> + <layout class="QHBoxLayout" name="AboutCountainer"> + <item> + <layout class="QVBoxLayout" name="inner"> + <item> + <widget class="QLabel" name="Title"> + <property name="font"> + <font> + <family>DejaVu Sans</family> + <pointsize>16</pointsize> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>coreboot configurator</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + <item> + <layout class="QVBoxLayout" name="description"> + <item> + <widget class="QLabel" name="text"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="text"> + <string><html><head/><body><p align="center">A simply GUI to change settings in coreboot's CBFS,</p><p align="center">via the nvramtool utility.</p></body></html></string> + </property> + <property name="alignment"> + <set>Qt::AlignHCenter|Qt::AlignTop</set> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="support"> + <item> + <widget class="QLabel" name="email"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>100</width> + <height>0</height> + </size> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="text"> + <string><html><head/><body><p><a href="https://support.starlabs.systems%22%3E%3Cspan style=" text-decoration: underline; color:#0000ff;">starlabs.systems</span></a></p></body></html></string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + <property name="openExternalLinks"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </item> + <item> + <widget class="QDialogButtonBox" name="okButton"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="standardButtons"> + <set>QDialogButtonBox::Ok</set> + </property> + <property name="centerButtons"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> diff --git a/util/coreboot-configurator/src/labtop-series/coreboot_configurator.cpp b/util/coreboot-configurator/src/labtop-series/coreboot_configurator.cpp new file mode 100644 index 0000000..5d455e8 --- /dev/null +++ b/util/coreboot-configurator/src/labtop-series/coreboot_configurator.cpp @@ -0,0 +1,489 @@ + +#include "coreboot_configurator.h" +#include "./ui_coreboot_configurator.h" + +#include <QDebug> +#include <iostream> +#include <fstream> +#include <QPushButton> +#include <QScreen> +#include <QProcess> +#include <QDir> +#include <QFileDialog> +#include <QShortcut> + +coreboot_configurator::coreboot_configurator(QWidget *parent) + : QMainWindow(parent), ui(new Ui::coreboot_configurator) +{ + ui->setupUi(this); + + // set window title and icon + this->setWindowTitle("coreboot configurator"); + this->setWindowIcon(QIcon::fromTheme("coreboot_configurator")); + + // Unicorn: String lists + + // coreboot + boot_option_options << "Normal" + << "Fallback"; + ui->boot_option_select->addItems(boot_option_options); + + // console + debug_level_options << "Spew" + << "Debug" + << "Info" + << "Notice" + << "Warning" + << "Error" + << "Critical" + << "Alert" + << "Emergency"; + ui->debug_level_select->addItems(debug_level_options); + + // cpu + // hyper_threading_options << "Disable" << "Enable"; + // ui->hyper_threading_select->addItems(hyper_threading_options); + // vtd_options << "Disable" << "Enable"; + // ui->vtd_select->addItems(vtd_options); + power_profile_options << "Power Saver" + << "Balanced" + << "Performance"; + ui->power_profile_select->addItems(power_profile_options); + // me_state_options << "Enable" << "Disable"; + // ui->me_state_select->addItems(me_state_options); + + // Devices + // wireless_options << "Disable" << "Enable"; + // ui->wireless_select->addItems(wireless_options); + // webcam_options << "Disable" << "Enable"; + // ui->webcam_select->addItems(webcam_options); + // microphone_options << "Disable" << "Enable"; + // ui->microphone_select->addItems(microphone_options); + // legacy_8254_timer_options << "Disable" << "Enable"; + // ui->legacy_8254_timer_select->addItems(legacy_8254_timer_options); + // usb_always_on_options << "Disable" << "Enable"; + // ui->usb_always_on_select->addItems(usb_always_on_options); + + // EC + kbl_timeout_options << "30 seconds" + << "1 minute" + << "3 minutes" + << "5 minutes" + << "Never"; + ui->kbl_timeout_select->addItems(kbl_timeout_options); + // fn_ctrl_swap_options << "Disable" << "Enable"; + // ui->fn_ctrl_swap_select->addItems(fn_ctrl_swap_options); + max_charge_options << "100%" + << "80%" + << "60%"; + ui->max_charge_select->addItems(max_charge_options); + fan_mode_options << "Normal" + << "Aggressive" + << "Quiet"; + ui->fan_mode_select->addItems(fan_mode_options); + + // southbridge + power_on_after_fail_options << "Disable" + << "Enable" + << "Keep"; + ui->power_on_after_fail_select->addItems(power_on_after_fail_options); + + + // define error window + error_win.setWindowTitle("Error Occurred"); + error_win.setWindowIcon(QIcon::fromTheme("coreboot_configurator")); + error_win.setText("An error has occurred"); + error_win.setInformativeText( + "Nvramtool was not able to access cmos settings. Look at documentation for possible causes of errors."); + error_win.setIcon(QMessageBox::Critical); + + // connect information window to information button + // connect(ui->actionInformation, &QAction::triggered, this, [=](){info_win.show();}); + + // connect about window to about button + connect(ui->actionAbout_2, &QAction::triggered, this, [=]() { about_win.show(); }); + + // Center window on screen + move(QGuiApplication::screens().at(0)->geometry().center() - frameGeometry().center()); + + // Connect enter key to OK button + QShortcut *returnAction = new QShortcut(QKeySequence("Return"), this); + connect(returnAction, &QShortcut::activated, this, + &coreboot_configurator::saveAndClose); + + // slider connections + // connect(ui->volumeSlider, &QSlider::valueChanged, this, + // &coreboot_configurator::setVolValue); connect(ui->rebootSlider, + // &QSlider::valueChanged, this, &coreboot_configurator::setRebootValue); + + // read and save to file connections + connect(ui->actionImport_from_File, &QAction::triggered, this, + &coreboot_configurator::getFromFile); + connect(ui->actionSave_to_File, &QAction::triggered, this, + &coreboot_configurator::writeSettings); + + // close connections + connect(ui->confirmBox, &QDialogButtonBox::rejected, this, &QMainWindow::close); + connect(ui->confirmBox, &QDialogButtonBox::accepted, this, + &coreboot_configurator::saveAndClose); + + connect(ui->actionExit, &QAction::triggered, this, &QMainWindow::close); + connect(ui->actionSave_and_Exit, &QAction::triggered, this, + &coreboot_configurator::saveAndClose); +} + +coreboot_configurator::~coreboot_configurator() +{ + delete ui; +} + +// OVERRIDES +void coreboot_configurator::showEvent(QShowEvent *ev) +{ + QMainWindow::showEvent(ev); + getSettings(); +} + +void coreboot_configurator::closeEvent(QCloseEvent *ev) +{ + // info_win.close(); + about_win.close(); + QMainWindow::closeEvent(ev); +} + +// SLOTS + +void coreboot_configurator::closeWindow(int result) +{ + // debug return value + qDebug() << "Nvram write return code: " << result; + + if (result == 0) { + QMessageBox reboot_win; + + reboot_win.setWindowTitle("Reboot System"); + reboot_win.setWindowIcon(QIcon::fromTheme("coreboot_configurator")); + reboot_win.setText("Do you want to reboot your system now?"); + reboot_win.setInformativeText( + "Changes to bios settings have been successfully applied"); + reboot_win.setIcon(QMessageBox::Question); + + QPushButton *reboot_but = + reboot_win.addButton("Reboot Now", QMessageBox::YesRole); + reboot_win.addButton("Reboot Later", QMessageBox::NoRole); + + reboot_win.exec(); + if (reboot_win.clickedButton() == reboot_but) { + // reboot computer + QProcess *reboot_proc = new QProcess(this); + QStringList args; + args << "/usr/sbin/reboot"; + reboot_proc->start("pkexec", args); + } else { + this->close(); + } + } + + // handle error + else { + error_win.exec(); + this->close(); + } +} + +void coreboot_configurator::saveAndClose() +{ + // save visible config to file + writeToFile(cfgpath_s); + + // info and args + QProcess *nvram_write = new QProcess(this); + QString sudo_prog = "pkexec"; + QStringList args = {"/usr/sbin/nvramtool", "-p", cfgpath_q}; + + // connections + connect(nvram_write, + static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), + this, [=](int num) { closeWindow(num); }); + + // exec + nvram_write->start(sudo_prog, args); +} + +// void coreboot_configurator::setRebootValue() { +// ui->rebootValue->setText(QString::number(ui->rebootSlider->value())); +// } + +// void coreboot_configurator::setVolValue() { +// ui->volumeValue->setText(QString::number(ui->volumeSlider->value())); +// } + +void coreboot_configurator::getFromFile() +{ + // setup dialog box + QFileDialog diag(this, "Select File", QDir::homePath(), + "Coreboot Configuration Files (*.cfg)"); + diag.setWindowIcon(QIcon::fromTheme("coreboot_configurator")); + diag.setDefaultSuffix(".cfg"); + + // exec + diag.exec(); + + // result + if (diag.result() == QDialog::Accepted) { + // convert string + QString user_file = diag.selectedFiles().constFirst(); + std::string selected_file = user_file.toUtf8().constData(); + + delete init_config; + init_config = new readCfg(selected_file); + displaySettings(0); + } +} + +void coreboot_configurator::writeSettings() +{ + // setup dialog box + QFileDialog diag(this, "Enter File to Save", QDir::homePath(), + "Coreboot Configuration Files (*.cfg)"); + diag.setWindowIcon(QIcon::fromTheme("coreboot_configurator")); + diag.setDefaultSuffix(".cfg"); + + // exec + diag.exec(); + + // result + if (diag.result() == QDialog::Accepted) { + // convert string + QString user_file = diag.selectedFiles().constFirst(); + std::string selected_file = user_file.toUtf8().constData(); + + writeToFile(selected_file); + } +} + +void coreboot_configurator::getSettings() +{ + // Program Details + QProcess *nvram_a = new QProcess(this); + QString sudo_prog = "pkexec"; + QStringList args = {"/usr/sbin/nvramtool", "-a"}; + + // Configuration directory + QString user_dir = QDir::homePath() + "/.config/coreboot_configurator/"; + if (!QDir(user_dir).exists()) { + QDir().mkdir(user_dir); + } + + // Config file location + cfgpath_q = user_dir + "nvramtool.cfg"; + cfgpath_s = cfgpath_q.toUtf8().constData(); + nvram_a->setStandardOutputFile(cfgpath_q); + + // remove config file if exists + if (QFile::exists(cfgpath_q)) { + QFile::remove(cfgpath_q); + } + + connect(nvram_a, + static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), + this, [=](int num) { displaySettings(num); }); + + // start + init_config = new readCfg(cfgpath_s); + nvram_a->start(sudo_prog, args); +} + +void coreboot_configurator::textToDisplay(QStringList str_list, std::string in_string, + QComboBox *box) +{ + QString q_string = QString::fromStdString(in_string); + int index = str_list.indexOf(q_string, 0); + if (index != -1) { + box->setCurrentIndex(index); + } +} + +void coreboot_configurator::checkToDisplay(std::string in_string, QCheckBox *box) +{ + if (in_string.compare("Enable") == 0) { + box->setCheckState(Qt::Checked); + } else { + box->setCheckState(Qt::Unchecked); + } +} + +void coreboot_configurator::hexToSlider(std::string in_string, QSlider *slider) +{ + int init_str_size = in_string.size(); + if (init_str_size >= 3) { + std::string str_num = in_string.substr(2, init_str_size - 2); + int str_int = std::stoi(str_num); + + slider->setValue(str_int); + } +} + +void coreboot_configurator::displaySettings(int result) +{ + qDebug() << "Nvram Read return code: " << result; + + if (result == 0) { + init_config->get_values(); + // Unicorn: Read current settings here + + /* coreboot */ + // boot_option = Fallback + textToDisplay(boot_option_options, init_config->values[0], + ui->boot_option_select); + + // reboot_counter = 0x0 + + /* console */ + // debug_level = Debug + textToDisplay(debug_level_options, init_config->values[2], + ui->debug_level_select); + + /* cpu */ + // hyper_threading = Enable + checkToDisplay(init_config->values[3], ui->hyper_threading_select); + // vtd = Enable + checkToDisplay(init_config->values[4], ui->vtd_select); + // power_profile = Balanced + textToDisplay(power_profile_options, init_config->values[5], + ui->power_profile_select); + // me_state = Disable + checkToDisplay(init_config->values[6], ui->me_state_select); + // me_state_counter = 0x0 + // smi_handler = 0x0 + + /* Devices */ + // wireless = Enable + checkToDisplay(init_config->values[9], ui->wireless_select); + // webcam = Enable + checkToDisplay(init_config->values[10], ui->webcam_select); + // microphone = Enable + checkToDisplay(init_config->values[11], ui->microphone_select); + // legacy_8254_timer = Enable + checkToDisplay(init_config->values[12], ui->legacy_8254_timer_select); + // usb_always_on = Disable + + /* EC */ + // kbl_timeout = 30 seconds + textToDisplay(kbl_timeout_options, init_config->values[14], + ui->kbl_timeout_select); + // fn_ctrl_swap = Disable + checkToDisplay(init_config->values[15], ui->fn_ctrl_swap_select); + // max_charge = 100% + textToDisplay(max_charge_options, init_config->values[16], + ui->max_charge_select); + // fan_mode = Normal + textToDisplay(fan_mode_options, init_config->values[17], ui->fan_mode_select); + + /* southbridge */ + // power_on_after_fail = Disable + textToDisplay(power_on_after_fail_options, init_config->values[18], + ui->power_on_after_fail_select); + + // fn_lock_state = 0x1 + // trackpad_state = 0x0 + // kbl_brightness = 0x0 + // kbl_state = 0x0 + } + + // handle error + else { + error_win.exec(); + this->close(); + } +} + +void coreboot_configurator::comboToFile(std::fstream &output, std::string precursor, + QComboBox *box, std::string successor = "") +{ + std::string box_val = box->currentText().toUtf8().constData(); + output << precursor + box_val + successor << std::endl; +} + +void coreboot_configurator::sliderToFile(std::fstream &output, std::string precursor, + QSlider *slider) +{ + std::string slider_val = std::to_string(slider->value()); + output << precursor + slider_val << std::endl; +} + +void coreboot_configurator::checkToFile(std::fstream &output, std::string precursor, + QCheckBox *box) +{ + std::string status; + if (box->isChecked()) { + status = "Enable"; + } else { + status = "Disable"; + } + output << precursor + status << std::endl; +} + +// void coreboot_configurator::lineToFile(std::fstream& output, QLineEdit* line) { +// handle special case boot_devices string +// if (!line->text().trimmed().isEmpty()) { +// output << "boot_devices = " << line->text().toUtf8().constData() << std::endl; +// } +// else { +// output << "#boot_devices = " << std::endl; +// } +//} + +void coreboot_configurator::writeToFile(std::string out_file) +{ + // clear file + remove(out_file.c_str()); + + // setup file for writing + std::fstream out_stream; + out_stream.open(out_file, std::ios_base::out); + + // start writing + if (out_stream.is_open()) { + + + // Unicorn: Save to file + + // coreboot + comboToFile(out_stream, "boot_option = ", ui->boot_option_select); + + // console + comboToFile(out_stream, "debug_level = ", ui->debug_level_select); + + // cpu + checkToFile(out_stream, "hyper_threading = ", ui->hyper_threading_select); + checkToFile(out_stream, "vtd = ", ui->vtd_select); + comboToFile(out_stream, "power_profile = ", ui->power_profile_select); + checkToFile(out_stream, "me_state = ", ui->me_state_select); + + // Devices + checkToFile(out_stream, "wireless = ", ui->wireless_select); + checkToFile(out_stream, "webcam = ", ui->webcam_select); + checkToFile(out_stream, "microphone = ", ui->microphone_select); + checkToFile(out_stream, "legacy_8254_timer = ", ui->legacy_8254_timer_select); + // comboToFile(out_stream, "usb_always_on = ", + // ui->usb_always_on_select); + + // EC + comboToFile(out_stream, "kbl_timeout = ", ui->kbl_timeout_select); + checkToFile(out_stream, "fn_ctrl_swap = ", ui->fn_ctrl_swap_select); + comboToFile(out_stream, "max_charge = ", ui->max_charge_select); + comboToFile(out_stream, "fan_mode = ", ui->fan_mode_select); + + // southbridge + comboToFile(out_stream, + "power_on_after_fail = ", ui->power_on_after_fail_select); + + } + + else { + qDebug() << "Failed to write to file"; + } + + out_stream.close(); +} diff --git a/util/coreboot-configurator/src/labtop-series/coreboot_configurator.h b/util/coreboot-configurator/src/labtop-series/coreboot_configurator.h new file mode 100644 index 0000000..e93636c --- /dev/null +++ b/util/coreboot-configurator/src/labtop-series/coreboot_configurator.h @@ -0,0 +1,110 @@ +#ifndef COREBOOT_CONFIGURATOR_H +#define COREBOOT_CONFIGURATOR_H + +#include <QMainWindow> +#include "readcfg.h" +#include "aboutwindow.h" + +#include <string> +#include <QStringList> +#include <QComboBox> +#include <QCheckBox> +#include <QMessageBox> + +QT_BEGIN_NAMESPACE +namespace Ui +{ +class coreboot_configurator; +} +QT_END_NAMESPACE + +class coreboot_configurator : public QMainWindow +{ + Q_OBJECT + + public: + coreboot_configurator(QWidget *parent = nullptr); + readCfg *init_config; + QString cfgpath_q; + std::string cfgpath_s; + ~coreboot_configurator(); + + // Unicorn: String lists + + // coreboot + QStringList boot_option_options; + + // console + QStringList debug_level_options; + + // cpu + QStringList hyper_threading_options; + QStringList vtd_options; + QStringList power_profile_options; + QStringList me_state_options; + + // Devices + QStringList wireless_options; + QStringList webcam_options; + QStringList microphone_options; + QStringList legacy_8254_timer_options; + // QStringList usb_always_on_options; + + // EC + QStringList kbl_timeout_options; + QStringList fn_ctrl_swap_options; + QStringList max_charge_options; + QStringList fan_mode_options; + + // southbridge + QStringList power_on_after_fail_options; + + // maps + std::map<std::string, int> gfx_map; + std::map<std::string, int> device_map; + + // windows + QMessageBox error_win; + // infoWindow info_win; + aboutWindow about_win; + + + protected: + void showEvent(QShowEvent *ev); + void closeEvent(QCloseEvent *ev); + + public slots: + // closing window + void closeWindow(int result); + void saveAndClose(); + + // slider connections + // void setVolValue(); + // void setRebootValue(); + + // read settings + void getSettings(); + void getFromFile(); + void displaySettings(int result); + + // write settings + void writeSettings(); + void writeToFile(std::string out_file); + + + private: + // read settings + void textToDisplay(QStringList str_list, std::string in_string, QComboBox *box); + void checkToDisplay(std::string in_string, QCheckBox *box); + void hexToSlider(std::string in_string, QSlider *slider); + + // write settings + void checkToFile(std::fstream &output, std::string precursor, QCheckBox *box); + void comboToFile(std::fstream &output, std::string precursor, QComboBox *box, + std::string successor); + void sliderToFile(std::fstream &output, std::string precursor, QSlider *slider); + void lineToFile(std::fstream &output, QLineEdit *line); + + Ui::coreboot_configurator *ui; +}; +#endif // COREBOOT_CONFIGURATOR_H diff --git a/util/coreboot-configurator/src/labtop-series/coreboot_configurator.ui b/util/coreboot-configurator/src/labtop-series/coreboot_configurator.ui new file mode 100644 index 0000000..f51d88e --- /dev/null +++ b/util/coreboot-configurator/src/labtop-series/coreboot_configurator.ui @@ -0,0 +1,1660 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>coreboot_configurator</class> + <widget class="QMainWindow" name="coreboot_configurator"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>585</width> + <height>390</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>585</width> + <height>390</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>585</width> + <height>390</height> + </size> + </property> + <property name="palette"> + <palette> + <active> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Light"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Dark"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>127</red> + <green>127</green> + <blue>127</blue> + </color> + </brush> + </colorrole> + <colorrole role="Mid"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>170</red> + <green>170</green> + <blue>170</blue> + </color> + </brush> + </colorrole> + <colorrole role="Text"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="BrightText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="ButtonText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>246</red> + <green>245</green> + <blue>244</blue> + </color> + </brush> + </colorrole> + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Shadow"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="AlternateBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>220</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="PlaceholderText"> + <brush brushstyle="SolidPattern"> + <color alpha="128"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Light"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Dark"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>127</red> + <green>127</green> + <blue>127</blue> + </color> + </brush> + </colorrole> + <colorrole role="Mid"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>170</red> + <green>170</green> + <blue>170</blue> + </color> + </brush> + </colorrole> + <colorrole role="Text"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="BrightText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="ButtonText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>246</red> + <green>245</green> + <blue>244</blue> + </color> + </brush> + </colorrole> + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Shadow"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="AlternateBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>220</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="PlaceholderText"> + <brush brushstyle="SolidPattern"> + <color alpha="128"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>127</red> + <green>127</green> + <blue>127</blue> + </color> + </brush> + </colorrole> + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Light"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Dark"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>127</red> + <green>127</green> + <blue>127</blue> + </color> + </brush> + </colorrole> + <colorrole role="Mid"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>170</red> + <green>170</green> + <blue>170</blue> + </color> + </brush> + </colorrole> + <colorrole role="Text"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>127</red> + <green>127</green> + <blue>127</blue> + </color> + </brush> + </colorrole> + <colorrole role="BrightText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="ButtonText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>127</red> + <green>127</green> + <blue>127</blue> + </color> + </brush> + </colorrole> + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Shadow"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="AlternateBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>220</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="PlaceholderText"> + <brush brushstyle="SolidPattern"> + <color alpha="128"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="focusPolicy"> + <enum>Qt::NoFocus</enum> + </property> + <property name="windowTitle"> + <string>coreboot configurator</string> + </property> + <widget class="QWidget" name="centralwidget"> + <layout class="QVBoxLayout" name="verticalLayout"> + <property name="spacing"> + <number>8</number> + </property> + <item> + <widget class="QTabWidget" name="tabWidget"> + <property name="autoFillBackground"> + <bool>false</bool> + </property> + <property name="currentIndex"> + <number>0</number> + </property> + <widget class="QWidget" name="Processor"> + <attribute name="title"> + <string>Processor</string> + </attribute> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <layout class="QHBoxLayout" name="hyper_threading"> + <item> + <widget class="QLabel" name="hyper_threading_label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip"> + <string>Enable or disable Hyper-Threading</string> + </property> + <property name="toolTipDuration"> + <number>3000</number> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="text"> + <string>Hyper-Threading</string> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> + </property> + <property name="margin"> + <number>5</number> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="hyper_threading_select"> + <property name="toolTip"> + <string>Enable or disable Hyper-Threading</string> + </property> + <property name="toolTipDuration"> + <number>30000</number> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="styleSheet"> + <string notr="true">QCheckBox::indicator { + width: 60px; + height: 60px; +} + +QCheckBox::indicator:checked +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked +{ + image: url(:/toggle/toggle-off.svg); +} +QCheckBox::indicator:checked:hover +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked:hover +{ + image: url(:/toggle/toggle-off.svg); +} +QCheckBox::indicator:checked:pressed +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked:pressed +{ + image: url(:/toggle/toggle-off.svg); +} +QCheckBox::indicator:checked:disabled +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked:disabled +{ + image: url(:/toggle/toggle-off.svg); +}</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="vtd"> + <item> + <widget class="QLabel" name="vtd_label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip"> + <string>Enable or disable Intel VT-d</string> + </property> + <property name="toolTipDuration"> + <number>3000</number> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="text"> + <string>Intel VT-d</string> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> + </property> + <property name="margin"> + <number>5</number> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="vtd_select"> + <property name="toolTip"> + <string>Enable or disable Intel VT-d</string> + </property> + <property name="toolTipDuration"> + <number>3000</number> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="styleSheet"> + <string notr="true">QCheckBox::indicator { + width: 60px; + height: 60px; +} + +QCheckBox::indicator:checked +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked +{ + image: url(:/toggle/toggle-off.svg); +} +QCheckBox::indicator:checked:hover +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked:hover +{ + image: url(:/toggle/toggle-off.svg); +} +QCheckBox::indicator:checked:pressed +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked:pressed +{ + image: url(:/toggle/toggle-off.svg); +} +QCheckBox::indicator:checked:disabled +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked:disabled +{ + image: url(:/toggle/toggle-off.svg); +}</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="power_profile"> + <item> + <widget class="QLabel" name="power_profile_label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip"> + <string>Change the power profile to maximise performance, battery life or both.</string> + </property> + <property name="toolTipDuration"> + <number>3000</number> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="text"> + <string>Power Profile</string> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> + </property> + <property name="margin"> + <number>5</number> + </property> + </widget> + </item> + <item> + <widget class="QComboBox" name="power_profile_select"> + <property name="maximumSize"> + <size> + <width>150</width> + <height>16777215</height> + </size> + </property> + <property name="toolTip"> + <string>Change the power profile to maximise performance, battery life or both.</string> + </property> + <property name="toolTipDuration"> + <number>3000</number> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="me_state"> + <item> + <widget class="QLabel" name="me_state_label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip"> + <string>Enable or disable the Intel Management Engine</string> + </property> + <property name="toolTipDuration"> + <number>3000</number> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="text"> + <string>Intel Management Engine</string> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> + </property> + <property name="margin"> + <number>5</number> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="me_state_select"> + <property name="toolTip"> + <string>Enable or disable the Intel Management Engine</string> + </property> + <property name="toolTipDuration"> + <number>3000</number> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="styleSheet"> + <string notr="true">QCheckBox::indicator { + width: 60px; + height: 60px; +} + +QCheckBox::indicator:checked +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked +{ + image: url(:/toggle/toggle-off.svg); +} +QCheckBox::indicator:checked:hover +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked:hover +{ + image: url(:/toggle/toggle-off.svg); +} +QCheckBox::indicator:checked:pressed +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked:pressed +{ + image: url(:/toggle/toggle-off.svg); +} +QCheckBox::indicator:checked:disabled +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked:disabled +{ + image: url(:/toggle/toggle-off.svg); +}</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + <widget class="QWidget" name="Devices"> + <attribute name="title"> + <string>Devices</string> + </attribute> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <item> + <layout class="QHBoxLayout" name="wireless"> + <item> + <widget class="QLabel" name="wireless_label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip"> + <string>Enable or disable the built-in Wireless</string> + </property> + <property name="toolTipDuration"> + <number>3000</number> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="text"> + <string>Wireless</string> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> + </property> + <property name="margin"> + <number>5</number> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="wireless_select"> + <property name="toolTip"> + <string>Enable or disable the built-in Wireless</string> + </property> + <property name="toolTipDuration"> + <number>3000</number> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="styleSheet"> + <string notr="true">QCheckBox::indicator { + width: 60px; + height: 60px; +} + +QCheckBox::indicator:checked +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked +{ + image: url(:/toggle/toggle-off.svg); +} +QCheckBox::indicator:checked:hover +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked:hover +{ + image: url(:/toggle/toggle-off.svg); +} +QCheckBox::indicator:checked:pressed +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked:pressed +{ + image: url(:/toggle/toggle-off.svg); +} +QCheckBox::indicator:checked:disabled +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked:disabled +{ + image: url(:/toggle/toggle-off.svg); +}</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="webcam"> + <item> + <widget class="QLabel" name="webcam_label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip"> + <string>Enable or disable the built-in Webcam</string> + </property> + <property name="toolTipDuration"> + <number>3000</number> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="text"> + <string>Webcam</string> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> + </property> + <property name="margin"> + <number>5</number> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="webcam_select"> + <property name="toolTip"> + <string>Enable or disable the built-in Webcam</string> + </property> + <property name="toolTipDuration"> + <number>3000</number> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="styleSheet"> + <string notr="true">QCheckBox::indicator { + width: 60px; + height: 60px; +} + +QCheckBox::indicator:checked +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked +{ + image: url(:/toggle/toggle-off.svg); +} +QCheckBox::indicator:checked:hover +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked:hover +{ + image: url(:/toggle/toggle-off.svg); +} +QCheckBox::indicator:checked:pressed +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked:pressed +{ + image: url(:/toggle/toggle-off.svg); +} +QCheckBox::indicator:checked:disabled +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked:disabled +{ + image: url(:/toggle/toggle-off.svg); +}</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="microphone"> + <item> + <widget class="QLabel" name="microphone_label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip"> + <string>Enable or disable the built-in Microphone</string> + </property> + <property name="toolTipDuration"> + <number>30000</number> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="text"> + <string>Microphone</string> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> + </property> + <property name="margin"> + <number>5</number> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="microphone_select"> + <property name="toolTip"> + <string>Enable or disable the built-in Microphone</string> + </property> + <property name="toolTipDuration"> + <number>30000</number> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="styleSheet"> + <string notr="true">QCheckBox::indicator { + width: 60px; + height: 60px; +} + +QCheckBox::indicator:checked +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked +{ + image: url(:/toggle/toggle-off.svg); +} +QCheckBox::indicator:checked:hover +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked:hover +{ + image: url(:/toggle/toggle-off.svg); +} +QCheckBox::indicator:checked:pressed +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked:pressed +{ + image: url(:/toggle/toggle-off.svg); +} +QCheckBox::indicator:checked:disabled +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked:disabled +{ + image: url(:/toggle/toggle-off.svg); +}</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="legacy_8254_timer"> + <item> + <widget class="QLabel" name="legacy_8254_timer_label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip"> + <string>Enable or disable the 8254 legacy timer. Reduces power consumption when enabled but must be disabled for distributions such as Qubes.</string> + </property> + <property name="toolTipDuration"> + <number>3000</number> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="text"> + <string>Clock Gating</string> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> + </property> + <property name="margin"> + <number>5</number> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="legacy_8254_timer_select"> + <property name="toolTip"> + <string>Enable or disable the 8254 legacy timer. Reduces power consumption when enabled but must be disabled for distributions such as Qubes.</string> + </property> + <property name="toolTipDuration"> + <number>3000</number> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="styleSheet"> + <string notr="true">QCheckBox::indicator { + width: 60px; + height: 60px; +} + +QCheckBox::indicator:checked +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked +{ + image: url(:/toggle/toggle-off.svg); +} +QCheckBox::indicator:checked:hover +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked:hover +{ + image: url(:/toggle/toggle-off.svg); +} +QCheckBox::indicator:checked:pressed +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked:pressed +{ + image: url(:/toggle/toggle-off.svg); +} +QCheckBox::indicator:checked:disabled +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked:disabled +{ + image: url(:/toggle/toggle-off.svg); +}</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + <widget class="QWidget" name="System"> + <attribute name="title"> + <string>System</string> + </attribute> + <layout class="QVBoxLayout" name="verticalLayout_4"> + <item> + <layout class="QHBoxLayout" name="kbl_timeout"> + <item> + <widget class="QLabel" name="kbl_timeout_label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip"> + <string>Adjust the amount of time before the keyboard backlight turns off after not being used.</string> + </property> + <property name="toolTipDuration"> + <number>3000</number> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="text"> + <string>Keyboard Backlight Timeout</string> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> + </property> + <property name="margin"> + <number>5</number> + </property> + </widget> + </item> + <item> + <widget class="QComboBox" name="kbl_timeout_select"> + <property name="maximumSize"> + <size> + <width>150</width> + <height>16777215</height> + </size> + </property> + <property name="toolTip"> + <string>Adjust the amount of time before the keyboard backlight turns off after not being used.</string> + </property> + <property name="toolTipDuration"> + <number>3000</number> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="fn_ctrl_swap"> + <item> + <widget class="QLabel" name="fn_ctrl_swap_label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip"> + <string>Swap the functions of the Fn and Ctrl keys.</string> + </property> + <property name="toolTipDuration"> + <number>3000</number> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Sunken</enum> + </property> + <property name="text"> + <string>Fn Ctrl Reverse</string> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> + </property> + <property name="margin"> + <number>5</number> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="fn_ctrl_swap_select"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="sizeIncrement"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="baseSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="acceptDrops"> + <bool>false</bool> + </property> + <property name="toolTip"> + <string extracomment="Reverses the Ctrl and Fn keys">Swap the functions of the Fn and Ctrl keys.</string> + </property> + <property name="toolTipDuration"> + <number>3000</number> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="autoFillBackground"> + <bool>false</bool> + </property> + <property name="styleSheet"> + <string notr="true">QCheckBox::indicator { + width: 60px; + height: 60px; +} + +QCheckBox::indicator:checked +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked +{ + image: url(:/toggle/toggle-off.svg); +} +QCheckBox::indicator:checked:hover +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked:hover +{ + image: url(:/toggle/toggle-off.svg); +} +QCheckBox::indicator:checked:pressed +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked:pressed +{ + image: url(:/toggle/toggle-off.svg); +} +QCheckBox::indicator:checked:disabled +{ + image: url(:/toggle/toggle-on.svg); +} +QCheckBox::indicator:unchecked:disabled +{ + image: url(:/toggle/toggle-off.svg); +}</string> + </property> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="max_charge"> + <item> + <widget class="QLabel" name="max_charge_label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip"> + <string>Sets the maximum level that the battery will charge to.</string> + </property> + <property name="toolTipDuration"> + <number>3000</number> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="text"> + <string>Max Charge</string> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> + </property> + <property name="margin"> + <number>5</number> + </property> + </widget> + </item> + <item> + <widget class="QComboBox" name="max_charge_select"> + <property name="maximumSize"> + <size> + <width>150</width> + <height>16777215</height> + </size> + </property> + <property name="toolTip"> + <string>Sets the maximum level that the battery will charge to.</string> + </property> + <property name="toolTipDuration"> + <number>3000</number> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="fan_mode"> + <item> + <widget class="QLabel" name="fan_mode_label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip"> + <string>Adjusts the fan curve to allow priorise reducing heat, noise or both.</string> + </property> + <property name="toolTipDuration"> + <number>3000</number> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="text"> + <string>Fan Mode</string> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> + </property> + <property name="margin"> + <number>5</number> + </property> + </widget> + </item> + <item> + <widget class="QComboBox" name="fan_mode_select"> + <property name="maximumSize"> + <size> + <width>150</width> + <height>16777215</height> + </size> + </property> + <property name="toolTip"> + <string>Adjusts the fan curve to allow priorise reducing heat, noise or both.</string> + </property> + <property name="toolTipDuration"> + <number>3000</number> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + <widget class="QWidget" name="Advanced"> + <attribute name="title"> + <string>Advanced</string> + </attribute> + <layout class="QVBoxLayout" name="verticalLayout_5"> + <item> + <layout class="QHBoxLayout" name="boot_option"> + <item> + <widget class="QLabel" name="boot_option_label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip"> + <string>Sets the boot device in the event of a failed boot</string> + </property> + <property name="toolTipDuration"> + <number>3000</number> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="text"> + <string>Boot Option</string> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> + </property> + <property name="margin"> + <number>5</number> + </property> + </widget> + </item> + <item> + <widget class="QComboBox" name="boot_option_select"> + <property name="maximumSize"> + <size> + <width>150</width> + <height>16777215</height> + </size> + </property> + <property name="toolTip"> + <string>Sets the boot device in the event of a failed boot</string> + </property> + <property name="toolTipDuration"> + <number>3000</number> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="debug_level"> + <item> + <widget class="QLabel" name="debug_level_label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip"> + <string>Sets the verbositity of the debug output.</string> + </property> + <property name="toolTipDuration"> + <number>3000</number> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="text"> + <string>Debug Configuration</string> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> + </property> + <property name="margin"> + <number>5</number> + </property> + </widget> + </item> + <item> + <widget class="QComboBox" name="debug_level_select"> + <property name="maximumSize"> + <size> + <width>150</width> + <height>16777215</height> + </size> + </property> + <property name="toolTip"> + <string>Sets the verbositity of the debug output.</string> + </property> + <property name="toolTipDuration"> + <number>3000</number> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="power_on_after_fail"> + <item> + <widget class="QLabel" name="power_on_after_fail_label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip"> + <string>Change whether to power on once power is restored after a power loss.</string> + </property> + <property name="toolTipDuration"> + <number>3000</number> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="text"> + <string>Power on Behaviour</string> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> + </property> + <property name="margin"> + <number>5</number> + </property> + </widget> + </item> + <item> + <widget class="QComboBox" name="power_on_after_fail_select"> + <property name="maximumSize"> + <size> + <width>150</width> + <height>16777215</height> + </size> + </property> + <property name="toolTip"> + <string>Change whether to power on once power is restored after a power loss.</string> + </property> + <property name="toolTipDuration"> + <number>3000</number> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </widget> + </item> + <item> + <widget class="QDialogButtonBox" name="confirmBox"> + <property name="standardButtons"> + <set>QDialogButtonBox::Save</set> + </property> + </widget> + </item> + </layout> + </widget> + <widget class="QMenuBar" name="menubar"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>585</width> + <height>22</height> + </rect> + </property> + <widget class="QMenu" name="menuFile"> + <property name="title"> + <string>File</string> + </property> + <addaction name="actionSave_to_File"/> + <addaction name="actionImport_from_File"/> + <addaction name="separator"/> + </widget> + <widget class="QMenu" name="menuHelp"> + <property name="title"> + <string>Help</string> + </property> + <addaction name="separator"/> + <addaction name="actionAbout_2"/> + </widget> + <addaction name="menuFile"/> + <addaction name="menuHelp"/> + </widget> + <action name="actionInformation"> + <property name="text"> + <string>Information</string> + </property> + </action> + <action name="actionAbout"> + <property name="text"> + <string>About</string> + </property> + </action> + <action name="actionAbout_2"> + <property name="text"> + <string>About</string> + </property> + </action> + <action name="actionSave_to_File"> + <property name="text"> + <string>Save to File...</string> + </property> + </action> + <action name="actionImport_from_File"> + <property name="text"> + <string>Import from File...</string> + </property> + </action> + <action name="actionExit"> + <property name="text"> + <string>Exit</string> + </property> + </action> + <action name="actionSave_and_Exit"> + <property name="text"> + <string>Save and Exit</string> + </property> + </action> + </widget> + <resources> + <include location="images.qrc"/> + </resources> + <connections/> +</ui> diff --git a/util/coreboot-configurator/src/labtop-series/images.qrc b/util/coreboot-configurator/src/labtop-series/images.qrc new file mode 100644 index 0000000..96ba388 --- /dev/null +++ b/util/coreboot-configurator/src/labtop-series/images.qrc @@ -0,0 +1,6 @@ +<RCC> + <qresource prefix="toggle"> + <file>toggle-off.svg</file> + <file>toggle-on.svg</file> + </qresource> +</RCC> diff --git a/util/coreboot-configurator/src/labtop-series/main.cpp b/util/coreboot-configurator/src/labtop-series/main.cpp new file mode 100644 index 0000000..3dbfd54 --- /dev/null +++ b/util/coreboot-configurator/src/labtop-series/main.cpp @@ -0,0 +1,11 @@ +#include "coreboot_configurator.h" + +#include <QApplication> + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + coreboot_configurator w; + w.show(); + return a.exec(); +} diff --git a/util/coreboot-configurator/src/labtop-series/meson.build b/util/coreboot-configurator/src/labtop-series/meson.build new file mode 100644 index 0000000..5c6da72 --- /dev/null +++ b/util/coreboot-configurator/src/labtop-series/meson.build @@ -0,0 +1,25 @@ +install_dir = 'sbin' +qt5 = import('qt5') +qt5_dep = dependency('qt5', modules : ['Core', 'Gui', 'Widgets']) + + +prep = qt5.preprocess( + moc_headers : ['aboutwindow.h', + 'coreboot_configurator.h', + 'readcfg.h'], + ui_files : ['aboutwindow.ui', + 'coreboot_configurator.ui'], + qresources : ['images.qrc'], +) + +executable(meson.project_name(), + sources : ['aboutwindow.cpp', + 'coreboot_configurator.cpp', + 'main.cpp', + 'readcfg.cpp', + prep], + dependencies : qt5_dep, + cpp_args : '-std=c++11', + install : true, + install_dir : install_dir) + diff --git a/util/coreboot-configurator/src/labtop-series/readcfg.cpp b/util/coreboot-configurator/src/labtop-series/readcfg.cpp new file mode 100644 index 0000000..e27f13c --- /dev/null +++ b/util/coreboot-configurator/src/labtop-series/readcfg.cpp @@ -0,0 +1,44 @@ +#include "readcfg.h" +#include <iostream> +#include <fstream> +#include <string> + +readCfg::readCfg(std::string in_file) +{ + this->in_file = in_file; +} + +std::string readCfg::shrink_string(std::string input) +{ + size_t last_pos = input.find_last_of(' '); + if (last_pos == input.size() - 1) { + input = input.substr(0, input.size() - 1); + return shrink_string(input); + } else { + return input; + } +} + + +void readCfg::get_values() +{ + std::fstream curr_file; + std::string curr_line; + std::string curr_word; + + curr_file.open(in_file, std::ios::in); + + if (curr_file.is_open()) { + int counter = 0; + while (getline(curr_file, curr_line)) { + std::string shrunken = shrink_string(curr_line); + int last_space = shrunken.find_last_of(' '); + values[counter++] = + shrunken.substr(last_space + 1, shrunken.size() - last_space); + if (values[counter - 1] == "=") { + values[counter - 1] = ""; + } + } + } + curr_file.close(); +} diff --git a/util/coreboot-configurator/src/labtop-series/readcfg.h b/util/coreboot-configurator/src/labtop-series/readcfg.h new file mode 100644 index 0000000..587bd18 --- /dev/null +++ b/util/coreboot-configurator/src/labtop-series/readcfg.h @@ -0,0 +1,22 @@ +#ifndef READCFG_H +#define READCFG_H + +#include <QObject> + +class readCfg : public QObject +{ + Q_OBJECT + public: + explicit readCfg(std::string in_file); + + std::string values[25]; + void get_values(); + + private: + std::string in_file; + std::string shrink_string(std::string input); + + signals: +}; + +#endif // READCFG_H diff --git a/util/coreboot-configurator/src/labtop-series/toggle-off.svg b/util/coreboot-configurator/src/labtop-series/toggle-off.svg new file mode 100644 index 0000000..504ea58 --- /dev/null +++ b/util/coreboot-configurator/src/labtop-series/toggle-off.svg @@ -0,0 +1,4 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="40" height="20" viewBox="0 0 40 20"> + <rect x="2" y="2" width="36" height="16" ry="8" fill="#000000" fill-opacity=".26"/> + <circle cx="10" cy="10" r="6" fill="#ffffff"/> +</svg> diff --git a/util/coreboot-configurator/src/labtop-series/toggle-on.svg b/util/coreboot-configurator/src/labtop-series/toggle-on.svg new file mode 100644 index 0000000..0b8e618 --- /dev/null +++ b/util/coreboot-configurator/src/labtop-series/toggle-on.svg @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + inkscape:version="1.0rc1 (1.0rc1+100)" + sodipodi:docname="toggle-on.svg" + id="svg6" + version="1.1" + viewBox="0 0 40 20" + height="20" + width="40"> + <metadata + id="metadata12"> + rdf:RDF + <cc:Work + rdf:about=""> + dc:formatimage/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <defs + id="defs10" /> + <sodipodi:namedview + inkscape:current-layer="svg6" + inkscape:window-maximized="1" + inkscape:window-y="28" + inkscape:window-x="65" + inkscape:cy="10" + inkscape:cx="20.062112" + inkscape:zoom="32.2" + showgrid="false" + id="namedview8" + inkscape:window-height="1020" + inkscape:window-width="1855" + inkscape:pageshadow="2" + inkscape:pageopacity="0" + guidetolerance="10" + gridtolerance="10" + objecttolerance="10" + borderopacity="1" + bordercolor="#666666" + pagecolor="#ffffff" /> + <rect + style="fill:#0068bf;fill-opacity:1" + id="rect2" + fill="#1a73e8" + ry="8" + height="16" + width="36" + y="2" + x="2" /> + <circle + id="circle4" + fill="#ffffff" + r="6" + cy="10" + cx="30" /> +</svg> diff --git a/util/coreboot-configurator/src/meson.build b/util/coreboot-configurator/src/meson.build new file mode 100644 index 0000000..0d71119 --- /dev/null +++ b/util/coreboot-configurator/src/meson.build @@ -0,0 +1,2 @@ +subdir('labtop-series') +subdir('static') diff --git a/util/coreboot-configurator/src/static/aboutIcon.png b/util/coreboot-configurator/src/static/aboutIcon.png new file mode 100644 index 0000000..1adbfca --- /dev/null +++ b/util/coreboot-configurator/src/static/aboutIcon.png Binary files differ diff --git a/util/coreboot-configurator/src/static/coreboot-configurator.desktop b/util/coreboot-configurator/src/static/coreboot-configurator.desktop new file mode 100644 index 0000000..bdbecf9 --- /dev/null +++ b/util/coreboot-configurator/src/static/coreboot-configurator.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=coreboot configurator +StartupWMCLass=coreboot_configurator +Exec=/usr/sbin/coreboot-configurator +Icon=coreboot-configurator.png +Type=Application +Categories=Settings;System +Comment=A graphical interface to set options on devices with coreboot firmware. +Keywords=Coreboot;BIOS diff --git a/util/coreboot-configurator/src/static/coreboot_configurator.svg b/util/coreboot-configurator/src/static/coreboot_configurator.svg new file mode 100644 index 0000000..33a7229 --- /dev/null +++ b/util/coreboot-configurator/src/static/coreboot_configurator.svg @@ -0,0 +1,748 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="512" + height="512" + viewBox="0 0 135.46667 135.46667" + version="1.1" + id="svg8" + inkscape:version="1.0.2 (1.0.2+r75+1)" + sodipodi:docname="corevantage.svg" + inkscape:export-filename="/home/sean/Documents/corevantage-x200-1.2/icon/16x16png.png" + inkscape:export-xdpi="3" + inkscape:export-ydpi="3"> + <defs + id="defs2"> + <linearGradient + inkscape:collect="always" + id="linearGradient1476"> + <stop + style="stop-color:#27f7d0;stop-opacity:1;" + offset="0" + id="stop1472" /> + <stop + style="stop-color:#2195f2;stop-opacity:1" + offset="1" + id="stop1474" /> + </linearGradient> + <filter + style="color-interpolation-filters:sRGB" + inkscape:label="Drop Shadow" + id="filter570"> + <feColorMatrix + type="hueRotate" + values="180" + result="color1" + id="feColorMatrix566" /> + <feColorMatrix + values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 -0.21 -0.72 -0.07 2 0 " + result="fbSourceGraphic" + id="feColorMatrix568" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix572" /> + <feColorMatrix + id="feColorMatrix574" + type="hueRotate" + values="180" + result="color1" + in="fbSourceGraphic" /> + <feColorMatrix + id="feColorMatrix576" + values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 -0.21 -0.72 -0.07 2 0 " + result="fbSourceGraphic" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix578" /> + <feColorMatrix + id="feColorMatrix580" + type="hueRotate" + values="180" + result="color1" + in="fbSourceGraphic" /> + <feColorMatrix + id="feColorMatrix582" + values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 -0.21 -0.72 -0.07 2 0 " + result="fbSourceGraphic" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix12032" /> + <feFlood + id="feFlood12034" + flood-opacity="0.698039" + flood-color="rgb(0,0,0)" + result="flood" + in="fbSourceGraphic" /> + <feComposite + in2="fbSourceGraphic" + id="feComposite12036" + in="flood" + operator="out" + result="composite1" /> + <feGaussianBlur + id="feGaussianBlur12038" + in="composite1" + stdDeviation="1.26667" + result="blur" /> + <feOffset + id="feOffset12040" + dx="0.9" + dy="1" + result="offset" /> + <feComposite + in2="fbSourceGraphic" + id="feComposite12042" + in="offset" + operator="atop" + result="composite2" /> + </filter> + <filter + style="color-interpolation-filters:sRGB" + inkscape:label="Bump" + id="filter10278"> + <feGaussianBlur + in="SourceGraphic" + stdDeviation="1.81244" + result="blur1" + id="feGaussianBlur10256" /> + <feColorMatrix + in="blur1" + values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 " + result="colormatrix1" + id="feColorMatrix10258" /> + <feColorMatrix + in="colormatrix1" + type="luminanceToAlpha" + result="colormatrix2" + id="feColorMatrix10260" /> + <feComposite + in2="blur1" + operator="arithmetic" + k2="1" + k3="0" + result="composite1" + id="feComposite10262" + k1="0" + k4="0" /> + <feGaussianBlur + in="composite1" + stdDeviation="2.99163" + result="blur2" + id="feGaussianBlur10264" /> + <feSpecularLighting + lighting-color="#ffffff" + surfaceScale="10.0614996" + specularConstant="0.72376299" + specularExponent="17" + result="lighting" + id="feSpecularLighting10268"> + <feDistantLight + azimuth="225" + elevation="45" + id="feDistantLight10266" /> + </feSpecularLighting> + <feFlood + flood-color="rgb(197,41,41)" + flood-opacity="1" + result="flood" + id="feFlood10270" /> + <feComposite + in="lighting" + in2="blur1" + operator="arithmetic" + k3="1" + k2="1" + result="composite2" + id="feComposite10272" + k1="0" + k4="0" /> + <feBlend + in2="SourceGraphic" + mode="normal" + result="blend" + id="feBlend10274" /> + <feComposite + in="blend" + in2="SourceGraphic" + operator="in" + result="fbSourceGraphic" + id="feComposite10276" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix14324" /> + <feGaussianBlur + id="feGaussianBlur14326" + in="fbSourceGraphic" + stdDeviation="0.276667" + result="blur1" /> + <feColorMatrix + id="feColorMatrix14328" + in="blur1" + values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 " + result="colormatrix1" /> + <feColorMatrix + id="feColorMatrix14330" + in="colormatrix1" + type="luminanceToAlpha" + result="colormatrix2" /> + <feComposite + in2="blur1" + id="feComposite14332" + operator="arithmetic" + k2="1" + k3="-49.8667" + result="composite1" + k1="0" + k4="0" /> + <feGaussianBlur + id="feGaussianBlur14334" + in="composite1" + stdDeviation="1.27667" + result="blur2" /> + <feSpecularLighting + id="feSpecularLighting14336" + lighting-color="#ffffff" + surfaceScale="10.0614996" + specularConstant="0.72376299" + specularExponent="17" + result="lighting"> + <feDistantLight + id="feDistantLight14338" + azimuth="225" + elevation="45" /> + </feSpecularLighting> + <feFlood + id="feFlood14340" + flood-color="rgb(197,41,41)" + flood-opacity="1" + result="flood" /> + <feComposite + in2="blur1" + id="feComposite14342" + in="lighting" + operator="arithmetic" + k3="1" + k2="1" + result="composite2" + k1="0" + k4="0" /> + <feBlend + in2="fbSourceGraphic" + id="feBlend14344" + mode="normal" + result="blend" /> + <feComposite + in2="fbSourceGraphic" + id="feComposite14346" + in="blend" + operator="in" + result="composite3" /> + </filter> + <clipPath + id="b-7-9"> + <path + id="path106-2-2" + d="m 18,102 h 86 v 16 H 18 Z m 0,0" + inkscape:connector-curvature="0" /> + </clipPath> + <clipPath + id="c-5-0"> + <path + id="path121-1-2" + d="m 16.496,28.445 h 96.176 c 4.418,0 8,3.575 8,7.989 v 73.578 c 0,4.414 -3.582,7.988 -8,7.988 H 16.496 c -4.418,0 -8,-3.574 -8,-7.988 V 36.434 c 0,-4.414 3.582,-7.989 8,-7.989 z m 0,0" + inkscape:connector-curvature="0" /> + </clipPath> + <linearGradient + gradientTransform="matrix(0.25,0,0,0.2496,0.495,57.398)" + y2="234.21899" + x2="94.021004" + y1="194.21899" + x1="94.021004" + gradientUnits="userSpaceOnUse" + id="d-3"> + <stop + id="stop37" + stop-color="#f9f06b" + offset="0" /> + <stop + id="stop39" + stop-color="#fcf7ac" + offset=".512" /> + <stop + id="stop41" + stop-color="#f9f06b" + offset="1" /> + </linearGradient> + <clipPath + id="e-5-9"> + <path + id="path118-6-2" + d="m 18,116 h 76 v 2 H 18 Z m 0,0" + inkscape:connector-curvature="0" /> + </clipPath> + <clipPath + id="f-62-2"> + <path + id="path115-3-8" + d="m 16.496,28.445 h 96.176 c 4.418,0 8,3.575 8,7.989 v 73.578 c 0,4.414 -3.582,7.988 -8,7.988 H 16.496 c -4.418,0 -8,-3.574 -8,-7.988 V 36.434 c 0,-4.414 3.582,-7.989 8,-7.989 z m 0,0" + inkscape:connector-curvature="0" /> + </clipPath> + <linearGradient + gradientTransform="matrix(0.25,0,0,0.2496,0.495,57.398)" + y2="234.78101" + x2="202.021" + y1="242.79401" + x1="202.021" + gradientUnits="userSpaceOnUse" + id="g-9"> + <stop + id="stop62" + stop-color="#c09608" + offset="0" /> + <stop + id="stop64" + stop-color="#f6ca30" + offset="1" /> + </linearGradient> + <clipPath + id="h-36"> + <path + id="path112-0-1" + d="m 98,115 h 6 v 3 h -6 z m 0,0" + inkscape:connector-curvature="0" /> + </clipPath> + <clipPath + id="i-12-2"> + <path + id="path109-2-9" + d="m 16.496,28.445 h 96.176 c 4.418,0 8,3.575 8,7.989 v 73.578 c 0,4.414 -3.582,7.988 -8,7.988 H 16.496 c -4.418,0 -8,-3.574 -8,-7.988 V 36.434 c 0,-4.414 3.582,-7.989 8,-7.989 z m 0,0" + inkscape:connector-curvature="0" /> + </clipPath> + <linearGradient + inkscape:collect="always" + xlink:href="#j-7" + id="linearGradient5088" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(3.2066783,0,0,3.2066783,432.07192,-765.09973)" + x1="37" + y1="249" + x2="37" + y2="254" /> + <linearGradient + gradientTransform="matrix(1.4285714,0,0,1.4285714,65.142859,-261.28571)" + y2="254" + x2="37" + y1="249" + x1="37" + gradientUnits="userSpaceOnUse" + id="j-7"> + <stop + id="stop2-6" + stop-color="#d5d1cc" + offset="0" /> + <stop + id="stop4-1-0" + stop-color="#f6f5f4" + offset=".183" /> + <stop + id="stop6-5" + stop-color="#fff" + offset=".395" /> + <stop + id="stop8-6" + stop-color="#d7d3ce" + offset=".784" /> + <stop + id="stop10-0" + stop-color="#c8c2bb" + offset="1" /> + </linearGradient> + <linearGradient + gradientTransform="matrix(1.4285714,0,0,1.4285714,36.571431,-224.85714)" + y2="259" + x2="18.608" + y1="253" + x1="17" + gradientUnits="userSpaceOnUse" + id="k-2"> + <stop + id="stop88" + stop-color="#f9f06b" + offset="0" /> + <stop + id="stop90" + stop-color="#fcf7ac" + offset=".512" /> + <stop + id="stop92" + stop-color="#f9f06b" + offset="1" /> + </linearGradient> + <linearGradient + gradientTransform="matrix(1.4285714,0,0,0.4761857,36.571431,11.332859)" + y2="259" + x2="18.608" + y1="253" + x1="17" + gradientUnits="userSpaceOnUse" + id="l-936"> + <stop + id="stop81-6" + stop-color="#f9f06b" + offset="0" /> + <stop + id="stop83" + stop-color="#fcf7ac" + offset=".512" /> + <stop + id="stop85" + stop-color="#f9f06b" + offset="1" /> + </linearGradient> + <linearGradient + gradientTransform="matrix(1.4285714,0,0,0.4761857,48.000002,-5.8099974)" + y2="259" + x2="18.608" + y1="253" + x1="17" + gradientUnits="userSpaceOnUse" + id="m-06"> + <stop + id="stop74" + stop-color="#f9f06b" + offset="0" /> + <stop + id="stop76" + stop-color="#fcf7ac" + offset=".512" /> + <stop + id="stop78" + stop-color="#f9f06b" + offset="1" /> + </linearGradient> + <linearGradient + gradientTransform="matrix(1.4285714,0,0,1.4285714,48.000002,-259.14285)" + y2="259" + x2="18.608" + y1="253" + x1="17" + gradientUnits="userSpaceOnUse" + id="n-2-6"> + <stop + id="stop67-5" + stop-color="#f9f06b" + offset="0" /> + <stop + id="stop69-0" + stop-color="#fcf7ac" + offset=".512" /> + <stop + id="stop71" + stop-color="#f9f06b" + offset="1" /> + </linearGradient> + <linearGradient + gradientTransform="matrix(1.4285714,0,0,0.4761857,48.000002,-22.952854)" + y2="259" + x2="18.608" + y1="253" + x1="17" + gradientUnits="userSpaceOnUse" + id="o-1"> + <stop + id="stop55" + stop-color="#f9f06b" + offset="0" /> + <stop + id="stop57" + stop-color="#fcf7ac" + offset=".512" /> + <stop + id="stop59" + stop-color="#f9f06b" + offset="1" /> + </linearGradient> + <linearGradient + gradientTransform="matrix(1.4285714,0,0,1.4285714,93.714287,-234.85714)" + y2="254" + x2="37" + y1="249" + x1="37" + gradientUnits="userSpaceOnUse" + id="p-61"> + <stop + id="stop44-8" + stop-color="#d5d1cc" + offset="0" /> + <stop + id="stop46" + stop-color="#f6f5f4" + offset=".183" /> + <stop + id="stop48" + stop-color="#fff" + offset=".395" /> + <stop + id="stop50" + stop-color="#d7d3ce" + offset=".784" /> + <stop + id="stop52" + stop-color="#c8c2bb" + offset="1" /> + </linearGradient> + <linearGradient + gradientTransform="matrix(1.4285714,0,0,-1.4285714,93.714287,465.14285)" + y2="254" + x2="37" + y1="249" + x1="37" + gradientUnits="userSpaceOnUse" + id="q-79"> + <stop + id="stop26" + stop-color="#d5d1cc" + offset="0" /> + <stop + id="stop28-8" + stop-color="#f6f5f4" + offset=".183" /> + <stop + id="stop30-7" + stop-color="#fff" + offset=".395" /> + <stop + id="stop32" + stop-color="#d7d3ce" + offset=".784" /> + <stop + id="stop34" + stop-color="#c8c2bb" + offset="1" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#r-2" + id="linearGradient5104" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(3.2066783,0,0,3.2066783,367.93856,-676.916)" + x1="37" + y1="249" + x2="37" + y2="254" /> + <linearGradient + gradientTransform="matrix(1.4285714,0,0,1.4285714,36.571431,-221.99999)" + y2="254" + x2="37" + y1="249" + x1="37" + gradientUnits="userSpaceOnUse" + id="r-2"> + <stop + id="stop95" + stop-color="#d5d1cc" + offset="0" /> + <stop + id="stop97" + stop-color="#f6f5f4" + offset=".183" /> + <stop + id="stop99" + stop-color="#fff" + offset=".395" /> + <stop + id="stop101-0" + stop-color="#d7d3ce" + offset=".784" /> + <stop + id="stop103-23" + stop-color="#c8c2bb" + offset="1" /> + </linearGradient> + <filter + inkscape:collect="always" + style="color-interpolation-filters:sRGB" + id="filter1525-3" + x="-0.012" + width="1.024" + y="-0.012" + height="1.024"> + <feGaussianBlur + inkscape:collect="always" + stdDeviation="0.063499999" + id="feGaussianBlur1527-6" /> + </filter> + <clipPath + id="clipPath24907" + clipPathUnits="userSpaceOnUse"> + <rect + inkscape:label="Square-Background" + style="fill:#319395;fill-opacity:1;stroke-width:0.315296" + id="rect24909" + width="12.170834" + height="12.170922" + x="-204.80406" + y="195.97275" + rx="2.2374113" /> + </clipPath> + <clipPath + id="clipPath24901" + clipPathUnits="userSpaceOnUse"> + <path + inkscape:connector-curvature="0" + d="M 52.848788,9.1555002 H 203.13314 c 24.20496,0 43.69115,19.4861378 43.69115,43.6911478 V 203.13271 c 0,24.2048 -19.48619,43.6912 -43.69115,43.6912 H 52.848788 c -24.204958,0 -43.6911479,-19.4864 -43.6911479,-43.6912 V 52.846648 c 0,-24.20501 19.4861899,-43.6911478 43.6911479,-43.6911478 z" + inkscape:label="Square-Background" + style="fill:#319395;fill-opacity:1;stroke-width:6.15696" + id="path24903" /> + </clipPath> + <linearGradient + inkscape:collect="always" + xlink:href="#p-61" + id="linearGradient1470" + x1="32.241405" + y1="52.764114" + x2="164.33501" + y2="52.764114" + gradientUnits="userSpaceOnUse" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient1476" + id="radialGradient1478" + cx="518.65234" + cy="84.663773" + fx="518.65234" + fy="84.663773" + r="64.910637" + gradientTransform="matrix(2.9098159,0.04997269,-0.04502878,2.6219419,-986.71822,-163.23817)" + gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + xlink:href="#p-61" + id="linearGradient1500" + gradientUnits="userSpaceOnUse" + x1="32.241405" + y1="52.764114" + x2="164.33501" + y2="52.764114" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.3160391" + inkscape:cx="144.17386" + inkscape:cy="37.998289" + inkscape:document-units="mm" + inkscape:current-layer="layer2" + inkscape:document-rotation="0" + showgrid="false" + units="px" + inkscape:window-width="928" + inkscape:window-height="1020" + inkscape:window-x="992" + inkscape:window-y="28" + inkscape:window-maximized="0" /> + <metadata + id="metadata5"> + rdf:RDF + <cc:Work + rdf:about=""> + dc:formatimage/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" /> + <g + inkscape:groupmode="layer" + id="layer2" + inkscape:label="Layer 2"> + <g + id="g1498" + transform="translate(-450.91873,-16.930479)"> + <rect + style="display:inline;opacity:0.2;fill:#000000;fill-opacity:1;stroke-width:0.329004;filter:url(#filter1525-3)" + id="rect24836" + width="12.7" + height="12.7" + x="0.11910726" + y="-0.044058971" + rx="2.3346901" + transform="matrix(10.416591,0,0,10.416666,451.26602,18.976929)" + inkscape:label="Square-Shadow" /> + <rect + rx="23.865547" + y="19.752666" + x="453.7417" + height="129.82222" + width="129.82127" + id="rect24838" + style="display:inline;fill:url(#radialGradient1478);fill-opacity:1;stroke-width:3.36314" + inkscape:label="Square-Background" /> + <path + style="fill:url(#linearGradient5088);stroke-width:3.20667" + inkscape:connector-curvature="0" + id="path4986" + d="m 486.58552,31.747108 c -1.77909,0 -3.20679,1.427114 -3.20679,3.206817 v 12.839519 h 6.41328 V 34.953925 c 0,-1.779673 -1.42683,-3.206817 -3.20679,-3.206817 z m 12.82685,0 c -1.77909,0 -3.2068,1.427114 -3.2068,3.206817 v 12.839519 h 6.41328 V 34.953925 c 0,-1.779673 -1.4268,-3.206817 -3.20679,-3.206817 z m 12.82656,0 c -1.77909,0 -3.2068,1.427114 -3.2068,3.206817 v 12.839519 h 6.41357 V 34.953925 c 0,-1.779673 -1.42681,-3.206817 -3.20708,-3.206817 z m 12.82684,0 c -1.77909,0 -3.20679,1.427114 -3.20679,3.206817 v 12.839519 h 6.41328 V 34.953925 c 0,-1.779673 -1.42681,-3.206817 -3.20679,-3.206817 z m 12.82656,0 c -1.77909,0 -3.20679,1.427114 -3.20679,3.206817 v 12.839519 h 6.41356 V 34.953925 c 0,-1.779673 -1.4268,-3.206817 -3.20708,-3.206817 z m 12.82684,0 c -1.77909,0 -3.20679,1.427114 -3.20679,3.206817 v 12.839519 h 6.41328 V 34.953925 c 0,-1.779673 -1.4268,-3.206817 -3.20679,-3.206817 z m 0,0" /> + <path + style="fill:url(#linearGradient5104);stroke-width:3.20667" + inkscape:connector-curvature="0" + id="path5078" + d="m 483.37904,121.54693 v 12.8267 c 0,1.77967 1.4268,3.20681 3.20677,3.20681 1.77909,0 3.20679,-1.42681 3.20679,-3.20681 v -12.8267 z m 12.82653,0 v 12.8267 c 0,1.77967 1.42683,3.20681 3.2068,3.20681 1.77909,0 3.20679,-1.42681 3.20679,-3.20681 v -12.8267 z m 12.82687,0 v 12.8267 c 0,1.77967 1.42681,3.20681 3.20677,3.20681 1.77909,0 3.20679,-1.42681 3.20679,-3.20681 v -12.8267 z m 12.82654,0 v 12.8267 c 0,1.77967 1.42683,3.20681 3.20679,3.20681 1.77909,0 3.20679,-1.42681 3.20679,-3.20681 v -12.8267 z m 12.82686,0 v 12.8267 c 0,1.77967 1.42681,3.20681 3.20678,3.20681 1.77909,0 3.20679,-1.42681 3.20679,-3.20681 v -12.8267 z m 12.82654,0 v 12.8267 c 0,1.77967 1.42683,3.20681 3.20708,3.20681 1.77909,0 3.20679,-1.42681 3.20679,-3.20681 v -12.8267 z m 0,0" /> + <path + style="fill:#3d3846;stroke-width:3.20667" + inkscape:connector-curvature="0" + id="path4980" + d="m 480.17224,50.999964 h 76.96021 a 9.6200357,9.6200357 0 0 1 9.62006,9.620094 v 54.513502 a 9.6200357,9.6200357 0 0 1 -9.62006,9.62006 h -76.96021 a 9.6200357,9.6200357 0 0 1 -9.62007,-9.62006 V 60.620058 a 9.6200357,9.6200357 0 0 1 9.62007,-9.620094 z m 0,0" /> + <path + style="fill:#262e36;fill-opacity:1;stroke-width:3.20667" + inkscape:connector-curvature="0" + id="path4988" + d="m 480.17224,41.379989 h 76.96021 a 9.6200357,9.6200357 0 0 1 9.62006,9.619975 v 57.720266 a 9.6200357,9.6200357 0 0 1 -9.62006,9.62003 h -76.96021 a 9.6200357,9.6200357 0 0 1 -9.62007,-9.62003 V 50.999964 a 9.6200357,9.6200357 0 0 1 9.62007,-9.619975 z m 0,0" /> + <path + d="m 453.74142,45.031249 v -1.41652 c 0,-13.22156 10.646,-23.86202 23.86745,-23.86202 h 82.08634 c 13.22156,0 23.86745,10.64046 23.86745,23.86202 v 1.41652 c 0,-13.22145 -10.64589,-23.86745 -23.86745,-23.86745 h -82.08634 c -13.22145,0 -23.86745,10.646 -23.86745,23.86745 z" + inkscape:label="Square-Top-Highlight" + style="display:inline;opacity:0.2;fill:#ffffff;fill-opacity:1;stroke-width:3.36313" + id="path24842" + inkscape:connector-curvature="0" /> + <path + id="path24840" + style="display:inline;opacity:0.2;fill:#000000;fill-opacity:1;stroke-width:3.36313" + inkscape:label="Square-Bottom-Highlight" + d="m 453.74142,124.29638 v 1.41663 c 0,13.22156 10.646,23.86191 23.86745,23.86191 h 82.08634 c 13.22156,0 23.86745,-10.64035 23.86745,-23.86191 v -1.41663 c 0,13.22156 -10.64589,23.86745 -23.86745,23.86745 h -82.08634 c -13.22145,0 -23.86745,-10.64589 -23.86745,-23.86745 z" + inkscape:connector-curvature="0" /> + <g + id="g237" + transform="matrix(0.50144561,0,0,0.50144561,469.36615,53.401791)" + style="fill:#d9d5d1;fill-opacity:1;stroke:url(#linearGradient1470)"> + <path + d="M 148.419,40.725 C 137.843,34.44 134.762,36.625 125.266,29.054 110.441,17.237 92.488,3.794 74.861,0 c 0,0 4.307,3.492 12.283,9.822 0.559,0.465 0.705,0.684 0.595,0.867 -0.169,0.287 -0.928,-0.046 -0.928,-0.046 -6.163,-2.345 -13.123,-3.675 -17.839,-3.37 -1.561,0.1 -2.061,0.352 -2.283,0.797 -0.104,0.209 -0.119,0.772 0.405,1.469 2.061,2.725 7.024,8.064 15.281,13.132 8.486,5.206 23.472,12.592 36.726,18.489 5.932,2.638 10.207,6.164 8.846,10.232 -1.52,4.533 -7.387,5.15 -12.074,3.275 C 112.065,53.144 108.506,48.37 102.725,41.966 92.709,30.868 87.956,26.441 71.335,29.825 63.003,31.522 55.141,38.341 48.853,45.538 44.657,50.83 42.64,55.232 42.032,60.54 c 0,0 -1.146,-2.105 -0.008,-7.49 1.989,-9.407 -2.341,-13.447 -2.341,-13.447 -21.925,31.092 9.261,59.202 33.301,32.281 0,0 -7.865,17.467 -7.21,22.906 -3.355,1.1 -4.845,4.186 0.176,7.91 5.486,4.068 18.961,3.716 29.59,-0.852 19.845,-8.529 32.213,-24.423 38.344,-34.516 1.432,-2.36 2.947,-3.508 3.996,-3.883 1.591,-0.574 12.537,0.086 17.662,-2.824 0.713,0.347 1.621,0.533 2.817,0.442 3.714,-0.282 5.976,-4.727 5.976,-4.727 0,0 -4.687,-8.941 -15.916,-15.615 z m -41.142,44.652 c -10.166,7.24 -21.192,9.26 -28.008,6.262 10.782,-7.818 30.624,-27.373 30.624,-27.373 0,0 -3.302,-8.318 -9.257,-3.225 -5.76,4.925 -11.081,11.078 -13.184,13.043 -1.301,1.213 -3.508,3.506 -4.812,2.52 -1.587,-1.199 3.137,-11.825 6.749,-20.631 4.928,-12.01 -0.742,-15.762 -7.379,-15.429 -5.947,0.299 -14.071,3.903 -19.891,7.462 -1.648,1.009 -2.773,1.629 -3.189,1.244 -0.364,-0.339 0.021,-0.977 1.102,-1.89 15.471,-13.108 37.549,-12.767 39.523,-3.175 1.571,7.65 -14.771,26.914 -13.697,27.223 0.104,0.029 0.338,-0.088 0.68,-0.322 5.364,-7.021 15.521,-17.801 19.331,-17.384 6.827,0.746 9.183,9.794 9.183,9.794 L 92.291,84.034 c 4.701,1.277 9.842,1.738 14.986,1.343 z" + id="path235" + style="fill:#d9d5d1;fill-opacity:1;stroke:url(#linearGradient1500)" /> + </g> + </g> + </g> +</svg> diff --git a/util/coreboot-configurator/src/static/meson.build b/util/coreboot-configurator/src/static/meson.build new file mode 100644 index 0000000..740334e5 --- /dev/null +++ b/util/coreboot-configurator/src/static/meson.build @@ -0,0 +1,47 @@ + +# About Icon +about_icon_dir = join_paths(get_option('datadir'), meson.project_name()) +about_icon_sources = [ + 'aboutIcon.png', +] +install_data(about_icon_sources, + install_dir: about_icon_dir) + +# Polkit Files +polkit_dir = join_paths(get_option('datadir'), 'polkit-1', 'actions') +polkit_sources = [ + 'org.jagoli.nvramtool.policy', + 'org.jagoli.reboot.policy', +] +install_data(polkit_sources, + install_dir: polkit_dir) + +# Desktop Entry +desktop_dir = join_paths(get_option('datadir'), 'applications') +desktop_sources = [ + 'coreboot-configurator.desktop', +] +install_data(desktop_sources, + install_dir: desktop_dir) + +# Icon +inkscape = find_program('inkscape') +icon_dir = join_paths(get_option('datadir'),'icons', 'hicolor') +foreach size: get_option('sizes') + target_temp_name = '@0@'.format(size) + dpi=size.to_int() * 2 + png = configure_file( + input: 'coreboot_configurator.svg', + output: target_temp_name + '.png', + command: [ + inkscape, + '--export-dpi=@0@'.format(dpi), + '--export-png=@OUTPUT@', + '@INPUT@', + ] + ) + install_data(png, + rename: meson.project_name() + '.png', + install_dir: join_paths(icon_dir, '@0@x@1@'.format(size, size), 'apps')) +endforeach + diff --git a/util/coreboot-configurator/src/static/org.jagoli.nvramtool.policy b/util/coreboot-configurator/src/static/org.jagoli.nvramtool.policy new file mode 100644 index 0000000..458e63e --- /dev/null +++ b/util/coreboot-configurator/src/static/org.jagoli.nvramtool.policy @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE policyconfig PUBLIC + "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" + "http://www.freedesktop.org/software/polkit/policyconfig-1.dtd"> +<policyconfig> + + <action id="org.jagoli.nvramtool"> + <message>Authentication is required to read and write to coreboot settings.</message> + <defaults> + <allow_active>auth_admin_keep</allow_active> + </defaults> + <annotate key="org.freedesktop.policykit.exec.path">/usr/sbin/nvramtool</annotate> + </action> + +</policyconfig> diff --git a/util/coreboot-configurator/src/static/org.jagoli.reboot.policy b/util/coreboot-configurator/src/static/org.jagoli.reboot.policy new file mode 100644 index 0000000..202efb1 --- /dev/null +++ b/util/coreboot-configurator/src/static/org.jagoli.reboot.policy @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE policyconfig PUBLIC + "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" + "http://www.freedesktop.org/software/polkit/policyconfig-1.dtd"> +<policyconfig> + + <action id="org.jagoli.reboot"> + <defaults> + <allow_active>yes</allow_active> + </defaults> + <annotate key="org.freedesktop.policykit.exec.path">/usr/sbin/reboot</annotate> + </action> + +</policyconfig>