Compare commits

...

2 commits

Author SHA1 Message Date
857c36192d Hacer tema configurable 2022-04-21 13:35:24 -03:00
f525c0eaa1 gtk 2022-04-21 13:24:39 -03:00
2 changed files with 20 additions and 5 deletions

4
modules/gtk.lua Normal file
View file

@ -0,0 +1,4 @@
save_config('gtk', [[
[Settings]
gtk-application-prefer-dark-theme = {dark}
]], theme)

View file

@ -2,11 +2,6 @@
local templater = require 'utils/template'
theme = require 'themes/rose-pine-moon'
local status = os.execute("mkdir -p ~/.cache/themer.lua/")
if not (status == 0) then return status end
function expect_nil(result)
if result then
print("Error: "..result)
@ -15,6 +10,21 @@ function expect_nil(result)
return nil
end
local function read_file(path)
local file = io.open(path, "r")
if not file then return nil end
local content = file:read "*a" -- *a or *all reads the whole file
file:close()
return content
end
local theme_name_path = os.getenv('HOME').."/.config/themer.lua.theme"
local theme_name = read_file(theme_name_path)
theme = dofile("themes/"..theme_name..".lua")
local status = os.execute("mkdir -p ~/.cache/themer.lua/")
if not (status == 0) then return status end
function save_config(name, template, params)
local file, err = io.open("/home/diablo/.cache/themer.lua/"..name, "w+")
if not file then expect_nil(err) end
@ -29,4 +39,5 @@ require 'modules/fuzzel'
require 'modules/lock'
require 'modules/shell'
require 'modules/vis'
require 'modules/gtk'