OPiMedia

spotify.sh

Jun 6th, 2018 (edited)
13,794
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2. # Runs Spotify, and after that blockify.
  3. # Redirects standard and error outputs to log file for both
  4. # November 2, 2021
  5. #
  6. # blockify:
  7. # https://github.com/serialoverflow/blockify
  8. #
  9.  
  10. BLOCKIFYDIR=~/.config/blockify/addlogs
  11.  
  12. BLOCKIFYLOG=$BLOCKIFYDIR/blockify.log
  13. SPOTIFYLOG=$BLOCKIFYDIR/spotify.log
  14.  
  15. DATE=$(date)
  16. HEADER="\\n==============================\\n$DATE"
  17.  
  18. mkdir -p $BLOCKIFYDIR
  19.  
  20. echo Run Spotify
  21. echo "$HEADER" >> "$SPOTIFYLOG"
  22. spotify >> "$SPOTIFYLOG" 2>&1 &
  23.  
  24. sleep 10
  25.  
  26. echo Run blockify
  27. echo "$HEADER" >> "$BLOCKIFYLOG"
  28. blockify >> "$BLOCKIFYLOG" 2>&1 &
  29.  
RAW Paste Data Copied