Skip to content

Commit f3d3ac3

Browse files
authored
Merge pull request #59 from tstromberg/windows
add systray support for Windows
2 parents 7341f25 + 21dabea commit f3d3ac3

File tree

7 files changed

+51
-17
lines changed

7 files changed

+51
-17
lines changed

cmd/goose/icons.go

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,14 @@
11
package main
22

33
import (
4-
_ "embed"
54
"log/slog"
65
"os"
76
"path/filepath"
87
)
98

10-
// Embed icon files at compile time for better distribution
11-
//
12-
//go:embed icons/goose.png
13-
var iconGoose []byte
14-
15-
//go:embed icons/popper.png
16-
var iconPopper []byte
17-
18-
//go:embed icons/smiling-face.png
19-
var iconSmiling []byte
20-
21-
//go:embed icons/lock.png
22-
var iconLock []byte
23-
24-
//go:embed icons/warning.png
25-
var iconWarning []byte
9+
// Icon variables are defined in platform-specific files:
10+
// - icons_windows.go: uses .ico files
11+
// - icons_unix.go: uses .png files
2612

2713
// IconType represents different icon states
2814
type IconType int

cmd/goose/icons/goose.ico

18.1 KB
Binary file not shown.

cmd/goose/icons/popper.ico

33.6 KB
Binary file not shown.

cmd/goose/icons/smiling-face.ico

55.7 KB
Binary file not shown.

cmd/goose/icons/warning.ico

11.3 KB
Binary file not shown.

cmd/goose/icons_unix.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//go:build !windows
2+
3+
package main
4+
5+
import (
6+
_ "embed"
7+
)
8+
9+
// Embed PNG files for Unix-like systems (macOS, Linux)
10+
//
11+
//go:embed icons/goose.png
12+
var iconGoose []byte
13+
14+
//go:embed icons/popper.png
15+
var iconPopper []byte
16+
17+
//go:embed icons/smiling-face.png
18+
var iconSmiling []byte
19+
20+
//go:embed icons/lock.png
21+
var iconLock []byte
22+
23+
//go:embed icons/warning.png
24+
var iconWarning []byte

cmd/goose/icons_windows.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//go:build windows
2+
3+
package main
4+
5+
import (
6+
_ "embed"
7+
)
8+
9+
// Embed Windows ICO files at compile time
10+
//
11+
//go:embed icons/goose.ico
12+
var iconGoose []byte
13+
14+
//go:embed icons/popper.ico
15+
var iconPopper []byte
16+
17+
//go:embed icons/smiling-face.ico
18+
var iconSmiling []byte
19+
20+
//go:embed icons/warning.ico
21+
var iconWarning []byte
22+
23+
// lock.ico not yet created, using warning as fallback
24+
var iconLock = iconWarning

0 commit comments

Comments
 (0)