Skip to content

Commit

Permalink
MusicAppMediaFix: pause all apps other than the current
Browse files Browse the repository at this point in the history
  • Loading branch information
brechtm committed Jun 15, 2023
1 parent 4159cc4 commit c70e04c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Source/MusicAppMediaFix.spoon/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ function obj.mediaKeyCallback(event)

-- handle action
if data["down"] == false or data["repeat"] == true then
for i, app in pairs(obj.mediaApps) do
if app ~= obj.currentApp then
hs.osascript.applescript('tell application "' .. app .. '" to pause')
end
end
if data["key"] == "PLAY" then
hs.applescript('tell application "' .. obj.currentApp .. '" to playpause')
elseif data["key"] == "FAST" then
Expand Down

0 comments on commit c70e04c

Please sign in to comment.