win3-resources/scripts
Quad d193604965 Update domain 2024-03-28 17:39:09 +01:00
..
README.md Update domain 2024-03-28 17:39:09 +01:00
gpd-prompt Replace tdp check in bashrc in favor of proper bash prompt 2021-05-21 21:12:47 +02:00
gpd-script-update Add update script so I don't have to copy-paste from the readme every time 2021-05-21 21:29:32 +02:00
gpd-sudo-prompt Add GPD to password prompt title 2021-05-23 11:37:19 +02:00
tdp Another one, probably because copy-pasted 2021-05-23 13:24:30 +02:00
tdp-gui-install Add README instructions and rename installer 2021-05-22 23:06:57 +02:00
tdp-set.service Update systemd service 2021-05-21 11:27:07 +02:00
touch-fix Add touch fix script 2021-05-21 10:04:36 +02:00

README.md

Scripts

A collection of scripts for the GPD Win 3. Mostly to minimize the reuqired typing on the keyboard.

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
I recommend cloning the repo as ~/.local/gpd-win3 for all the scripts to work properly.

Quick install

To quickly install the scripts, paste this block into a terminal on your GPD Win 3:

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
  git clone https://forge.quad.moe/quad/win3-resources.git ~/.local/gpd-win3
  echo -e "\n# GPD Win 3 scripts\nPATH=\"\${PATH}:\${HOME}/.local/gpd-win3/scripts\"" >> ~/.bashrc
  printf "$(tput setaf 2)-- Install finished. Please open a new terminal to use the scripts --$(tput sgr0)\n"
fi

To update, run:

gpd-script-update

"Install" TDP manager

The TDP manager has a GUI. This can be added to your application menu by running the following command:

tdp-gui-install

You might have to log out and back in before the TDP Manager appears in your application menu.

Manual install

  • Clone the repository somewhere (preferably ~/.local/gpd-win3)
  • 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

Uninstall

If you wish to uninstall the scripts follow the instructions in this block:

# Edit your .bashrc and remove the GPD-related entries at the bottom
nano ~/.bashrc
# Delete the repository
rm -rf ~/.local/gpd-win3
# Delete the application shortcut for the TDP manager (If installed)
rm -rf ~/.local/share/applications/tdp-gui.desktop
# Delete the systemd service (If installed)
sudo systemctl disable --now tdp-set.service
sudo rm -rf /etc/systemd/system/tdp-set.service

TDP

Lets you easily set the TDP via the intel_rapl driver.
Also has a basic GUI available.

TDP is the number of watts the Intel chip is allowed to use.
You would typically want to change this to fit your desired balance of performance and battery life. Or to use different amounts of power when docked or handheld.

For details on how to use, run tdp help.

Example commands:

# Print help
tdp help

# Launch GUI
tdp gui

# Check TDP
tdp check

# Set TDP to 8W
tdp set 8

# Set both PL1 and PL2 to 15W
tdp set 15 --same --detail

Setting TDP at boot

Install the service using the following command: cp ~/.local/gpd-win3/scripts/tdp-set.service /etc/systemd/system/

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:

sudo systemctl deamon-reload
sudo systemctl enable tdp-set.service

Reboot your Win 3, then run tdp check to check that TDP was set correctly.

Touch fix

The script touch-fix unloads, then loads the touchscreen modules needed by the Win 3. This makes the touchscreen work, but only until next reboot. Useful until a permanent fix is available.

Example commands:

# Reload touchscreen module
touch-fix

GPD Prompt

This is a customized version of my bash prompt that adds a TDP display after the hostname:

Screenshot of bash prompt in action

This script collection must be installed for it to work.
To use it, open your ~/.bashrc file and add the following line:

source gpd-prompt

Disabling sudo password

If you use your GPD Win 3 as only a gaming device, and security isn't a huge concern. Disabling the password requirement for sudo might be an idea. To do this, run the command sudo visudo and ensure the following line is in the file:

username     ALL=(ALL) NOPASSWD:ALL

Replacing username with your own username. This will allow sudo commands (including the ones used by scripts) to run without asking for a password.