-
Notifications
You must be signed in to change notification settings - Fork 4
/
power.sh
executable file
·56 lines (45 loc) · 1.91 KB
/
power.sh
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
#!/usr/bin/bash
# Defining the shell path and global variables
SHELL_PATH=$(readlink -f $0 | xargs dirname)
source ${SHELL_PATH}/config/profile
source ${SHELL_PATH}/bin/global.sh
info "Installing and Enabling CPUpower & fstrim."
sudo pacman --noconfirm -S cpupower
sudo cpupower frequency-set -g powersave
sudo sh -c "echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo"
sudo systemctl enable cpupower
sudo systemctl start cpupower
sudo systemctl enable fstrim.timer
sudo systemctl start fstrim.timer
info "TLP"
sudo pacman --noconfirm -S tlp tlp-rdw smartmontools ethtool lm_sensors
sudo systemctl enable tlp
sudo systemctl start tlp
sudo sensors-detect
sudo sensors
info "Enabling Power Management with laptop-mode-tools"
sudo pacman --noconfirm -S acpid acpi acpi_call
sudo systemctl enable acpid.service
sudo systemctl start acpid.service
info "Installing Thermald"
pikaur --noconfirm -S thermald
sudo systemctl enable thermald
sudo systemctl start thermald
info "Enabling fans for the Macbook Pro"
pikaur --noconfirm -S mbpfan-git
sudo cp ${SHELL_PATH}/config/etc/mbpfan.conf /etc/
sudo systemctl enable mbpfan
sudo systemctl start mbpfan
info "Enabling Powertop"
sudo pacman --noconfirm -S powertop
sudo cp ${SHELL_PATH}/config/services/powertop.service /etc/systemd/system/
sudo systemctl enable powertop.service
sudo systemctl start powertop.service
sudo sh -c "echo 'med_power_with_dipm' > /sys/class/scsi_host/host0/link_power_management_policy"
sudo sh -c "echo 1 > /sys/module/snd_hda_intel/parameters/power_save"
sudo sh -c "echo '1500' > /proc/sys/vm/dirty_writeback_centisecs"
sudo sh -c "echo 'auto' > /sys/bus/usb/devices/1-12/power/control"
sudo sh -c "echo 'auto' > /sys/bus/usb/devices/2-4/power/control"
sudo sh -c "echo 'enabled' > /sys/bus/usb/devices/usb1/power/wakeup"
sudo sh -c "echo 'enabled' > /sys/bus/usb/devices/2-4/power/wakeup"
sudo sh -c "echo 'enabled' > /sys/bus/usb/devices/usb2/power/wakeup"