From 05fd326f62c9b62874dfb74b32abd3e64614ccbe Mon Sep 17 00:00:00 2001 From: Ward from fusion-voyager-3 Date: Thu, 20 Jun 2024 00:12:17 +0300 Subject: [PATCH] some scx impl --- data/scripts/change_scx.sh | 10 +++++ data/scripts/core | Bin 10530816 -> 10530816 bytes data/scripts/get_version.sh | 0 data/scripts/kernel-cachyos-init.sh | 0 data/scripts/modify_package.sh | 0 src/build_ui/mod.rs | 2 +- src/kernel_pkg/mod.rs | 2 +- src/sched_ext/mod.rs | 65 +++++++++++++++++++++++++--- 8 files changed, 71 insertions(+), 8 deletions(-) create mode 100755 data/scripts/change_scx.sh mode change 100644 => 100755 data/scripts/get_version.sh mode change 100644 => 100755 data/scripts/kernel-cachyos-init.sh mode change 100644 => 100755 data/scripts/modify_package.sh diff --git a/data/scripts/change_scx.sh b/data/scripts/change_scx.sh new file mode 100755 index 0000000..fa5f351 --- /dev/null +++ b/data/scripts/change_scx.sh @@ -0,0 +1,10 @@ +#! /bin/bash + +if [[ "$1" == "scx_disabled" ]]; then + systemctl stop scx & systemctl disable scx +else + set -e + sed -i 's/SCX_SCHEDULER=.*/SCX_SCHEDULER="$1"/' /etc/default/scx + systemctl enable --now scx + systemctl restart scx +fi \ No newline at end of file diff --git a/data/scripts/core b/data/scripts/core index 7db5efa07db1c9e4702d54ec1f0f57f7b49c4449..d599a76af67097d6b6476ddafddd5bd43714fea3 100644 GIT binary patch delta 16535 zcmeHOdwf$>wmwOk5}<|97NpW*%0r3-j8YH~ofKa4zV-q9HtaST4j4$5yjgI;m2!d-jsZ?~KHm_P47H^1M? zx4*U5TKjqSIoW3?n0nA2B#B;Pu|-;}^(B_4?B1tGU;hA0eC^9!ziYFDq{|v>FMAo+ z*7vcFw3|&lbt9#`Te;-|_q<#de|4s#{;0KkeX}*&?)#3uuOrBHhGDQB@6?`G@3iIH zQ`>l)5w?-`vII|6P|DoTBd(q@FSkBFGdCxb91QOU{%sg3k#}xs-`KM4#v9zbN5)8d zt4Li-DI>|_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&t5F|HN&1+{2EErru?-{k`3)dY(*^n5;rVN zmgS#MdO~9f<3yF%onL){-32rYyk#dLe%WfjPjlV;t>i#14A{))w1Xlq%ThFM14@3!Q*#9sbI zy78D`zS50Z{pkpDqo-UY=9!FX8SdL;mkU+&S(9lr4nVbUIPc?q#-^tm&i~)N`hUB76+U*2;J$TQ zD7ps=^vu@V_=^=UQ%YI>k(;uZ&1MwR(Zt*~W0V^YEjrmz01dV{@$))e&bY8(7-H^) zarfAa#r_`&MZ2Zs3Ir!Y+&#s2`txY?J%OuMo@eFN5fuDZ9-O}E^0d}5PG0SsQO|wv z0iq8BSaXJP>E%DNpi!kil|(e9k1s}h&|KKC>(*C$y;kLTx*PR`*{nr$O@@vMwa2o_{9NnDJ;K8 zW(AqX!x^-=@qV$gk9SutWVu5aO%?&cYY{Y!TiHI{0DdIIK_gy9Zrc3l|ccG#I zG4mm5a53VIh}#hV6Y(hGdBpOErQfd+YY}6JZHUJZ&8xXRoO`kaqiIcu`w;(zXjvlz z4@I1acm?9^h$|7Z9+CFL5vL-~L|lScD-aTBLdAB(IO4mArx5>+XvOctM@(~`Zr&mv)KcT;+$%n<@5nu&7_IHoLIyk$Sk)+H(h2_)ch|j CMf0Tq diff --git a/data/scripts/get_version.sh b/data/scripts/get_version.sh old mode 100644 new mode 100755 diff --git a/data/scripts/kernel-cachyos-init.sh b/data/scripts/kernel-cachyos-init.sh old mode 100644 new mode 100755 diff --git a/data/scripts/modify_package.sh b/data/scripts/modify_package.sh old mode 100644 new mode 100755 diff --git a/src/build_ui/mod.rs b/src/build_ui/mod.rs index a31782b..2571811 100644 --- a/src/build_ui/mod.rs +++ b/src/build_ui/mod.rs @@ -86,7 +86,7 @@ pub fn build_ui(app: &adw::Application) { Some("content_page"), ); content_stack.add_named( - &sched_ext::sched_ext_page(&content_stack), + &sched_ext::sched_ext_page(&content_stack, &window), Some("sched_ext_page"), ); diff --git a/src/kernel_pkg/mod.rs b/src/kernel_pkg/mod.rs index 588c5b7..f547457 100644 --- a/src/kernel_pkg/mod.rs +++ b/src/kernel_pkg/mod.rs @@ -463,7 +463,7 @@ fn get_cpu_feature_level() -> String { .trim_end_matches("(supported, searched)") .trim() .to_string(), - _ => "x86_64-v1".to_string(), + _ => "x86-64-v1".to_string(), }; result } diff --git a/src/sched_ext/mod.rs b/src/sched_ext/mod.rs index 10b7b81..c4ff683 100644 --- a/src/sched_ext/mod.rs +++ b/src/sched_ext/mod.rs @@ -4,10 +4,13 @@ use adw::prelude::*; use glib::*; use gtk::prelude::*; use gtk::*; -use std::fs; +use std::{fs, io}; use std::fs::*; +use std::process::Stdio; +use duct::cmd; +use gtk::AccessibleRole::Command; -pub fn sched_ext_page(content_stack: >k::Stack) -> gtk::Box { +pub fn sched_ext_page(content_stack: >k::Stack, window: &adw::ApplicationWindow,) -> gtk::Box { let main_box = gtk::Box::builder() .hexpand(true) .vexpand(true) @@ -60,7 +63,12 @@ pub fn sched_ext_page(content_stack: >k::Stack) -> gtk::Box { .subtitle("Select Sched-EXT Scheduler") .build(); - scx_sched_expander_row.add_row(&scx_sched_expandable(&scx_sched_expander_row)); + scx_sched_expander_row.add_row(&scx_sched_expandable(&scx_sched_expander_row, + &window, + &badge_box, + &kernel_badges_size_group, + &kernel_badges_size_group0, + &kernel_badges_size_group1,)); let scx_sched_expander_row_boxedlist = gtk::ListBox::builder() .selection_mode(SelectionMode::None) @@ -147,7 +155,13 @@ fn create_current_sched_badge( )); } -fn scx_sched_expandable(expander_row: &adw::ExpanderRow) -> gtk::ListBox { +fn scx_sched_expandable(expander_row: &adw::ExpanderRow, + window: &adw::ApplicationWindow, + badge_box: >k::Box, + kernel_badges_size_group: >k::SizeGroup, + kernel_badges_size_group0: >k::SizeGroup, + kernel_badges_size_group1: >k::SizeGroup, +) -> gtk::ListBox { let searchbar = gtk::SearchEntry::builder().search_delay(500).build(); searchbar.add_css_class("round-border-only-top"); @@ -181,15 +195,38 @@ fn scx_sched_expandable(expander_row: &adw::ExpanderRow) -> gtk::ListBox { .build(); let branch_row = adw::ActionRow::builder() .activatable_widget(&sched_checkbutton) - .title(sched) + .title(&sched) .build(); branch_row.add_prefix(&sched_checkbutton); sched_checkbutton.set_group(Some(&null_checkbutton)); sched_container.append(&branch_row); + let cmd_status_dialog = adw::MessageDialog::builder() + .transient_for(window) + .hide_on_close(true) + .build(); + cmd_status_dialog.add_response( + "cmd_status_dialog_ok", + "Ok", + ); sched_checkbutton.connect_toggled( - clone!(@weak sched_checkbutton, @weak expander_row => move |_| { + clone!(@weak sched_checkbutton, @weak expander_row, @weak badge_box, @strong get_running_kernel_info, @weak kernel_badges_size_group, @weak kernel_badges_size_group0, @weak kernel_badges_size_group1 => move |_| { if sched_checkbutton.is_active() == true { expander_row.set_title(&branch_row.title()); + match change_scx_scheduler(&sched, &badge_box, + &kernel_badges_size_group, + &kernel_badges_size_group0, + &kernel_badges_size_group1,) { + Ok(_) => { + cmd_status_dialog.set_heading(Some("Success!")); + cmd_status_dialog.set_body(format!("SCX has been set to: {}", &sched).as_str()); + cmd_status_dialog.present() + } + Err(_) => { + cmd_status_dialog.set_heading(Some("Failed!")); + cmd_status_dialog.set_body(format!("SCX couldn't be has been set to: {}", &sched).as_str()); + cmd_status_dialog.present() + } + }; } }), ); @@ -241,3 +278,19 @@ fn get_current_scx_scheduler() -> String { scx_sched } + +fn change_scx_scheduler(scx_sched: &str, + badge_box: >k::Box, + kernel_badges_size_group: >k::SizeGroup, + kernel_badges_size_group0: >k::SizeGroup, + kernel_badges_size_group1: >k::SizeGroup,) -> Result<(), io::Error> { + cmd!("pkexec", "bash", "-c", format!("/home/ward/RustroverProjects/fedora-kernel-manager/data/scripts/change_scx.sh {}", scx_sched)).run()?; + create_current_sched_badge( + &badge_box, + &get_running_kernel_info(), + &kernel_badges_size_group, + &kernel_badges_size_group0, + &kernel_badges_size_group1, + ); + Ok(()) +}