Skip to content

Commit bfdc27f

Browse files
committed
Ditch completely systray for now, too much issue, will be rewritten
using win32 api just for windows Signed-off-by: Tiziano Bacocco <tizbac2@gmail.com>
1 parent dd98ad8 commit bfdc27f

3 files changed

Lines changed: 5 additions & 36 deletions

File tree

directorybackup/go.mod

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ module directorybackup
22

33
go 1.24.4
44

5-
require (
6-
github.com/cornelk/hashmap v1.0.8
7-
github.com/gen2brain/beeep v0.11.1
8-
)
5+
require github.com/cornelk/hashmap v1.0.8
96

107
require (
118
github.com/alessio/shellescape v1.4.2 // indirect
@@ -24,14 +21,12 @@ require (
2421
require (
2522
git.sr.ht/~jackmordaunt/go-toast v1.1.2 // indirect
2623
github.com/esiqveland/notify v0.13.3 // indirect
27-
github.com/getlantern/systray v1.2.2
2824
github.com/go-ole/go-ole v1.3.0 // indirect
2925
github.com/godbus/dbus/v5 v5.1.0 // indirect
3026
github.com/jackmordaunt/icns/v3 v3.0.1 // indirect
3127
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect
3228
github.com/sergeymakinen/go-bmp v1.0.0 // indirect
3329
github.com/sergeymakinen/go-ico v1.0.0-beta.0 // indirect
34-
github.com/tadvi/systray v0.0.0-20190226123456-11a2b8fa57af // indirect
3530
github.com/tawesoft/golib/v2 v2.16.0
3631
golang.org/x/sys v0.30.0 // indirect
3732
)

directorybackup/main.go

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import (
2121
"time"
2222

2323
"github.com/cornelk/hashmap"
24-
"github.com/gen2brain/beeep"
25-
"github.com/getlantern/systray"
2624
"github.com/tawesoft/golib/v2/dialog"
2725
)
2826

@@ -185,16 +183,6 @@ func main() {
185183
os.Exit(2)
186184
}
187185
defer L.ReleaseProcessLock()
188-
if runtime.GOOS == "windows" {
189-
go systray.Run(func() {
190-
systray.SetIcon(clientcommon.ICON)
191-
systray.SetTooltip("PBSGO Backup running")
192-
beeep.Notify("Proxmox Backup Go", "Backup started", "")
193-
},
194-
func() {
195-
196-
})
197-
}
198186

199187
insecure := cfg.CertFingerprint != ""
200188

@@ -259,10 +247,7 @@ func main() {
259247
panic(err)
260248
}
261249
}
262-
if runtime.GOOS == "windows" {
263-
systray.Quit()
264-
beeep.Notify("Proxmox Backup Go", msg, "")
265-
}
250+
266251
if cfg.SMTP != nil {
267252
var subject string
268253

@@ -458,7 +443,6 @@ func backup_real(client *pbscommon.PBSClient, newchunk, reusechunk *atomic.Uint6
458443
}
459444

460445
func backup(client *pbscommon.PBSClient, newchunk, reusechunk *atomic.Uint64, pxarOut string, backupdir string, usevss bool) error {
461-
462446

463447
fmt.Printf("Starting backup of %s\n", backupdir)
464448
var err error
@@ -470,9 +454,9 @@ func backup(client *pbscommon.PBSClient, newchunk, reusechunk *atomic.Uint64, px
470454
backupdir = SNAP.FullPath
471455
//Remove VSS snapshot on windows, on linux for now NOP
472456
return backup_real(client, newchunk, reusechunk, pxarOut, backupdir)
473-
457+
474458
})
475-
}else{
459+
} else {
476460
err = backup_real(client, newchunk, reusechunk, pxarOut, backupdir)
477461
}
478462

machinebackup/windows.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
package main
55

66
import (
7-
"clientcommon"
87
"fmt"
98
"io"
109
"os"
@@ -14,8 +13,6 @@ import (
1413
"syscall"
1514
"unsafe"
1615

17-
"github.com/gen2brain/beeep"
18-
"github.com/getlantern/systray"
1916
"github.com/tawesoft/golib/v2/dialog"
2017
"golang.org/x/sys/windows"
2118
)
@@ -472,12 +469,5 @@ func backupWindowsDisk(client *pbscommon.PBSClient, index int) error {
472469
}
473470

474471
func sysTraySetup() {
475-
go systray.Run(func() {
476-
systray.SetIcon(clientcommon.ICON)
477-
systray.SetTooltip("PBSGO Backup running")
478-
beeep.Notify("Proxmox Backup Go", "Backup started", "")
479-
},
480-
func() {
481-
482-
})
472+
//TODO
483473
}

0 commit comments

Comments
 (0)