mirror of
https://github.com/jimeh/dotfiles.git
synced 2026-02-19 10:26:42 +00:00
Add env module
This commit is contained in:
17
hammerspoon/env.lua
Normal file
17
hammerspoon/env.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
local obj = {
|
||||
hostname = nil
|
||||
}
|
||||
|
||||
function obj:init()
|
||||
self.hostname = self.getHostname()
|
||||
end
|
||||
|
||||
function obj:getHostname()
|
||||
local f = io.popen ("hostname")
|
||||
local hostname = f:read("*a") or ""
|
||||
f:close()
|
||||
hostname = string.gsub(hostname, "\n$", "")
|
||||
return hostname
|
||||
end
|
||||
|
||||
return obj
|
||||
@@ -4,6 +4,13 @@
|
||||
hs.hotkey.bind({'cmd', 'alt', 'ctrl'}, 'R', hs.reload)
|
||||
hs.hotkey.bind({'cmd', 'alt', 'ctrl'}, 'C', hs.toggleConsole)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Environment
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
local env = require('env')
|
||||
env:init()
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Set Hammerspoon options
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user