Skip to content

Commit 41b3a9f

Browse files
committed
Below:
* Fixed: Mistakenly using 'undervolt-go' instead of 'undervolt-go-pro' for GUI version * Alert on pressing the 'Stop' button on 'Output' pane is a bit more informative..
1 parent a631435 commit 41b3a9f

File tree

4 files changed

+18
-13
lines changed

4 files changed

+18
-13
lines changed

dist/script/gui/install-undervolt.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ cat <<EOF > "${WRAPPER_PATH}"
2424
#!/bin/bash
2525
# Determine the user who initiated the pkexec action
2626
if [ -n "$PKEXEC_UID" ]; then
27-
USER=$(id -un "$PKEXEC_UID")
27+
USER=$(id -un "$PKEXEC_UID")
2828
elif [ -n "$SUDO_USER" ]; then
29-
USER="$SUDO_USER"
29+
USER="$SUDO_USER"
3030
else
31-
echo "Error: Could not determine the user. PKEXEC_UID and SUDO_USER are unset." >&2
32-
exit 1
31+
echo "Error: Could not determine the user. PKEXEC_UID and SUDO_USER are unset." >&2
32+
exit 1
3333
fi
3434
# Check if the user was found
3535
if [ -z "$USER" ]; then

gui.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ import (
2929
"fyne.io/fyne/v2/data/binding"
3030
)
3131

32+
// Used in main.go by rootCmd
33+
const rootCmdUseString := "undervolt-go-pro"
34+
3235
func runGUI() {
3336
a := app.NewWithID("com.softorage.undervolt-go")
3437
// Set dark theme
@@ -154,10 +157,9 @@ func runGUI() {
154157
return args
155158
}
156159

157-
158-
160+
//
159161
run := func(flags ...string) error {
160-
cmd := exec.Command("sudo", append([]string{"undervolt-go"}, flags...)...)
162+
cmd := exec.Command("sudo", append([]string{"undervolt-go-pro"}, flags...)...)
161163
// Redirect command output to a buffer for display in the Output Pane.
162164
// Redirect both stdout and stderr to the same buffer, so that any error
163165
// messages are included in the output.
@@ -167,12 +169,12 @@ func runGUI() {
167169
err := cmd.Run()
168170
if err != nil {
169171
buf.WriteString("\nError: " + err.Error())
170-
if os.Geteuid() != 0 {
172+
//if os.Geteuid() != 0 { commenting out to see if notifications work with sudo
171173
a.SendNotification(&fyne.Notification{
172174
Title: "undervolt-go",
173175
Content: "Error occured when applying settings. Please check 'Output' pane for more information.",
174176
})
175-
}
177+
//}
176178
}
177179
outputLabelBinding.Set(buf.String())
178180
return err
@@ -327,7 +329,7 @@ func runGUI() {
327329
return
328330
}
329331
stopMonitorFunc()
330-
outputWarningBind.Set("Monitoring stopped.")
332+
outputWarningBind.Set("Monitoring stopped. You may now run other commands.")
331333
clearLabelAfter(outputWarningBind, 3*time.Second)
332334
})
333335
verBtn := widget.NewButton("Version", func() {

main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,10 +409,10 @@ var (
409409
)
410410

411411
var rootCmd = &cobra.Command{
412-
Use: "undervolt-go",
412+
Use: rootCmdUseString,
413413
Version: version,
414-
Short: "A tool for undervolting and power limit adjustments",
415-
Long: "A Go port of undervolt.py (v0.4.0) including power limit adjustments using the cobra library for improved flag handling.",
414+
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.",
416416
Run: func(cmd *cobra.Command, args []string) {
417417
// Setup logging.
418418
if verboseFlag {

nogui.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ package main
1212

1313
import "fmt"
1414

15+
// Used in main.go by rootCmd
16+
const rootCmdUseString := "undervolt-go"
17+
1518
func runGUI() {
1619
fmt.Println("Run 'undervolt-go --help' for information about CLI flags. To get the GUI, get the GUI binary from https://softorage.github.io/undervolt-go/")
1720
}

0 commit comments

Comments
 (0)