Skip to content

Instantly share code, notes, and snippets.

@braddevelop
braddevelop / hellfred-basics.hellfirepack-applications-2.lua
Created August 15, 2022 20:43
Hellfred Basics: hellfirepack-applications step 2
-- ... hellfred/extend/basics/hellfirepack-applications.lua
local _factory = function(trigger, app)
return {
trigger = trigger,
fireIfModeIs = _G.HELLFIRE_MODES.DEFAULT,
callback = function() hs.application.launchOrFocus(app) end
}
end
@braddevelop
braddevelop / hellfred-basics.hellfuzzpack-apps-and-links-2.lua
Created August 7, 2022 07:01
Hellfred Basics: hellfuzzpack-apps-and-links (add Links)
@braddevelop
braddevelop / hellfred-basics.hellfuzz-reg-app-subs.lua
Created August 7, 2022 06:57
Hellfred Basics: Hellfuzz - Register subs for applications and links
-- ... hellfred/hellfred-bootstrap.lua
-- Initialise Hellfuzz, passing a hotkey
hellfuzz.init({{'shift','alt'},'h'})
-- Load subscribers from packs
-- ... other code ...
hellfuzz.addSubscribers(require('hellfred.extend.basics.hellfuzzpack-apps-and-links'))
@braddevelop
braddevelop / hellfred-basics.hellfuzzpack-apps-and-links-1.lua
Created August 7, 2022 06:54
Hellfred Basics: hellfuzzpack-apps-and-links (the apps)
@braddevelop
braddevelop / hellfred-basics.hellfuzz-subs-struct.lua
Created August 7, 2022 06:49
Hellfred Basics: Hellfuzz subscriber structure
-- Structure of a Hellfuzz subscriber
{
choice = {
text, -- The choice text
subText, -- Supplementary choice text
image, -- An optional thumbnail image
},
callback, -- A function to action when this choice is selected
nextChoicesFn, -- Returns a new set of subscribers
showInFirstChoiceSet -- Show this choice when Hellfuzz opens
@braddevelop
braddevelop / hellfred-basics.init-hellfuzz.lua
Created August 7, 2022 06:47
Hellfred Basics: Initialise Hellfuzz
-- ... hellfred/hellfred-bootstrap.lua
local hellfuzz = require('hellfred.hellfuzz.hellfuzz')
-- Initialise Hellfuzz, passing a hotkey
hellfuzz.init({{'shift','alt'},'h'})
@braddevelop
braddevelop / hellfred-basics.hellprompt-reg-commands-subs.lua
Created August 7, 2022 06:44
Hellfred Basics: Hellprompt - Register subs for commands
-- ... hellfred/hellfred-bootstrap.lua
local hellprompt = require('hellfred.hellprompt.hellprompt')
-- Initialise Hellprompt, passing a hotkey
hellprompt.init({{'shift','ctrl'},'h'})
-- Load subscribers from packs
-- ... other code ...
hellprompt.addSubscribers(require('hellfred.extend.basics.hellpromptpack-commands'))
@braddevelop
braddevelop / hellfred-basics.hellpromptpack-commands.lua
Last active August 7, 2022 06:41
Hellfred Basics: hellpromptpack-commands
-- ... hellfred/extend/basics/hellpromptpack-commands.lua
-- Map strings to urls
local _linkMap = {
so = 'https://stackoverflow.com/',
news = 'https://news.ycombinator.com/',
github = 'https://github.com',
}
-- Map strings to name of applications
@braddevelop
braddevelop / hellfred-basics.hellprompt-subs-struct.lua
Created August 7, 2022 06:37
Hellfred Basics: Hellprompt subscriber structure
-- Structure of a Hellprompt subscriber
{
filter, -- [optional] Used to filter the user command. A positive match flags the execution of the following callback...
callback -- a function that wraps an action/behaviour
}
@braddevelop
braddevelop / hellfred-basics.init-hellprompt.lua
Last active August 9, 2022 05:30
Hellfred Basics: Initialise Hellprompt
-- ... hellfred/hellfred-bootstrap.lua
local hellprompt = require('hellfred.hellprompt.hellprompt')
-- Initialise Hellprompt, passing a hotkey
hellprompt.init({{'shift','ctrl'},'h'})