Skip to content

Commit

Permalink
Add TrayTip on various actions
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNightWolf committed Jul 27, 2016
1 parent 07b2fa8 commit deb1d33
Showing 1 changed file with 49 additions and 39 deletions.
88 changes: 49 additions & 39 deletions spotify.ahk
Original file line number Diff line number Diff line change
@@ -1,61 +1,71 @@
#SingleInstance Force

SoundState := 1
PausedState := 0

+!o::
WinGetTitle, Title, A
Gosub, ActivateSpot
if(SoundState = 1)
{
Loop, 20
WinGetTitle, Title, A
Gosub, ActivateSpot
if(SoundState = 1)
{
Send ^{Down}
Sleep, 20
Loop, 20
{
Send ^{Down}
Sleep, 20
}
TrayTip, Spotify, Muted
SoundState := 0
} else if(SoundState = 0) {
Loop, 20
{
Send ^{Up}
Sleep, 10
}
TrayTip, Spotify, Unmuted
SoundState := 1
}
SoundState := 0
WinActivate, %Title%
Return
}
if(SoundState = 0)
{
Loop, 20
{
Send ^{Up}
Sleep, 10

+!p::
WinGetTitle, Title, A
Gosub, ActivateSpot
Send {Space}
if(PausedState = 1){
TrayTip, Spotify, Unpaused
PausedState := 0
}else {
TrayTip, Spotify, Paused
PausedState := 1
}
SoundState := 1
WinActivate, %Title%
Return
}
Return

+!p::
WinGetTitle, Title, A
Gosub, ActivateSpot
Send {Space}
WinActivate, %Title%
Return

+!n::
WinGetTitle, Title, A
Gosub, ActivateSpot
Send ^{Right}
WinActivate, %Title%
Return
WinGetTitle, Title, A
Gosub, ActivateSpot
Send ^{Right}
WinActivate, %Title%
Return

+!t::
SongTitle := GetSpotWindow()
if(SongTitle = "Spotify"){
TrayTip, Current Spotify Song, Paused
SongTitle := GetSpotWindow()
if(SongTitle = "Spotify"){
TrayTip, Current Spotify Song, Paused
Return
}
TrayTip, Current Spotify Song, %SongTitle%
Return
}
TrayTip, Current Spotify Song, %SongTitle%
Return

ActivateSpot:
Spot := GetSpotWindow()
WinActivate, %Spot%
Return
Spot := GetSpotWindow()
WinActivate, %Spot%
Return

MinimizeSpot:
Spot := GetSpotWindow()
WinMinimize, %Spot%
Return

GetSpotWindow()
{
Expand Down

0 comments on commit deb1d33

Please sign in to comment.