Skip to content

Instantly share code, notes, and snippets.

@haroldadmin

haroldadmin/pathreporter.go Secret

Created Jul 3, 2020
Embed
What would you like to do?
A small app written using Fyne to show the current PATH value
package main
import (
"fmt"
"os"
"fyne.io/fyne"
"fyne.io/fyne/app"
"fyne.io/fyne/widget"
"github.com/haroldadmin/pathfix"
)
func main() {
app := app.New()
w := app.NewWindow("PATH Demo")
w.Resize(fyne.NewSize(800, 300))
path := os.Getenv("PATH")
label := widget.NewLabel(path)
label.Wrapping = fyne.TextWrapBreak
w.SetContent(widget.NewVBox(
label,
widget.NewButton("Refresh", func() {
err := pathfix.Fix()
if err != nil {
fmt.Println(err)
}
newPath := os.Getenv("PATH")
label.Text = newPath
label.Refresh()
}),
))
w.ShowAndRun()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.