From f4ce6098213b305e38c52d4944a01bcca1ae0f92 Mon Sep 17 00:00:00 2001 From: xdavidwu Date: Tue, 20 Oct 2020 10:51:20 +0800 Subject: [PATCH] bash: add psave --- .bashrc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.bashrc b/.bashrc index 81bede9..f1a89c3 100644 --- a/.bashrc +++ b/.bashrc @@ -92,6 +92,19 @@ play-playlist() { mpv --ytdl-raw-options=audio-format=best --no-video $ARGS } +psave() { + if [ "$1" = "perf" ];then + echo powersave perfomance + echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/energy_performance_preference >/dev/null + elif [ "$1" = "off" ];then + echo powersave off + echo balance_performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/energy_performance_preference >/dev/null + else + echo powersave on + echo power | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/energy_performance_preference >/dev/null + fi +} + # application envs # policy: should here even if global like /etc/environments export GPG_TTY=$(tty) -- 2.45.2