Last active
March 24, 2021 15:15
-
-
Save shunirr/7510857 to your computer and use it in GitHub Desktop.
VAIO Pro に Ubuntu を入れた時の省電力設定
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
exit false unless %{ondemand powersave performance}.index(ARGV[0]) | |
(0..3).each do |i| | |
system "sudo su -c 'echo #{ARGV[0]} > /sys/devices/system/cpu/cpu#{i}/cpufreq/scaling_governor'" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# USB の自動サスペンド | |
for i in /sys/bus/usb/devices/usb*; do | |
sudo sh -c "echo 1 > $i/power/autosuspend" | |
done | |
# WiFi の省電力設定 | |
sudo iw dev wlan0 set power_save on | |
# サウンドまわりの省電力設定 | |
sudo sh -c "echo 1 > /sys/module/snd_hda_intel/parameters/power_save" | |
sudo sh -c "echo 1 > /dev/dsp" | |
# laptop mode | |
sudo sh -c "echo 5 > /proc/sys/vm/laptop_mode" | |
sudo sh -c "echo 0 > /proc/sys/kernel/nmi_watchdog" | |
sudo sh -c "echo 1500 > /proc/sys/vm/dirty_writeback_centisecs" | |
sudo modprobe -r sky2 | |
# PCI 経由で繋がってるものの省電力設定 | |
for i in /sys/bus/pci/devices/*; do | |
sudo sh -c "echo 'auto' > $i/power/control" | |
done | |
# SSD が稼動してない時に SATA を最低消費電力モードにする設定 | |
for i in /sys/class/scsi_host/host*; do | |
sudo sh -c "echo 'min_power' > $i/link_power_management_policy" | |
done | |
# CPU 動作モードの変更 (cpufreq は自分で作ったもの) | |
cpufreq powersave | |
# ディスプレイ輝度の変更 | |
# xbacklight は apt-get install xbacklight で入る | |
xbacklight -set 60 | |
# キーボードバックライトの無効化 | |
sudo sh -c "echo '0' > /sys/devices/platform/sony-laptop/kbd_backlight" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://ssig33.com/text/VAIO%20Pro%20%E3%82%92%20Linux%20%E3%81%A7
これを参考にしてますがイチイチ全部指定してたのを for で全部指定するように直しました。