Skip to content

Commit ffba26a

Browse files
committed
Below:
* Improved the output of --read * Fixed: Clicking on apply without setting any values launches another window of Undervolt Go
1 parent 0f5357e commit ffba26a

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

.github/workflows/go.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ jobs:
8181
- name: Make web pages available
8282
run: |
8383
cp -r ./dist/pages/* ./public/ # Copy the web pages to the public directory
84+
echo "All done!"
8485
- name: Upload artifact
8586
# upload artifact in the build stage, so that it is later on accessible in the deploy stage
8687
uses: actions/upload-pages-artifact@v3

gui.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
"bytes"
1616
"fmt"
1717
"os/exec"
18-
//"os"
18+
//"os" remove comment if code for allowing notification for non-sudo user is uncommented
1919
"strconv"
2020
"net/url"
2121
"time"
@@ -410,7 +410,8 @@ func runGUI() {
410410

411411
// --- Action Buttons (docked bottom‑right) ---
412412
applyBtn := widget.NewButton("Apply", func() {
413-
if err := run(collect()...); err == nil {
413+
// without len(collect()) > 0, clicking on apply without any setting relaunches another window of Undervolt Go
414+
if err := run(collect()...); err == nil && len(collect()) > 0 {
414415
a.SendNotification(&fyne.Notification{
415416
Title: "undervolt-go",
416417
Content: "Settings applied successfully.",

main.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ var rootCmd = &cobra.Command{
412412
Use: rootCmdUseString,
413413
Version: version,
414414
Short: "A tool for undervolting and power limit adjustments to reduce temperatures and extend lifespan",
415-
Long: "A no-dependency utility to undervolt Intel CPUs on Linux systems with voltage offsets, perform power limit adjustments, set temperature limits, monitor temperatures and fan speeds, and more. It also features a user-friendly graphical version. Please use with extreme caution. It has the potential to damage your computer if used incorrectly.",
415+
Long: "A no-dependency utility to undervolt Intel CPUs on Linux systems with voltage offsets, perform power limit adjustments, set temperature limits, and more. It also features a user-friendly graphical version which lets you monitor temperatures and fan speeds with the help of 'sensors' package.\n\nPlease use with extreme caution. It has the potential to damage your computer if used incorrectly.",
416416
Run: func(cmd *cobra.Command, args []string) {
417417
// Setup logging.
418418
if verboseFlag {
@@ -559,13 +559,14 @@ var rootCmd = &cobra.Command{
559559
os.Exit(1)
560560
}
561561
fmt.Printf("Temperature target: -%d (%d°C)\n", temp, 100-temp)
562+
fmt.Printf("Voltage Offsets:\n")
562563
for plane := range planes {
563564
voltage, err := readOffset(plane, msr)
564565
if err != nil {
565566
fmt.Fprintf(os.Stderr, "Error reading %s offset: %v\n", plane, err)
566567
continue
567568
}
568-
fmt.Printf("%s: %.2f mV\n", plane, voltage)
569+
fmt.Printf(" %s: %.2f mV\n", plane, voltage)
569570
}
570571
// Read turbo state.
571572
path := "/sys/devices/system/cpu/intel_pstate/no_turbo"
@@ -575,14 +576,14 @@ var rootCmd = &cobra.Command{
575576
if string(data) == "1\n" {
576577
state = "disable"
577578
}
578-
fmt.Printf("turbo: %s\n", state)
579+
fmt.Printf("Intel Turbo: %s\n", state)
579580
}
580581
// Read and print power limits.
581582
plRead, err := readPowerLimit(msr)
582583
if err != nil {
583584
fmt.Fprintln(os.Stderr, "Error reading power limits:", err)
584585
} else {
585-
fmt.Printf("Power limit: %.2fW (short: %.2fs - %s) / %.2fW (long: %.2fs - %s)%s\n",
586+
fmt.Printf("Power limit:\n %.2fW [P2 (short): %.2fs - %s]\n %.2fW [P1 (long): %.2fs - %s]%s\n",
586587
plRead.ShortTermPower,
587588
plRead.ShortTermTime,
588589
boolToEnabled(plRead.ShortTermEnabled),

0 commit comments

Comments
 (0)