Skip to content

Commit 5c50cd1

Browse files
committed
Cleaned up Windows experience
1 parent ef2e67f commit 5c50cd1

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

src/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ func main() {
139139
go func() {
140140
cmd := exec.Command(trayPath)
141141
setSysProcAttr(cmd)
142+
setCommandNoWindow(cmd)
142143

143144
err := cmd.Start()
144145
if err != nil {

src/sysproc_others.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ func setSysProcAttr(cmd *exec.Cmd) {
2525
Setpgid: true,
2626
}
2727
}
28+
29+
func setCommandNoWindow(cmd *exec.Cmd) {
30+
}

src/sysproc_windows.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package main
1717
import (
1818
"os/exec"
1919
"syscall"
20+
"golang.org/x/sys/windows"
2021
)
2122

2223

@@ -25,3 +26,9 @@ func setSysProcAttr(cmd *exec.Cmd) {
2526
CreationFlags: syscall.CREATE_NEW_PROCESS_GROUP,
2627
}
2728
}
29+
30+
func setCommandNoWindow(cmd *exec.Cmd) {
31+
cmd.SysProcAttr = &windows.SysProcAttr{
32+
CreationFlags: windows.CREATE_NO_WINDOW,
33+
}
34+
}

tray/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ func runChecker() {
120120

121121
func getInitialContainerState() {
122122
cmd := exec.Command(getPodmanExecutable(), "ps", "--all", "--format", "json")
123+
tray.SetCommandNoWindow(cmd)
124+
123125
output, err := cmd.Output()
124126
if err != nil {
125127
fmt.Println("Failed to get initial container states:", err)
@@ -402,6 +404,7 @@ func createShellCommandItem(containerName string) UIItem {
402404
Title: "Shell",
403405
Exec: getShellCommand(containerName),
404406
Icon: "ComputerIcon",
407+
Hide: true,
405408
}
406409
}
407410

0 commit comments

Comments
 (0)