-
Notifications
You must be signed in to change notification settings - Fork 1
/
zen.sh
executable file
·34 lines (30 loc) · 959 Bytes
/
zen.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
playlist='spotify:playlist:37i9dQZF1DWZeKCadgRdKQ'
# Play soothing music on Spotify
osascript -e '
log "Playing some soothing music on Spotify ..."
set volume output volume 5
tell application "Spotify"
set shuffling to true
set repeating to true
play track "'$playlist'"
set sound volume to 100
log track
set c to the current track
log the "Spotify is playing " & name of c & " by " & artist of c as text
end tell'
# Close distracting applications
osascript -e '
log "Closing distracting applications ..."
quit app "Mail"
log "Finished closing distracting applications"'
# Close distracting websites
osascript -e '
log "Closing distracting websites ..."
set closeURLs to {"reddit", "bbc", "theguardian", "calendar.google.com"}
repeat with theURL in closeURLs
tell application "Safari"
close (every tab of every window whose name contains theURL)
end tell
end repeat
log "Finished closing distracting websites ..."'