Laptop control, udev rules, xorg configs, README
This commit is contained in:
28
bin/power_saving_mode
Normal file
28
bin/power_saving_mode
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Run as sudo
|
||||
[ "$UID" -eq 0 ] || exec sudo "$0" "$@"
|
||||
|
||||
if [ "$1" == "on" ]
|
||||
then
|
||||
for file in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor;
|
||||
do
|
||||
echo "powersave" > $file;
|
||||
done
|
||||
xrandr --output DP-4 --mode 2560x1600 --rate 60 > /dev/null 2>&1
|
||||
xrandr --output eDP-1 --mode 2560x1600 --rate 60 > /dev/null 2>&1
|
||||
for i in {1..3}; do brightness_down; done
|
||||
echo "Power Saving Mode is now active"
|
||||
elif [ "$1" == "off" ]
|
||||
then
|
||||
for file in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor;
|
||||
do
|
||||
echo "schedutil" > $file;
|
||||
done
|
||||
xrandr --output DP-4 --mode 2560x1600 --rate 165 > /dev/null 2>&1
|
||||
xrandr --output eDP-1 --mode 2560x1600 --rate 165 > /dev/null 2>&1
|
||||
for i in {1..3}; do brightness_up; done
|
||||
echo "Power Saving Mode is now inactive"
|
||||
else
|
||||
echo "Usage: power_saving_mode [on/off]"
|
||||
fi
|
Reference in New Issue
Block a user