Skip to content

Commit

Permalink
fix: #4 make icon path dependent on platform
Browse files Browse the repository at this point in the history
  • Loading branch information
ArmandMeppa committed Oct 17, 2024
1 parent eb7a4a1 commit 6a24b79
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
Binary file added assets/wazuh-logo.ico
Binary file not shown.
4 changes: 4 additions & 0 deletions darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import (
"time"
)

func getIconPath() string {
return "assets/wazuh-logo.png" // Path to the PNG icon for Linux
}

// checkServiceStatus checks the status of Wazuh agent and its connection on macOS
func checkServiceStatus() (string, string) {
cmd := exec.Command("sh", "-c", "sudo /Library/Ossec/bin/wazuh-control status")
Expand Down
4 changes: 4 additions & 0 deletions linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import (
"time"
)

func getIconPath() string {
return "assets/wazuh-logo.png" // Path to the PNG icon for Linux
}

// checkServiceStatus checks the status of Wazuh agent and its connection on Linux
func checkServiceStatus() (string, string) {
// Command to check agent status
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func main() {

func onReady() {
// Set the main icon
iconData, err := getEmbeddedFile("assets/wazuh-logo.png")
iconData, err := getEmbeddedFile(getIconPath())
if err != nil {
log.Fatalf("Failed to load icon: %v", err)
}
Expand Down
4 changes: 4 additions & 0 deletions windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import (
"time"
)

func getIconPath() string {
return "assets/wazuh-logo.ico" // Path to the PNG icon for Linux
}

// checkServiceStatus checks the status of Wazuh agent and its connection on Windows
func checkServiceStatus() (string, string) {
cmd := exec.Command("cmd", "/C", `C:\Program Files (x86)\ossec\bin\wazuh-control status`)
Expand Down

0 comments on commit 6a24b79

Please sign in to comment.