Files
dotfiles/hammerspoon/init.lua
Jim Myhrberg 2ff0508f13 Update PushToTalk spoon to check list of apps when starting
These changes have been submitted as a PR against the main Spoons
repository here: https://github.com/Hammerspoon/Spoons/pull/169
2020-05-06 20:40:19 +01:00

55 lines
1.9 KiB
Lua

-- luacheck: read_globals hs spoon
-- Reload config hotkey
hs.hotkey.bind({'cmd', 'alt', 'ctrl'}, 'R', hs.reload)
hs.hotkey.bind({'cmd', 'alt', 'ctrl'}, 'C', hs.toggleConsole)
--------------------------------------------------------------------------------
-- Set Hammerspoon options
--------------------------------------------------------------------------------
hs.autoLaunch(true)
hs.consoleOnTop(true)
hs.dockIcon(false)
hs.menuIcon(true)
hs.console.alpha(0.90)
hs.console.behaviorAsLabels { 'moveToActiveSpace' }
--------------------------------------------------------------------------------
-- Load Spoons
--------------------------------------------------------------------------------
-- Draw pretty rounded corners on all screens.
hs.loadSpoon('RoundedCorners')
spoon.RoundedCorners:start()
-- Automatically pause music when headphones are unplugged.
hs.loadSpoon('HeadphoneAutoPause')
spoon.HeadphoneAutoPause.autoResume = false
spoon.HeadphoneAutoPause:start()
-- Enable push-to-talk microphone functionality when specific apps are running.
hs.loadSpoon('PushToTalk')
spoon.PushToTalk.detect_on_start = true
spoon.PushToTalk.app_switcher = { ['TeamSpeak 3'] = 'push-to-talk' }
spoon.PushToTalk:start()
--------------------------------------------------------------------------------
-- Host specific configuration
--------------------------------------------------------------------------------
local hostconfig = require('host_config')
hostconfig:init()
--------------------------------------------------------------------------------
-- Window management
--------------------------------------------------------------------------------
local wm = require('window_management')
wm:init()
--------------------------------------------------------------------------------
-- The End
--------------------------------------------------------------------------------
hs.alert.show('Hammerspoon loaded')