diff options
| author | Paul Buetow <paul@buetow.org> | 2024-01-24 01:10:44 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2024-01-24 01:10:44 +0200 |
| commit | 5d8a28040830bdd1c05809bae298602008e275da (patch) | |
| tree | 140dcd667aa7df23e1f17c6dec3d59c95cee7370 | |
| parent | bc95b1b03204ecade0c4ceac0a3412df26384334 (diff) | |
write md
| -rw-r--r-- | AndroidManifest.xml | 2 | ||||
| -rw-r--r-- | main.go | 15 |
2 files changed, 8 insertions, 9 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 7e79af8..6a0e346 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -17,5 +17,5 @@ <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> - </application> + </application> </manifest> @@ -15,17 +15,16 @@ import ( func main() { a := app.NewWithID("org.buetow.quicklogger") - myWindow := a.NewWindow("Quick logger") - + w := a.NewWindow("Quick logger") + // Same dir as my Obsidian storageDir := "/storage/emulated/0/Notes/Vault" - label := widget.NewLabel(storageDir) input := widget.NewMultiLineEntry() input.SetPlaceHolder("Enter text here!") button := widget.NewButton("Log text", func() { content := input.Text - filename := fmt.Sprintf("%s/quicklog-%s.txt", storageDir, getSHA256Hash(content)) + filename := fmt.Sprintf("%s/quicklog-%s.md", storageDir, getSHA256Hash(content)) err := os.WriteFile(filename, []byte(content), 0644) if err != nil { log.Println("Error writing to file:", err) @@ -35,13 +34,13 @@ func main() { } }) - myWindow.SetContent(container.NewVBox( - label, + w.SetContent(container.NewVBox( + widget.NewLabel("To be in the .zone!"), input, button, )) - myWindow.Resize(fyne.NewSize(200, 100)) - myWindow.ShowAndRun() + w.Resize(fyne.NewSize(200, 100)) + w.ShowAndRun() } func getSHA256Hash(text string) string { |
