mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2024-12-13 11:42:57 +01:00
add local conf feature to confgen.lua
This commit is contained in:
parent
878fa57567
commit
eb7513b2f6
4 changed files with 13 additions and 2 deletions
1
.config/gtk-3.0/.gitignore
vendored
1
.config/gtk-3.0/.gitignore
vendored
|
@ -1 +0,0 @@
|
|||
bookmarks
|
|
@ -278,3 +278,4 @@ bar {
|
|||
}
|
||||
}
|
||||
|
||||
<% opt.getDeviceConf("i3") %>
|
||||
|
|
1
.config/touchegg/.gitignore
vendored
1
.config/touchegg/.gitignore
vendored
|
@ -1 +0,0 @@
|
|||
*.lock
|
12
confgen.lua
12
confgen.lua
|
@ -6,3 +6,15 @@ cg.addPath ".cargo"
|
|||
for k, v in pairs(require "cg_opts") do
|
||||
cg.opt[k] = v
|
||||
end
|
||||
|
||||
-- This function is called in templates to allow adding device-specific configs.
|
||||
cg.opt.getDeviceConf = function(id)
|
||||
local path = os.getenv "HOME" .. "/.config/mzte_localconf/" .. id
|
||||
local file = io.open(path, "r")
|
||||
|
||||
if file == nil then
|
||||
return ""
|
||||
end
|
||||
|
||||
return file:read "*a"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue