Skip to content

Instantly share code, notes, and snippets.

View bcosynot's full-sized avatar

Vivek Ranjan bcosynot

View GitHub Profile
@bcosynot
bcosynot / init.lua
Created August 24, 2022 16:02
Automatically close tab opened by your VPN connection
defaultBrowser = "<your browser>" -- Replace with "Google Chrome", "Firefox", "Vivaldi", or your favorite browser
function wait(seconds)
local start = os.time()
repeat until os.time() > start + seconds
end
urlOpenedByVpn = "<url opened by your vpn oges here>"
function closeTabOpenedByVpn(appName, eventType, appObject)
if (eventType == hs.application.watcher.activated) then
@bcosynot
bcosynot / init.lua
Created June 9, 2022 21:43
My hammerspoon config for automating/shortcutting common tasks
-- Shortcuts to launch or switch focus to specific apps
hs.hotkey.bind({"alt", "shift", "ctrl", "cmd"}, "i", function()
hs.application.launchOrFocus("IntelliJ IDEA")
end)
hs.hotkey.bind({"alt", "shift", "ctrl", "cmd"}, "b", function()
hs.application.launchOrFocus("Vivaldi")
end)
hs.hotkey.bind({"alt", "shift", "ctrl", "cmd"}, "t", function()