Skip to content

Commit 4389682

Browse files
committed
Below:
* Added user-friendly GUI along with respective install, uninstall, update scripts * Added uninstall-undervolt.sh to distributables * Improved the README docs * Updated go.yml GitHub Actions Workflow to build both CLI and GUI binaries and distribute them
1 parent 4e120cc commit 4389682

File tree

14 files changed

+1435
-72
lines changed

14 files changed

+1435
-72
lines changed

.github/workflows/go.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,32 @@ jobs:
4141
echo "All required dependencies are installed"
4242
- name: Build undervolt-go
4343
run: |
44-
echo "Building undervolt-go..."
45-
go build -ldflags="-X 'main.version=$(git describe --tags)'" -o undervolt-go main.go # When building your application, pass the version from git tags using ldflags.
44+
echo "Building Undervolt Go..."
45+
go build -ldflags="-X 'main.version=$(git describe --tags)'" -o undervolt-go . # When building your application, pass the version from git tags using ldflags.
46+
echo "Build complete!"
47+
- name: Build Undervolt Go Pro
48+
run: |
49+
echo "Building Undervolt Go Pro..."
50+
go build -tags gui -ldflags="-X main.version=$(git describe --tags)" -o undervolt-go-pro .
4651
echo "Build complete!"
4752
- name: Make compiled binary available
4853
run: |
4954
echo "Working on making the compiled binary available..."
50-
mkdir latest-build public
55+
mkdir latest-build latest-pro-build public
5156
cp -r ./undervolt-go ./latest-build/ # Copy the binary to the latest-build directory
52-
cp -r ./dist/script/* ./latest-build/ # Copy the install scripts to the latest-build directory
57+
cp -r ./undervolt-go-pro ./latest-pro-build/ # Copy the binary to the latest-pro-build directory
58+
cp -r ./dist/script/cli/* ./latest-build/ # Copy the install scripts to the latest-build directory
59+
cp -r ./dist/script/gui/* ./latest-pro-build/ # Copy the install scripts to the latest-pro-build directory
5360
echo "Ready to deploy!"
5461
- name: Compress the 'latest-build' and make it available in 'public'
5562
run: |
5663
zip -r undervolt-go.zip ./latest-build/ # Make a zip file of the latest build
64+
zip -r undervolt-go-pro.zip ./latest-pro-build/ # Make a zip file of the latest build
5765
cp -r undervolt-go.zip ./public/
66+
cp -r undervolt-go-pro.zip ./public/
5867
echo "Compress complete and available in public directory!"
59-
echo "Removing the now unused latest-build directory and undervolt-go.zip..."
60-
rm -r undervolt-go.zip latest-build
68+
echo "Removing the now unused directory and archives..."
69+
rm -r undervolt-go.zip undervolt-go-pro.zip latest-build latest-pro-build
6170
echo "Removing complete!"
6271
- name: Output the files structure into a JSON file
6372
run: |

README.md

Lines changed: 46 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# undervolt-go
1+
# Undervolt Go
22

3-
**undervolt-go** is a Go port of the original [undervolt](https://github.com/georgewhewell/undervolt) utility, designed to allow users to undervolt Intel CPUs on Linux systems. Undervolting can help reduce CPU temperatures, decrease power consumption, and potentially increase system stability and longevity. **undervolt-go** gives the advantage of running the application without the need for any dependencies.
3+
**Undervolt Go** is a power-utility, designed to allow users to undervolt Intel CPUs on Linux systems. Undervolting can help reduce CPU temperatures, decrease power consumption, and potentially increase system stability and longevity. **Undervolt Go** gives the advantage of running the application without the need for any dependencies, and also features a user-friendly graphical version.
44

55
Get it [here](https://softorage.github.io/undervolt-go/).
66

@@ -24,11 +24,11 @@ _**Note:**_
2424

2525
## Introduction
2626

27-
**undervolt-go** enables users to apply voltage offsets to various components of Intel CPUs, such as the core, cache, GPU, and more. By adjusting these voltage offsets, users can achieve lower power consumption and reduced heat output, which is particularly beneficial for laptops and compact systems where thermal management is crucial.
27+
**Undervolt Go** enables users to apply voltage offsets to various components of Intel CPUs, such as the core, cache, GPU, and more. By adjusting these voltage offsets, users can achieve lower power consumption and reduced heat output, which is particularly beneficial for laptops and compact systems where thermal management is crucial.
2828

2929
## Building
3030

31-
To build **undervolt-go**, follow these steps:
31+
To build **Undervolt Go**, follow these steps:
3232

3333
1. **Clone the repository:**
3434

@@ -62,13 +62,16 @@ To build **undervolt-go**, follow these steps:
6262

6363
## Installation
6464

65-
To install **undervolt-go** on your system, follow these steps:
66-
1. Download latest release from [offical nightly builds](https://softorage.github.io/undervolt-go/)
65+
To install **Undervolt Go** on your system, follow these steps:
66+
1. Download latest release from [offical nightly builds](https://softorage.github.io/undervolt-go/).
67+
- You can download the GUI version (slightly more in size) or the CLI version.
68+
- The GUI version can also run the CLI commands. The commands need to be passed to `undervolt-go-pro`
6769
2. Extract the archive. You should now have the following files:
68-
1. undervolt-go
70+
1. undervolt-go or undervolt-go-pro
6971
2. install-undervolt.sh
70-
3. update-undervolt.sh
71-
3. Simply make install-undervolt.sh executable (or update-undervolt.sh if you already have it):
72+
3. uninstall-undervolt.sh
73+
4. update-undervolt.sh
74+
3. Simply make install-undervolt.sh executable (or update-undervolt.sh if you already have Undervolt Go installed on your system):
7275
- `chmod +x install-undervolt.sh`
7376
- or you can right click install-undervolt.sh, go to Properties, and in the Permissions tab, tick 'Make executable'
7477
4. If you have built the binary by yourselves, replace the downloaded undervolt-go with your undervolt-go
@@ -77,7 +80,7 @@ To install **undervolt-go** on your system, follow these steps:
7780

7881
## Usage
7982

80-
**undervolt-go** requires root privileges to interact with the CPU's model-specific registers (MSRs). Ensure you have the necessary permissions before proceeding.
83+
**Undervolt Go** requires root privileges to interact with the CPU's model-specific registers (MSRs). Ensure you have the necessary permissions before proceeding.
8184

8285
1. To apply a voltage offset, use the following syntax:
8386

@@ -132,9 +135,13 @@ To install **undervolt-go** on your system, follow these steps:
132135

133136
## Features
134137

138+
- **GUI:** Interact with 'Undervolt Go' from a user-friendly graphical user interface.
135139
- **Voltage Offset Adjustment:** Apply custom voltage offsets to CPU components to optimize performance and thermal characteristics.
136-
- **Temperature Target Override:** Set a custom temperature target for CPU throttling.
140+
- **Temperature Target Override:** Set a custom temperature target for CPU throttling, on AC or battery power.
137141
- **Power Limit Configuration:** Adjust the CPU's power limits to control performance and power consumption.
142+
- **Intel Turbo Adjustment:** Enable or disable Intel Turbo for optimal performance.
143+
- **Temperature Monitoring:** Monitor and display the current temperature of the CPU.
144+
- **Fan Monitoring:** Monitor and display the current fan speed of the CPU.
138145

139146
## Dependencies
140147

@@ -151,14 +158,15 @@ To install **undervolt-go** on your system, follow these steps:
151158
152159
## Configuration
153160
154-
**undervolt-go** does not use a configuration file. All settings are applied via command-line arguments. To maintain settings across reboots, you can either consider creating a startup script that runs your preferred `undervolt-go` command, or add the preferred `undervolt-go` command in `.profile` file. You may need to edit the `sudoers` file to allow running `undervolt-go` as sudo without requiring password.
161+
**Undervolt Go** does not use a configuration file. All settings are applied via command-line arguments. To maintain settings across reboots, you can either consider creating a startup script that runs your preferred `undervolt-go` command, or add the preferred `undervolt-go` command in `.profile` file. You may need to edit the `sudoers` file to allow running `undervolt-go` as sudo without requiring password.
155162
156163
To edit `sudoers` file,
157164
1. Type in terminal `sudo visudo`.
158-
2. Add the below line at last of the sudoers file to allow running `undervolt-go` as sudo without requiring password
159-
`username ALL=(ALL) NOPASSWD: /usr/local/bin/undervolt-go`
165+
2. Add the below line at last of the sudoers file to allow running **Undervolt Go** as sudo without requiring password
166+
- `username ALL=(ALL) NOPASSWD: /usr/local/bin/undervolt-go`
167+
- `username ALL=(ALL) NOPASSWD: /usr/local/bin/undervolt-go-pro` # in case you are using the graphical version
160168
3. `Ctrl`+`X` to exit, `y` and `enter` to save.
161-
4. Make sure that you are absolutely sure that the computer won't crash with the commands that you are putting in `.profile`. Otherwise, your computer will always crash upon login. In such a case, you may try to shift to tty4 (`Ctrl`+`Alt`+`F4`) before login (or any other tty), and remove the commands causing issues from `.profile` file. This would usually work if X Server is causing issues.
169+
4. Make sure that you are absolutely sure that the computer won't crash with the commands that you are putting in `.profile`. Otherwise, your computer will always crash upon login. In such a case, you may try to shift to `tty4` (`Ctrl`+`Alt`+`F4`) before login (or any other `tty`), and remove the commands causing issues from `.profile` file. This would usually work if X Server is causing issues.
162170

163171

164172
## Examples
@@ -197,43 +205,45 @@ To edit `sudoers` file,
197205

198206
1. Is undervolting safe?
199207

200-
Undervolting can be safe if done correctly, but it carries inherent risks. Applying incorrect voltage settings can lead to system instability, crashes, or hardware damage. Start with small negative voltage offsets, and choose the offset just before the system starts crashing. You may have to manually cut the power when the system crashes due to undervolt.
208+
Undervolting can be safe if done correctly, but it carries inherent risks. Applying incorrect voltage settings can lead to system instability, crashes, or hardware damage. Start with small negative voltage offsets, and choose the offset just before the system starts crashing. You may have to manually cut the power when the system crashes due to undervolt.
201209

202-
2. Do I need to install any dependencies to use undervolt-go?
210+
2. Do I need to install any dependencies to use Undervolt Go?
203211

204-
No, undervolt-go is built using Go and does not require any external dependencies. However, to interact with CPU settings, the application needs to run with elevated privileges.
212+
No, Undervolt Go is built using Go and does not require any external dependencies. However, to interact with CPU settings, the application needs to run with elevated privileges.
205213

206-
3. How do I use undervolt-go to undervolt my CPU?
214+
3. How do I use Undervolt Go to undervolt my CPU?
207215

208-
To use undervolt-go:
216+
To use Undervolt Go:
209217

210-
Mehtod 1: Without installation:
218+
Mehtod 1: Without installation:
211219

212-
- Open Terminal: Launch your terminal application.​
213-
- Navigate to the Executable Location: Ensure you're in the directory containing the undervolt-go executable (`cd` into the directory where 'undervolt-go' is located) or provide the full path to it.​
214-
- Run the Executable: Execute the program with appropriate permissions:​
215-
`sudo ./undervolt-go`
220+
- Open Terminal: Launch your terminal application.​
221+
- Navigate to the Executable Location: Ensure you're in the directory containing the undervolt-go executable (`cd` into the directory where 'undervolt-go' is located) or provide the full path to it.​
222+
- Run the Executable: Execute the program with appropriate permissions:​
223+
`sudo ./undervolt-go`
216224
217-
Mehtod 2: With installation:
225+
Mehtod 2: With installation:
218226
219-
- Open Terminal: Launch your terminal application.
220-
- Navigate to the undervolt-go directory: Change to the directory containing the undervolt-go executable, along with the install-undervolt.sh and update-undervolt.sh scripts. Make sure that all the files are in the same directory.
221-
- Install undervolt-go: Run the install-undervolt.sh script:
222-
`sudo ./install-undervolt.sh`
223-
- Run undervolt-go: You can now use 'undervolt-go' from any directory.Run the undervolt-go executable with root privileges:
224-
`sudo undervolt-go`
227+
- Navigate to the undervolt-go or undervolt-go-pro directory: Change to the directory containing the undervolt-go executable or undervolt-go-pro executable for graphical version, along with the install-undervolt.sh, uninstall-undervolt.sh and update-undervolt.sh scripts. Make sure that all the files are in the same directory.
228+
- Open Terminal: Launch your terminal application in the undervolt-go or undervolt-go-pro directory.
229+
- Install Undervolt Go: Run the install-undervolt.sh script:
230+
`sudo ./install-undervolt.sh`
231+
- Run Undervolt Go:
232+
- For `undervolt-go`, you can now use 'Undervolt Go' from any directory. Run the `undervolt-go` command with root privileges:
233+
- `sudo undervolt-go --help`
234+
- For `undervolt-go-pro`, you can now launch 'Undervolt Go' from your desktop. Just click or double-click on the 'Undervolt Go' icon to run the graphical version. You will be prompted root password and then the program will run.
225235
226236
4. Do you use AI to develop this project?
227237
228-
We may use AI when developing this project. If you find any issues, please report them to us. We will try to fix them as soon as possible.
238+
We may use AI when developing this project. If you find any issues, please report them to us. We will try to fix them as soon as possible.
229239
230-
5. Which Intel CPUs are supported by undervolt-go?
240+
5. Which Intel CPUs are supported by Undervolt Go?
231241
232-
undervolt-go supports a range of Intel CPUs, particularly those from the Haswell generation and newer. However, compatibility can vary based on your specific system configuration.
242+
Undervolt Go supports a range of Intel CPUs, particularly those from the Haswell generation and newer. However, compatibility can vary based on your specific system configuration.
233243
234244
## Contributors
235245
236-
We welcome contributions from the community. If you'd like to contribute to **undervolt-go**, please fork the repository and submit a pull request with your changes.
246+
We welcome contributions from the community. If you'd like to contribute to **Undervolt Go**, please fork the repository and submit a pull request with your changes.
237247

238248
## Credits
239249

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
# uninstall-undervolt.sh
3+
# This script removes the undervolt Go binary from /usr/local/bin.
4+
#
5+
# Usage:
6+
# sudo ./uninstall-undervolt.sh
7+
8+
set -e
9+
10+
# Ensure script is run as root.
11+
if [[ $EUID -ne 0 ]]; then
12+
echo "This script must be run as root. Try using sudo."
13+
exit 1
14+
fi
15+
16+
INSTALL_PATH="/usr/local/bin/undervolt-go"
17+
18+
# Check if the file exists before attempting to remove it
19+
if [[ -f "${INSTALL_PATH}" ]]; then
20+
echo "Removing ${INSTALL_PATH}..."
21+
rm -f "${INSTALL_PATH}"
22+
echo "Uninstallation complete. 'undervolt-go' has been removed."
23+
else
24+
echo "No installation found at ${INSTALL_PATH}."
25+
fi

dist/script/gui/icon.png

5.57 KB
Loading
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#!/bin/bash
2+
# install-undervolt.sh
3+
# Installs undervolt-go and sets up desktop launcher with pkexec
4+
5+
set -e
6+
7+
# Ensure script is run as root
8+
if [[ $EUID -ne 0 ]]; then
9+
echo "This script must be run as root. Try using sudo."
10+
exit 1
11+
fi
12+
13+
echo "Installing Undervolt Go..."
14+
15+
# Install binary
16+
INSTALL_PATH="/usr/local/bin/undervolt-go-pro"
17+
cp undervolt-go-pro "${INSTALL_PATH}"
18+
chmod +x "${INSTALL_PATH}"
19+
20+
# Install wrapper
21+
WRAPPER_PATH="/usr/bin/undervolt-go-wrapper"
22+
echo "Creating pkexec wrapper at ${WRAPPER_PATH}..."
23+
cat <<EOF > "${WRAPPER_PATH}"
24+
#!/bin/bash
25+
export DISPLAY=:0
26+
export XAUTHORITY=/home/\${SUDO_USER}/.Xauthority
27+
exec ${INSTALL_PATH}
28+
EOF
29+
chmod +x "${WRAPPER_PATH}"
30+
31+
# Install icon (optional: replace with your own icon)
32+
ICON_PATH="/usr/share/icons/undervolt-go.png"
33+
if [[ -f "icon.png" ]]; then
34+
cp icon.png "${ICON_PATH}"
35+
else
36+
echo "No icon.png found. You can place your own icon at ${ICON_PATH} later."
37+
fi
38+
39+
# Install PolicyKit file
40+
POLKIT_FILE="/usr/share/polkit-1/actions/com.softorage.undervolt-go.policy"
41+
echo "Creating PolicyKit policy at ${POLKIT_FILE}..."
42+
cat <<EOF > "${POLKIT_FILE}"
43+
<?xml version="1.0" encoding="UTF-8"?>
44+
<policyconfig>
45+
<action id="com.softorage.undervolt-go">
46+
<description>Run 'Undervolt Go' as root</description>
47+
<message>Authentication is required to run 'Undervolt Go'</message>
48+
<icon_name>utilities-system-monitor</icon_name>
49+
<defaults>
50+
<allow_any>auth_admin</allow_any>
51+
<allow_inactive>auth_admin</allow_inactive>
52+
<allow_active>auth_admin</allow_active>
53+
</defaults>
54+
</action>
55+
</policyconfig>
56+
EOF
57+
58+
# Install desktop file
59+
DESKTOP_FILE="/usr/share/applications/undervolt-go.desktop"
60+
echo "Creating desktop shortcut at ${DESKTOP_FILE}..."
61+
cat <<EOF > "${DESKTOP_FILE}"
62+
[Desktop Entry]
63+
Name=Undervolt Go
64+
Comment=Undervolt and tweak CPU power settings to reduce temperatures and improve performance
65+
Exec=pkexec ${WRAPPER_PATH}
66+
Icon=${ICON_PATH}
67+
Terminal=false
68+
Type=Application
69+
Categories=Utility;
70+
EOF
71+
72+
chmod +x "${DESKTOP_FILE}"
73+
74+
# Copy to user's desktop
75+
USER_DESKTOP="${SUDO_USER:-$USER}"
76+
USER_HOME=$(eval echo "~${USER_DESKTOP}")
77+
cp "${DESKTOP_FILE}" "${USER_HOME}/Desktop/"
78+
chmod +x "${USER_HOME}/Desktop/undervolt-go.desktop"
79+
chown "${USER_DESKTOP}:${USER_DESKTOP}" "${USER_HOME}/Desktop/undervolt-go.desktop"
80+
81+
echo "Installation complete!"
82+
echo "You can now launch 'Undervolt Go' from the applications menu or desktop."
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/bin/bash
2+
# uninstall-undervolt.sh
3+
# Uninstalls undervolt-go-pro and removes all associated files.
4+
5+
set -e
6+
7+
# Ensure script is run as root
8+
if [[ $EUID -ne 0 ]]; then
9+
echo "This script must be run as root. Try using sudo."
10+
exit 1
11+
fi
12+
13+
echo "Uninstalling Undervolt Go..."
14+
15+
# Define paths
16+
INSTALL_PATH="/usr/local/bin/undervolt-go-pro"
17+
WRAPPER_PATH="/usr/bin/undervolt-go-wrapper"
18+
ICON_PATH="/usr/share/icons/undervolt-go.png"
19+
POLKIT_FILE="/usr/share/polkit-1/actions/com.softorage.undervolt-go.policy"
20+
DESKTOP_FILE="/usr/share/applications/undervolt-go.desktop"
21+
22+
# Remove binary
23+
if [[ -f "${INSTALL_PATH}" ]]; then
24+
echo "Removing binary at ${INSTALL_PATH}..."
25+
rm -f "${INSTALL_PATH}"
26+
fi
27+
28+
# Remove wrapper
29+
if [[ -f "${WRAPPER_PATH}" ]]; then
30+
echo "Removing wrapper at ${WRAPPER_PATH}..."
31+
rm -f "${WRAPPER_PATH}"
32+
fi
33+
34+
# Remove icon
35+
if [[ -f "${ICON_PATH}" ]]; then
36+
echo "Removing icon at ${ICON_PATH}..."
37+
rm -f "${ICON_PATH}"
38+
fi
39+
40+
# Remove PolicyKit file
41+
if [[ -f "${POLKIT_FILE}" ]]; then
42+
echo "Removing PolicyKit file at ${POLKIT_FILE}..."
43+
rm -f "${POLKIT_FILE}"
44+
fi
45+
46+
# Remove desktop entry
47+
if [[ -f "${DESKTOP_FILE}" ]]; then
48+
echo "Removing desktop entry at ${DESKTOP_FILE}..."
49+
rm -f "${DESKTOP_FILE}"
50+
fi
51+
52+
# Remove desktop shortcut from user's Desktop
53+
USER_DESKTOP="${SUDO_USER:-$USER}"
54+
USER_HOME=$(eval echo "~${USER_DESKTOP}")
55+
USER_DESKTOP_FILE="${USER_HOME}/Desktop/undervolt-go.desktop"
56+
if [[ -f "${USER_DESKTOP_FILE}" ]]; then
57+
echo "Removing desktop shortcut at ${USER_DESKTOP_FILE}..."
58+
rm -f "${USER_DESKTOP_FILE}"
59+
fi
60+
61+
echo "Uninstallation complete. All files have been removed."
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
# update-undervolt.sh
3+
# This script updates the undervolt Go binary in /usr/local/bin, to a new provided version
4+
# making it available from anywhere in the terminal.
5+
#
6+
# Usage:
7+
# sudo ./update-undervolt.sh
8+
9+
set -e
10+
11+
# Ensure script is run as root.
12+
if [[ $EUID -ne 0 ]]; then
13+
echo "This script must be run as root. Try using sudo."
14+
exit 1
15+
fi
16+
17+
# Install binary to /usr/local/bin.
18+
INSTALL_PATH="/usr/local/bin/undervolt-go-pro"
19+
20+
# Delete the existing binary if it exists.
21+
if [ -f "$INSTALL_PATH" ]; then
22+
echo "Deleting existing binary at $INSTALL_PATH..."
23+
rm -f "$INSTALL_PATH"
24+
fi
25+
26+
echo "Installing undervolt-go to ${INSTALL_PATH}..."
27+
cp undervolt-go-pro "${INSTALL_PATH}"
28+
chmod +x "${INSTALL_PATH}"
29+
30+
echo "Update complete! You can now use updated 'undervolt-go' from terminal. Try 'undervolt-go -h'."

0 commit comments

Comments
 (0)