I have simple zsh script which executes the following code at a regular interval.

spotify_track=`osascript -e 'tell application "Spotify" to name of current track as string'`;

This is causes loginwindow process to consume high cpu (around 9-10%). Is osascript and loginwindow process related?

  • Are you interested in tracing the osascript to see what goes on? And how are you invoking zsh, as a logon shell? That would perhaps have something to do with it... – Francis from ResponseBase Aug 15 '18 at 18:22
  • @FrancisfromResponseBase yup. any idea around how can I debug? also I'm using about script to display spotify track on zsh prompt. prompt is updated every 2 seconds using zsh TRAPALRM and zle reset-prompt feature – mohitmun Aug 16 '18 at 6:43

You must log in to answer this question.

Browse other questions tagged .