You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
662 B
29 lines
662 B
3 weeks ago
|
package tray
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"runtime"
|
||
|
|
||
|
"github.com/ollama/ollama/app/assets"
|
||
|
"github.com/ollama/ollama/app/tray/commontray"
|
||
|
)
|
||
|
|
||
|
func NewTray() (commontray.OllamaTray, error) {
|
||
|
extension := ".png"
|
||
|
if runtime.GOOS == "windows" {
|
||
|
extension = ".ico"
|
||
|
}
|
||
|
iconName := commontray.UpdateIconName + extension
|
||
|
updateIcon, err := assets.GetIcon(iconName)
|
||
|
if err != nil {
|
||
|
return nil, fmt.Errorf("failed to load icon %s: %w", iconName, err)
|
||
|
}
|
||
|
iconName = commontray.IconName + extension
|
||
|
icon, err := assets.GetIcon(iconName)
|
||
|
if err != nil {
|
||
|
return nil, fmt.Errorf("failed to load icon %s: %w", iconName, err)
|
||
|
}
|
||
|
|
||
|
return InitPlatformTray(icon, updateIcon)
|
||
|
}
|