Skip to content

Instantly share code, notes, and snippets.

@peetzweg
Created November 6, 2020 10:09
Show Gist options
  • Save peetzweg/dbd32e023a36f556fb285061a9915858 to your computer and use it in GitHub Desktop.
Save peetzweg/dbd32e023a36f556fb285061a9915858 to your computer and use it in GitHub Desktop.
local modifier = {"alt", "cmd"}
local homeDir = os.getenv("HOME")
local sounds = {
[1] = "mgs.mp3",
[2] = "wow.mp3",
[3] = "nice.m4a",
[4] = "LennartLache.wav",
[5] = "dumm.m4a",
[9] = "boah_alta_geil.mp3",
-- [6]="msg.mp3",
-- [7]="msg.mp3",
[8] = "abgeschmatzt.m4a",
-- [9]="msg.mp3",
[0] = "aktex.m4a"
}
local playSound = function(sound)
return function()
hs.sound.getByFile(homeDir .. "/.hammerspoon/sounds/" .. sound):play()
end
end
for key, sound in pairs(sounds) do
print(key, sound)
hs.hotkey.bind(modifier, tostring(key), playSound(sound))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment