Skip to content

Instantly share code, notes, and snippets.

@heptal
Last active July 18, 2016 10:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heptal/5c84f96d1913faf3b8aa to your computer and use it in GitHub Desktop.
Save heptal/5c84f96d1913faf3b8aa to your computer and use it in GitHub Desktop.
Removable volume manager in Hammerspoon

A simple menubar utility for opening/ejecting/managing removable volumes that looks good in OSX Dark mode:

Conveniently hides itself when no volumes are mounted and reappears when one is mounted:

Get it here - volumes.lua

Save as volumes.lua in ~/.hammerspoon/ and put volumes = require "volumes" in your init.lua

I use lua-stdlib (installed with luarocks-5.3 install stdlib) for the keys function but you can just as easily have your own:

local keys = function(t)
  local keys={}
  for k, v in pairs(t) do
    table.insert(keys, k)
  end
  table.sort(keys)
  return keys
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment