Update 'scripts/README.md'

This commit is contained in:
Quad 2021-05-21 11:25:59 +02:00
parent d4a5fd33f5
commit 4e5f064e88
1 changed files with 46 additions and 25 deletions

View File

@ -4,27 +4,41 @@ A collection of scripts for the GPD Win 3. Mostly to minimize the reuqired typin
To install scripts, copy them somewhere on your Win 3, then add them to your path. This is done by adding a line to the end of `~/.bashrc` To install scripts, copy them somewhere on your Win 3, then add them to your path. This is done by adding a line to the end of `~/.bashrc`
## Quickstart ### Quick install
To quickly install the scripts, make sure `git` is installed and run this in a terminal: To quickly install the scripts, paste this block into a terminal on your GPD Win 3:
```bash ```bash
if [ -z $(which git 2>/dev/null) ]; then
printf "\n$(tput setaf 1)-- We didn't find git! Is it installed? --$(tput sgr0)\n\n"
printf "On Ubuntu and similar distros, git can be installed with the following command:\n"
printf " $(tput setaf 2)sudo apt install git$(tput sgr0)\n\n"
printf "Please try again after installing git.\n\n"
else
printf "$(tput setaf 2)-- Installing scripts --$(tput sgr0)\n"
mkdir -p ~/.local mkdir -p ~/.local
git clone https://gitea.quad.moe/quad/win3-resources.git ~/.local/gpd-win3 git clone https://gitea.quad.moe/quad/win3-resources.git ~/.local/gpd-win3
echo -e "\n# GPD Win 3 scripts\nPATH=\"\${PATH}:\${HOME}/.local/gpd-win3/scripts\"" >> ~/.bashrc echo -e "\n# GPD Win 3 scripts\nPATH=\"\${PATH}:\${HOME}/.local/gpd-win3/scripts\"" >> ~/.bashrc
# This last line is optional. It displays your TDP every time you open a terminal
echo "tdp check" >> ~/.bashrc echo "tdp check" >> ~/.bashrc
printf "$(tput setaf 2)-- Install finished. Please open a new terminal to use the scripts --$(tput sgr0)\n"
fi
``` ```
Then restart your terminal. Run `tdp check` to test if it's working. It should report back current TDP. To update, run:
```bash
cd ~/.local/gpd-win3 && git pull && cd -
```
### Manual install
- Clone the repository somewhere
- Ensure the scripts folder is in your PATH
- (Optional) add `tdp check` to your .bashrc, which will display TDP every time you open a terminal
## TDP ## TDP
Lets you set the TDP using `intel_rapl`. Tested on Ubuntu 21.04. Lets you set the TDP using `intel_rapl`.
Also supports shortened commands for minimal typing on the mediocre keyboard.
PL1 is set to number provided, PL2 is set 2W higher, maybe PL2 will be customizable in the future.
You will have to enter your sudo password when changing TDP.
Common TDPs are: Common TDPs are:
- 8W (Ultra-low power, mostly just 2D games) - 8W (Ultra-low power, mostly just 2D games)
@ -33,44 +47,51 @@ Common TDPs are:
- 20W (High perf) - 20W (High perf)
- 30W (Max perf) - 30W (Max perf)
By default, PL2 (short-term peak) will be 2W higher than PL1.
For details on how to use, run `tdp help`. For details on how to use, run `tdp help`.
Common examples: Example commands:
```bash ```bash
# Check current TDP # Print help
tdp help
# Check TDP
tdp check tdp check
tdp c
# Set TDP to 8W # Set TDP to 8W
tdp set 8 tdp set 8
# Set TDP to 8W (Shortened)
tdp s 8 tdp s 8
# Set both PL1 and PL2 to 15W
tdp set 15 --same --detail
tdp s 15 -s -d
# Check both PL1 and PL2 # Check both PL1 and PL2
tdp check --detail tdp check --detail
# Check both PL1 and PL2 (Shortened)
tdp c -d tdp c -d
``` ```
*Protip:* Add `tdp check` to the end of your `.bashrc` file. Then your terminal will display the TDP every time it's opened, without needing to run any command.
### Setting TDP at boot ### Setting TDP at boot
Copy `tdp-set.service` into `/etc/systemd/system/` Install the service using the following command: `cp ~/.local/gpd-win3/scripts/tdp-set.service /etc/systemd/system/`
Edit `/etc/systemd/system/tdp-set.service` and change the `ExecStart=` line so it points to your tdp script, and type in your preferred wattage at the end. Run `nano /etc/systemd/system/tdp-set.service` and edit the `ExecStart=` line so it points to the correct place and enter the TDP you want at the end:
```
ExecStart=/home/<username>/.local/gpd-win3/scripts/tdp set 12
```
Enable the service: Enable the service:
``` ```bash
sudo systemctl deamon-reload sudo systemctl deamon-reload
sudo systemctl enable tdp-set.service sudo systemctl enable tdp-set.service
``` ```
Reboot your Win 3, then run `tdp check` to verify that TDP was set correctly. Reboot your Win 3, then run `tdp check` to check that TDP was set correctly.
## Touch fix ## Touch fix