This repository was archived by the owner on Jan 16, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed
Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 1717 <key >CFBundlePackageType </key >
1818 <string >APPL </string >
1919 <key >CFBundleShortVersionString </key >
20- <string >1.8.1 </string >
20+ <string >1.8.2 </string >
2121 <key >CFBundleVersion </key >
2222 <string >1 </string >
2323 <key >LSMinimumSystemVersion </key >
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ class SpotifyManager: NSObject {
4747
4848
4949 DispatchQueue . global ( qos: . default) . async {
50- self . startSpotify ( )
50+ self . startSpotify ( foreground : true )
5151
5252 _ = self . trackChanged ( )
5353 }
@@ -86,11 +86,18 @@ class SpotifyManager: NSObject {
8686 FSEventStreamStart ( fileEventStream!)
8787 }
8888
89- func startSpotify( ) {
89+ func startSpotify( foreground : Bool ) {
9090 let process = Process ( )
9191 // Open application with bundle identifier
9292 process. launchPath = " /usr/bin/open "
93- process. arguments = [ " --hide " , " -b " , " com.spotify.client " ]
93+
94+ var arguments : [ String ] = [ ]
95+ if ( !foreground) {
96+ arguments += [ " --hide " , " --background " ]
97+ }
98+ arguments += [ " -b " , " com.spotify.client " ]
99+
100+ process. arguments = arguments
94101 process. launch ( )
95102 process. waitUntilExit ( )
96103 }
@@ -225,7 +232,7 @@ class SpotifyManager: NSObject {
225232 isRestarting = true
226233 titleChangeHandler ( . ad)
227234 _ = runAppleScript ( script: SpotifyManager . appleScriptSpotifyPrefix + " quit " )
228- startSpotify ( )
235+ startSpotify ( foreground : false )
229236 DispatchQueue . main. asyncAfter ( deadline: . now( ) + 2 , execute: {
230237 self . spotifyPlay ( )
231238 DispatchQueue . main. asyncAfter ( deadline: . now( ) + 5 , execute: {
You can’t perform that action at this time.
0 commit comments