Skip to content

Commit

Permalink
fix: music player progress bar not updating correctly when paused in …
Browse files Browse the repository at this point in the history
…MacOS
  • Loading branch information
janoamaral committed Jan 12, 2025
1 parent fa259f3 commit e9c1e23
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/music-tmux-statusbar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,19 @@ elif command -v nowplaying-cli >/dev/null; then
else
DURATION=$(printf "%.0f" "${NPCLI_VALUES[duration]}")
POSITION=$(printf "%.0f" "${NPCLI_VALUES[elapsedTime]}")

# fix for the bug in nowplaying-cli.
# See https://github.com/janoamaral/tokyo-night-tmux/issues/107#issuecomment-2576211115
if [[ "$OSTYPE" == "darwin"* ]]; then
if [ "$STATUS" = "playing" ]; then
echo "$POSITION" >/tmp/last_position
fi

if [ "$STATUS" = "paused" ]; then
POSITION=$(cat /tmp/last_position)
fi
fi

fi
fi

Expand Down

0 comments on commit e9c1e23

Please sign in to comment.