feat: hide running Cocoa receiver from the Dock

This commit is contained in:
Danielle McLean 2025-04-30 12:46:47 +10:00
parent c2f67c4781
commit 28748df3c1
Signed by: 00dani
GPG key ID: 6854781A0488421C
2 changed files with 14 additions and 0 deletions

View file

@ -1,6 +1,7 @@
from collections.abc import Callable, Coroutine
from typing import Literal
from AppKit import NSApplication, NSApplicationActivationPolicyAccessory
from MediaPlayer import (
MPChangePlaybackPositionCommandEvent,
MPMusicPlaybackStatePlaying,
@ -42,6 +43,9 @@ class CocoaNowPlayingReceiver(Receiver):
pass
async def start(self, player: Player) -> None:
NSApplication.sharedApplication().setActivationPolicy_(
NSApplicationActivationPolicyAccessory
)
self.cmd_center = MPRemoteCommandCenter.sharedCommandCenter()
self.info_center = MPNowPlayingInfoCenter.defaultCenter()