forked from zzamboni/dot-hammerspoon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
skype_mute.lua
37 lines (29 loc) · 972 Bytes
/
skype_mute.lua
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
35
36
37
---- Skype stuff
---- Original code from https://github.com/cmsj/hammerspoon-config/blob/master/init.lua#L142
local mod={}
mod.config={
skype_mute_key = {{"alt", "cmd", "ctrl", "shift"}, 'v'}
}
-- From https://github.com/cmsj/hammerspoon-config/blob/master/init.lua#L139
-- Toggle Skype between muted/unmuted, whether it is focused or not
function mod.toggleSkypeMute()
local skype = hs.appfinder.appFromName("Skype")
if not skype then
return
end
local lastapp = nil
if not skype:isFrontmost() then
lastapp = hs.application.frontmostApplication()
skype:activate()
end
if not skype:selectMenuItem({"Conversations", "Mute Microphone"}) then
skype:selectMenuItem({"Conversations", "Unmute Microphone"})
end
if lastapp then
lastapp:activate()
end
end
function mod.init()
hs.hotkey.bind(mod.config.skype_mute_key[1], mod.config.skype_mute_key[2], mod.toggleSkypeMute)
end
return mod