Skip to content

Commit

Permalink
feat(wezterm): remove Spotify from musicplaying
Browse files Browse the repository at this point in the history
The script does not work when Spotify is not actually installed, which
was the case after reinstalling my MacBook. As I do not intend to return
to Sporitfy support for Spotify is now removed.
  • Loading branch information
mrolli committed Jan 7, 2025
1 parent 390a007 commit d728ef3
Showing 1 changed file with 3 additions and 70 deletions.
73 changes: 3 additions & 70 deletions config/wezterm/musicplaying
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/osascript

on run
if application "Music" is running and application "Spotify" is not running then
if application "Music" is running then
tell application "Music"
if player state is stopped then
set display to "No Track Playing"
Expand All @@ -20,74 +20,7 @@ on run
set display to state & track_artist & " - " & track_name & " - " & (round ((seconds_played / track_duration) * 100)) & "%"
end if
end tell
else
set display to "Music app is not running"
end if
end run
# else if application "Spotify" is running and application "Music" is not running then
# tell application "Spotify"
# if player state is stopped then
# set display to "No Track Playing"
# else
# set track_artist to artist of current track
# set track_name to name of current track
# set track_duration to duration of current track
# set seconds_played to player position
# set state to ""
# if player state is paused then
# set state to " "
# else
# set state to " "
# end if
#
# set display to state & track_artist & " - " & track_name
# end if
# end tell
# else if application "Spotify" is running and application "Music" is running then
# --Get current states of Music and Spotify
# tell application "Music" to set MusicState to (player state as text)
# tell application "Spotify" to set spotifyState to (player state as text)
#
# if (MusicState is "paused" or MusicState is "stopped") and spotifyState is "playing" then
# tell application "Spotify"
# if player state is stopped then
# set display to "No Track Playing"
# else
# set track_artist to artist of current track
# set track_name to name of current track
# set track_duration to duration of current track
# set seconds_played to player position
# set state to ""
# if player state is paused then
# set state to " "
# else
# set state to " "
# end if
#
# set display to state & track_artist & " - " & track_name
# end if
# end tell
# end if
# else if MusicState is "playing" and (spotifyState is "paused" or spotifyState is "stopped") then
# tell application "Music"
# if player state is stopped then
# set display to "No Track Playing"
# else
# set track_artist to artist of current track
# set track_name to name of current track
# set track_duration to duration of current track
# set seconds_played to player position
# set state to ""
# if player state is paused then
# set state to " "
# else
# set state to " "
# end if
#
# set display to state & track_artist & " - " & track_name & " - " & (round ((seconds_played / track_duration) * 100)) & "%"
# end if
# end tell
# else if (MusicState is "paused" or MusicState is "stopped") and spotifyState is "paused" then
# set display to "No Track Playing"
# else
# set display to "No music app is running"
# end if
# end run

0 comments on commit d728ef3

Please sign in to comment.