Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- #Warn ; Enable warnings to assist with detecting common errors.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- #persistent
- Menu,Tray,DeleteAll
- Menu,Tray,NoStandard
- Menu,Tray,Add,Open Foobar2000,openFoobar
- Menu,Tray,Add
- Menu,Tray,Add,Reload
- Menu,Tray,Add,Exit,EXIT
- Menu, Tray, Add, PlayPause, lmao
- Menu, Tray, Default, PlayPause
- icon_play = %A_ScriptDir%\play_icon.ico
- icon_pause = %A_ScriptDir%\pause_icon.ico
- icon_stop = %A_ScriptDir%\stop_icon.ico
- OnMessage(0x404, "AHK_NOTIFYICON")
- AHK_NOTIFYICON(wParam, lParam, uMsg, hWnd)
- {
- if (lParam = 0x201) ;WM_LBUTTONDOWN := 0x201
- {
- Send {Media_Play_Pause}
- }
- }
- lastFileContent := ""
- setTimer, checkFile, 20
- return
- checkFile:
- fileread newFileContent, foobar_status.txt
- if(newFileContent != lastFileContent) {
- lastFileContent := newFileContent
- statusFoo=newFileContent
- if( newFileContent = "paused")
- Menu, Tray, Icon, %icon_pause%
- if( newFileContent = "playing")
- Menu, Tray, Icon, %icon_play%
- if( newFileContent = "stopped")
- Menu, Tray, Icon, %icon_stop%
- if( newFileContent = "not running")
- Menu, Tray, Icon, %icon_stop%
- }
- return
- lmao:
- Send {Media_Play_Pause}
- Return
- openFoobar:
- Run, Foobar2000
- return
- RELOAD:
- Reload
- Return
- SUSPEND:
- Suspend
- Return
- EXIT:
- ExitApp
- Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement