Earlier quoted context omitted.
Another fun thing you can do is install Hammerspoon as your URL handler, and make certain URLs open in different Chrome profiles--any work websites open in my work Chrome profile, websites related to a game I play opens in a Chrome profile specific to that, and anything else opens up in a personal Chrome profile. I've also setup cmd+shift+1/2/3 to brings the aforementioned profiles into the foreground, so e.g. cmd+sh…
I've wanted to send YouTube links directly to VNC for ages, while having all others open in the default browser, but have never taken the time to hack up a listener. I already use Hammerspoon, so this should be a piece of cake to add. Thanks for mentioning this ability!
Hammerspoon – Lua-based powerful tool automation of macOS
41–50 of 84 posts
Re: Hammerspoon – Lua-based powerful tool automation of macOS
#42Earlier quoted context omitted.
I've wanted to send YouTube links directly to VNC for ages, while having all others open in the default browser, but have never taken the time to hack up a listener. I already use Hammerspoon, so this should be a piece of cake to add. Thanks for mentioning this ability!
I believe this is the implementation I based mine on: https://github.com/zzamboni/dot-hammerspoon/blob/master/init...
Re: Hammerspoon – Lua-based powerful tool automation of macOS
#43I fell briefly in love with Hammerspoon, but stopped using it. My MacOS automation is now my QMK keyboard calling Alfred workflows; I use Yabai for window management. I admire Lua, but ran into some sharp edges learning to program in it. Still, one can get up to speed quickly if one knows other scripting languages. Hammerspoon window management was deathly slow. Yabai is close to instantaneous.
Re: Hammerspoon – Lua-based powerful tool automation of macOS
#44Just curious do people use these types of automations to help with coding/software engineering? If so, in what way?
Re: Hammerspoon – Lua-based powerful tool automation of macOS
#45Re: Hammerspoon – Lua-based powerful tool automation of macOS
#46I fell briefly in love with Hammerspoon, but stopped using it. My MacOS automation is now my QMK keyboard calling Alfred workflows; I use Yabai for window management. I admire Lua, but ran into some sharp edges learning to program in it. Still, one can get up to speed quickly if one knows other scripting languages. Hammerspoon window management was deathly slow. Yabai is close to instantaneous.
Re: Hammerspoon – Lua-based powerful tool automation of macOS
#47Really nice at first sight. I'm getting melancholic vibes of AutoHotKey reading the docs, which was arguably my first entry into professional programming. Knowing nothing about coding, I built a service desk automation back then — with (network file-) shared hotkeys and a real GUI, all in one single file... good times. Anyway, ever since switching to MacOS more than a decade ago, I've always been searching for an AHK…
Re: Hammerspoon – Lua-based powerful tool automation of macOS
#48I fell briefly in love with Hammerspoon, but stopped using it. My MacOS automation is now my QMK keyboard calling Alfred workflows; I use Yabai for window management. I admire Lua, but ran into some sharp edges learning to program in it. Still, one can get up to speed quickly if one knows other scripting languages. Hammerspoon window management was deathly slow. Yabai is close to instantaneous.
Re: Hammerspoon – Lua-based powerful tool automation of macOS
#49I love Hammerspoon. It's one of the first must-have-for-a-usable-laptop tools I set up when I get a new MacBook. Here are the top ways I'm using it right now: 1) Hide/show apps similar to how iTerm lets you bind a hotkey to hide/show a terminal. I've got ctrl+space set to Vimcal, alt+space set to midnight.app (a time tracker I'm building), and ctrl+alt+space set to Things. 2) Start/stop playing my work playlist of lo…
Re: Hammerspoon – Lua-based powerful tool automation of macOS
#50 local function insertDB(db, linkval, value)
local url = tostring(linkVal)
local categ = tostring(value)
db:exec[=[
INSERT INTO bookmarks VALUES (NULL,`url`,`categ`)
]=]
end
hs.hotkey.bind({"alt", "ctrl"}, "S", function()
db = hs.sqlite3.open('/dropbox/user/bookmarks.db')
local insert_stmt = assert( db:prepare("INSERT INTO
bookmarks VALUES (NULL, ?, ?)") )
local url = hs.pasteboard.getContents()
local tag, value = hs.dialog.textPrompt(url, "Please enter
category:");
if tag == 'OK' then
insert_stmt:bind_values(url, value)
insert_stmt:step()
insert_stmt:reset()
-- insertDB(db, linkVal, value)
end
end)