Skip to content

Instantly share code, notes, and snippets.

@alfonmga
Last active May 4, 2023 00:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alfonmga/e714b91475568629aacfb0a5251d0436 to your computer and use it in GitHub Desktop.
Save alfonmga/e714b91475568629aacfb0a5251d0436 to your computer and use it in GitHub Desktop.
//go:build darwin
package common
/*
#cgo CFLAGS: -x objective-c
#cgo LDFLAGS: -framework Cocoa
#import <Cocoa/Cocoa.h>
int
SetActivationPolicy(void) {
[NSApp setActivationPolicy:NSApplicationActivationPolicyAccessory];
return 0;
}
*/
import "C"
func HideMacDockIcon() {
C.SetActivationPolicy()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment