Skip to content

Commit b4e9d8b

Browse files
committed
added port args
1 parent 81f8504 commit b4e9d8b

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

darwin/systray/systray/AppDelegate.m

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ @implementation AppDelegate
66

77
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
88
{
9+
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
10+
port = [[defaults objectForKey: @"xilp_systray_port"] intValue];
11+
if (port <= 0) {
12+
port = 6333;
13+
}
914
host = @"127.0.0.1";
10-
port = 6333;
1115

1216
statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength];
1317
[statusItem setAction:@selector(clicked:)];
Binary file not shown.

traysvr.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ import (
1414

1515
func (p *_SystraySvr) Run() error {
1616
go func() {
17-
_, err := exec.Command(p.clientPath).Output()
17+
if len(p.clientPath) == 0 {
18+
return
19+
}
20+
_, err := exec.Command(p.clientPath, "-xilp_systray_port", strconv.Itoa(p.port)).Output()
1821
if err != nil {
1922
panic(err)
2023
}

0 commit comments

Comments
 (0)