mirror of
https://github.com/jimeh/dotfiles.git
synced 2026-02-19 12:26:39 +00:00
Extract host specific hammerspoon config to separate files
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user