Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client id exposed #2

Open
JonathanDoughty opened this issue Dec 1, 2018 · 0 comments
Open

client id exposed #2

JonathanDoughty opened this issue Dec 1, 2018 · 0 comments

Comments

@JonathanDoughty
Copy link

You might not want your unsplash client id exposed for the world
https://github.com/cmsj/hammerspoon-config/blob/master/init.lua#L507

One of the hammerspoon abilities I love most is the ability to use it to access passwords and generic info in KeyChain:

function extractPassword(type, service)
local cmd = "security " .. type .. " -s " .. service .. " -a " .. os.getenv("USER") .. " -w"
local str_p, status = hs.execute(cmd)
str_p = string.gsub(str_p, "\n", "")
return str_p
end

used like:
hs.hotkey.bind({"cmd", "alt"}, "S", nil, function()
-- CLI: security add-generic-password -a ${USER} -s "ssh passphrase" -w
local str_p = extractPassword("find-generic-password", "'ssh passphrase'")
str_p = string.gsub(str_p, "\n", "") -- trim newline
hs.eventtap.keyStrokes(str_p)
end)

or
hs.hotkey.bind({"cmd", "alt"}, "P", nil, function()
-- CLI: security add-internet-password -a ${USER} -s $(hostname) -w
local str_p = extractPassword("find-internet-password", hs.host.localizedName())
str_p = string.gsub(str_p, "\n", "") -- trim newline
hs.eventtap.keyStrokes(str_p)
end)

the latter is golden for the countless times I get asked each day for my password on work web sites.

Thanks for all the work you put into Hammerspoon - it makes my Mac life far nicer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant