Skip to content

diosmiodio/spotifyAlarm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

So I made this script because I'm utterly dependent on spotify and I wanted to setup a process of grabbing a random song from a playlist and using it to wake me up. This is basically a collection of me grabbing random bits and pieces and making them make sense to together to work.

Preparing the Script.

to setup the script to use your playlist youre going to have to do the following

  1. Right click on your desired playlist
  2. Go to Share > Copy Spotify URI
  3. This will give you a link that looks like this spotify:user:1262074972:playlist:0e17t6YdVz9KfHN1OwJwS4
  4. Open up your AppleScript Editor & copy or open the .scpt file in this repository.
  5. Paste the copied Spotify URI at the top of the script within the quotation marks set playlist to "COPY YOUR PLAYLIST URI HERE"
  6. Save the script

Running the Script as an Alarm

  1. Open up your Terminal Application
  2. Type in crontab -e and press enter.
  3. Press the "i" key on your keyboard (this takes you into "insert" mode)
  4. Set the time you want the script to run (p.s. it reads military time)

for clarity, I'm providing a chart below showing the syntax of the command

┌───────────── minute (0 - 59)'
│ ┌───────────── hour (0 - 23)'
│ │ ┌───────────── day of month (1 - 31)
│ │ │ ┌───────────── month (1 - 12)
│ │ │ │ ┌───────────── day of week (0 - 6) (Sunday to Saturday;
│ │ │ │ │                                       7 is also Sunday on some systems)
│ │ │ │ │
│ │ │ │ │
* * * * *  command_to_execute
  1. set your wake up time (for this example, I'll set it to 6:00 AM)
    • 0 6 * * * command_to_execute
  2. where it says command to execute, replace it with the path to your script. i.e. Users/username/Documents/spotifyWakeUp.scpt
  3. press the esc key to stop editing
  4. type in :wq! to exit and save

Thats it, now a crontab job is set to run your script at that time!

About

This script grabs a Spotify playlist of your choosing and plays a random song to incrementally wake you up when setup with crontab.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published