Skip to content

Commit

Permalink
fix conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
wh1t3h47 committed Jul 10, 2021
2 parents 30cdb48 + abc2088 commit 13ec81a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
# CPU Powersave
> A small bash utility to scale down or up CPU power consumption
> Pequena utilidade escrita em bash para aumentar ou diminuir o consumo de energia da CPU
## Features
1. Automatically detects if charger is plugged and acts accordingly to the context;
2. Set your own limits for maximium clock, core count and governor;
3. Control your CPU whenever a power source change and automatically apply the `battery` or `AC` profile.

## WARNINGS:
1. This script runs as **root**, so make sure it's owned by user and group root and it's not writable by any other user, otherwise you're installing a tick bomb inside your system;
2. Do **NEVER** set a script with suid bit: If your shell script has suid priviledge, it's a backdoor waiting to be exploited, any user could gain root without password.

## Dependencies:
- cpufreq
- cpufreqd
- lscpu
- Linux

## TODO
- [x] 1. Make disable_pstate a parameter
- [x] 2. Respect max pstate clock as well
- [ ] 3. Find a better solution to detect max clock speed
- [x] 3. Find a better solution to detect max clock speed
- [ ] 4. Implement systemd service
- [x] 5. Make governor a parameter
- [ ] 6. modprobe all governors
Expand Down
16 changes: 15 additions & 1 deletion startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@ AC_DISABLE_CORES=false
AC_SET_FREQ=false
num_cores=2
freq=1000
min_freq=false
disable_turbo=1
governor=false
debug=false
# TODO: Parametrize
disable_bluetooth=true

while getopts "h?m:j:c:" opt; do
while getopts "h?m:j:c:d:g:tv" opt; do
case "$opt" in
h|\?)
show_help
Expand Down Expand Up @@ -155,3 +161,11 @@ then
done
fi

################################################
# Disable bluetooth #

if [ ${disable_bluetooth} == true ]
then
systemctl stop bluetooth
fi

0 comments on commit 13ec81a

Please sign in to comment.