Extract host specific hammerspoon config to separate files

This commit is contained in:
2018-04-29 16:27:55 +01:00
parent 556960a588
commit 4eddfdf6ac
5 changed files with 65 additions and 41 deletions

View File

@@ -2,16 +2,13 @@ local obj = {
hostname = nil
}
function obj:init()
self.hostname = self.getHostname()
end
function obj:getHostname()
local f = io.popen ("hostname")
function obj.getHostname()
local f = io.popen ("hostname -s")
local hostname = f:read("*a") or ""
f:close()
hostname = string.gsub(hostname, "\n$", "")
return hostname
end
obj.hostname = obj.getHostname()
return obj