mirror of
https://github.com/jimeh/dotfiles.git
synced 2026-02-19 13:46:41 +00:00
Major update to Hammerspoon config
- Use Spoons (installed via Makefile targets): - RoundedCorners - HeadphoneAutoPause (with AutoResume patch) - Move windows management into separate file
This commit is contained in:
35
hammerspoon/Spoons/HeadphoneAutoPause.spoon.patch
Normal file
35
hammerspoon/Spoons/HeadphoneAutoPause.spoon.patch
Normal file
@@ -0,0 +1,35 @@
|
||||
--- Spoons/HeadphoneAutoPause.spoon/init.lua 2017-06-30 10:08:18.000000000 +0100
|
||||
+++ Spoons/HeadphoneAutoPause.patched.spoon/init.lua 2017-08-05 11:57:44.000000000 +0100
|
||||
@@ -37,6 +37,13 @@ obj.control = {
|
||||
vox = false
|
||||
}
|
||||
|
||||
+--- HeadphoneAutoPause.autoResume
|
||||
+--- Variable
|
||||
+--- Boolean value indicating if music should be automatically resumed when headphones are plugged in again. Only works if music was automatically paused when headphones were unplugged.
|
||||
+---
|
||||
+--- Default value: `true`
|
||||
+obj.autoResume = true
|
||||
+
|
||||
--- HeadphoneAutoPause.defaultControlFns(app)
|
||||
--- Method
|
||||
--- Generate the most common set of application control definition.
|
||||
@@ -91,11 +98,13 @@ function obj:audiodevwatch(dev_uid, even
|
||||
if event_name == 'jack' then
|
||||
if dev:jackConnected() then
|
||||
self.logger.d("Headphones connected")
|
||||
- for app, playercontrol in pairs(self.controlfns) do
|
||||
- if self.control[app] and hs.appfinder.appFromName(playercontrol.appname) and wasplaying[app] then
|
||||
- self.logger.df("Resuming playback in %s", playercontrol.appname)
|
||||
- hs.notify.show("Headphones plugged", "Resuming " .. playercontrol.appname .. " playback", "")
|
||||
- playercontrol.play()
|
||||
+ if self.autoResume then
|
||||
+ for app, playercontrol in pairs(self.controlfns) do
|
||||
+ if self.control[app] and hs.appfinder.appFromName(playercontrol.appname) and wasplaying[app] then
|
||||
+ self.logger.df("Resuming playback in %s", playercontrol.appname)
|
||||
+ hs.notify.show("Headphones plugged", "Resuming " .. playercontrol.appname .. " playback", "")
|
||||
+ playercontrol.play()
|
||||
+ end
|
||||
end
|
||||
end
|
||||
else
|
||||
Reference in New Issue
Block a user