-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpdefaults.sh
More file actions
executable file
·84 lines (80 loc) · 2.41 KB
/
Copy pathpdefaults.sh
File metadata and controls
executable file
·84 lines (80 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/bash
# name: pdefaults
# version: 1.0
# description: pdefaults_desc
# icon: optimizer.svg
# compat: ubuntu, debian, fedora, suse, arch, cachy, rhel, !zorin, !deepin
# reboot: yes
# noconfirm: yes
# nocontainer
# systemd: yes
# --- Start of the script code ---
source "$SCRIPT_DIR/libs/optimizers.lib"
_lang_
# system-agnostic scripts
sysag_run () {
if ! is_cachy && ! is_zorin; then
# systemd patches
cachyos_sysd_lib
fi
# shader booster
sboost_lib
# disable split-lock mitigation, which is not a security feature therefore is safe to disable
dsplitm_lib
# add earlyoom configuration, Fedora already has systemd-oomd
if ! is_fedora && ! is_ostree && ! is_rhel && ! is_zorin; then
earlyoom_lib
fi
# change intel driver to Xe on discrete GPUs
if ! is_fedora && ! is_ubuntu && ! is_rhel; then
intel_xe_lib
fi
# fix GTK app rendering for Intel BMG and Nvidia GPUs
fix_intel_gtk
# add alive timeout fix for Gnome
if echo "$XDG_CURRENT_DESKTOP" | grep -qi 'gnome'; then
sudo gsettings set org.gnome.mutter check-alive-timeout 20000
fi
# vm.min_free_kbytes dynamic setup - disabled for further testing
# free_mem_fix
# full kernel preemption for better latency in Fedora -- will skip automatically in other OS
preempt_lib
}
# consolidated installation
optimizer () {
if [ ! -f $HOME/.local/.autopatch.state ]; then
prep_tmp
sysag_run
touch "$HOME/.local/.autopatch.state"
zeninf "$msg036"
else
zenwrn "$msg234"
exit 100
fi
}
# menu
while true; do
OPTIONS=("Install without Power Profile")
if ! is_zorin && ! is_cachy && ! is_suse; then
OPTIONS+=("Laptop")
fi
CPU_VENDOR=$(grep -m1 'vendor_id' /proc/cpuinfo | awk '{print $3}')
if [[ "$CPU_VENDOR" == "AuthenticAMD" ]]; then
OPTIONS+=("High Performance")
fi
OPTIONS+=("$msg070")
CHOICE=$(zenity --list --title "Power Optimizer" --text "$msg229" \
--column "Options" \
"${OPTIONS[@]}" \
--width 360 --height 360 )
if [ $? -ne 0 ]; then
exit 100
fi
case $CHOICE in
"Install without Power Profile" ) sudo_rq && optimizer && exit 0;;
"High Performance") sudo_rq && pp_ondemand && optimizer && exit 0;;
"Laptop") sudo_rq && optimizer && psave_lib && exit 0;;
"$msg070") exit 100 ;;
*) echo "Invalid Option" ;;
esac
done