mirror of
https://github.com/powerline/powerline.git
synced 2025-04-08 19:25:04 +02:00
Increase indentation of osascript code in spotify player
This commit is contained in:
parent
86c9e998d1
commit
a9c397e5e6
@ -1160,27 +1160,27 @@ class NowPlayingSegment(Segment):
|
|||||||
def player_spotify_apple_script(self, pl):
|
def player_spotify_apple_script(self, pl):
|
||||||
status_delimiter = '-~`/='
|
status_delimiter = '-~`/='
|
||||||
ascript = '''
|
ascript = '''
|
||||||
tell application "System Events"
|
tell application "System Events"
|
||||||
set process_list to (name of every process)
|
set process_list to (name of every process)
|
||||||
end tell
|
|
||||||
|
|
||||||
if process_list contains "Spotify" then
|
|
||||||
tell application "Spotify"
|
|
||||||
if player state is playing or player state is paused then
|
|
||||||
set track_name to name of current track
|
|
||||||
set artist_name to artist of current track
|
|
||||||
set album_name to album of current track
|
|
||||||
set track_length to duration of current track
|
|
||||||
set now_playing to "" & player state & "{0}" & album_name & "{0}" & artist_name & "{0}" & track_name & "{0}" & track_length
|
|
||||||
return now_playing
|
|
||||||
else
|
|
||||||
return player state
|
|
||||||
end if
|
|
||||||
|
|
||||||
end tell
|
end tell
|
||||||
else
|
|
||||||
return "stopped"
|
if process_list contains "Spotify" then
|
||||||
end if
|
tell application "Spotify"
|
||||||
|
if player state is playing or player state is paused then
|
||||||
|
set track_name to name of current track
|
||||||
|
set artist_name to artist of current track
|
||||||
|
set album_name to album of current track
|
||||||
|
set track_length to duration of current track
|
||||||
|
set now_playing to "" & player state & "{0}" & album_name & "{0}" & artist_name & "{0}" & track_name & "{0}" & track_length
|
||||||
|
return now_playing
|
||||||
|
else
|
||||||
|
return player state
|
||||||
|
end if
|
||||||
|
|
||||||
|
end tell
|
||||||
|
else
|
||||||
|
return "stopped"
|
||||||
|
end if
|
||||||
'''.format(status_delimiter)
|
'''.format(status_delimiter)
|
||||||
|
|
||||||
spotify = asrun(pl, ascript)
|
spotify = asrun(pl, ascript)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user