🧹 remove performance menu with functions its using

This commit is contained in:
Vladislav Nepogodin 2024-07-04 11:03:26 +04:00
parent 41a7a895aa
commit bb43ad5def
No known key found for this signature in database
GPG Key ID: B62C3D10C54D5DA9
3 changed files with 0 additions and 71 deletions

View File

@ -780,40 +780,9 @@ void enable_autologin() {
utils::enable_autologin(dm, autologin_user);
}
void performance_menu() {
const std::vector<std::string> menu_entries = {
"I/O Schedulers",
"Swap Configuration",
"Back",
};
auto screen = ScreenInteractive::Fullscreen();
std::int32_t selected{};
auto ok_callback = [&] {
switch (selected) {
case 0:
screen.Suspend();
utils::set_schedulers();
screen.Resume();
break;
case 1:
screen.Suspend();
utils::set_swappiness();
screen.Resume();
break;
default:
screen.ExitLoopClosure()();
break;
}
};
static constexpr auto tweaks_body = "Various configuration options"sv;
detail::menu_widget(menu_entries, ok_callback, &selected, &screen, tweaks_body, {.text_size = size(HEIGHT, GREATER_THAN, 1)});
}
void tweaks_menu() noexcept {
const std::vector<std::string> menu_entries = {
"Enable Automatic Login",
"Performance",
"Back",
};
@ -824,9 +793,6 @@ void tweaks_menu() noexcept {
case 0:
tui::enable_autologin();
break;
case 1:
tui::performance_menu();
break;
default:
screen.ExitLoopClosure()();
break;

View File

@ -1770,41 +1770,6 @@ void enable_autologin([[maybe_unused]] const std::string_view& dm, [[maybe_unuse
#endif
}
void set_schedulers() noexcept {
#ifdef NDEVENV
static constexpr auto rules_path = "/mnt/etc/udev/rules.d/60-ioscheduler.rules";
if (!fs::exists(rules_path)) {
static constexpr auto ioscheduler_rules = R"(# set scheduler for NVMe
ACTION=="add|change", KERNEL=="nvme[0-9]n[0-9]", ATTR{queue/scheduler}="none"
# set scheduler for SSD and eMMC
ACTION=="add|change", KERNEL=="sd[a-z]|mmcblk[0-9]*", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="mq-deadline"
# set scheduler for rotating disks
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="bfq")";
std::ofstream rules{rules_path};
rules << ioscheduler_rules;
}
gucc::utils::exec("vim /mnt/etc/udev/rules.d/60-ioscheduler.rules", true);
#else
gucc::utils::exec("vim /etc/udev/rules.d/60-ioscheduler.rules", true);
#endif
}
void set_swappiness() noexcept {
#ifdef NDEVENV
static constexpr auto rules_path = "/mnt/etc/sysctl.d/99-sysctl.conf";
if (!fs::exists(rules_path)) {
static constexpr auto sysctl_rules = R"(vm.swappiness = 10
vm.vfs_cache_pressure = 50
#vm.dirty_ratio = 3)";
std::ofstream rules{rules_path};
rules << sysctl_rules;
}
gucc::utils::exec("vim /mnt/etc/sysctl.d/99-sysctl.conf", true);
#else
gucc::utils::exec("vim /etc/sysctl.d/99-sysctl.conf", true);
#endif
}
bool parse_config() noexcept {
using namespace rapidjson;

View File

@ -66,8 +66,6 @@ void show_iwctl() noexcept;
void set_keymap() noexcept;
void enable_autologin(const std::string_view& dm, const std::string_view& user) noexcept;
void set_schedulers() noexcept;
void set_swappiness() noexcept;
bool parse_config() noexcept;
void setup_luks_keyfile() noexcept;
void grub_mkconfig() noexcept;