this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

hammerspoon: volume controls

+22
+22
hammerspoon/init.lua
··· 71 71 win:setFrame(positions[cycleState.e]) 72 72 end) 73 73 74 + -- Volume control 75 + local volumeStep = 5 76 + local volumeMods = { "ctrl", "shift", "cmd" } 77 + local volumeAlertId = nil 78 + 79 + local function showVolumeAlert(vol) 80 + if volumeAlertId then hs.alert.closeSpecific(volumeAlertId) end 81 + volumeAlertId = hs.alert.show("Volume: " .. math.floor(vol) .. "%") 82 + end 83 + 84 + hs.hotkey.bind(volumeMods, "=", function() 85 + local device = hs.audiodevice.defaultOutputDevice() 86 + device:setVolume(math.min(100, device:volume() + volumeStep)) 87 + showVolumeAlert(device:volume()) 88 + end) 89 + 90 + hs.hotkey.bind(volumeMods, "-", function() 91 + local device = hs.audiodevice.defaultOutputDevice() 92 + device:setVolume(math.max(0, device:volume() - volumeStep)) 93 + showVolumeAlert(device:volume()) 94 + end) 95 + 74 96 hs.alert.show("Config loaded")