Compare commits
2 commits
35fee185e7
...
857c36192d
Author | SHA1 | Date | |
---|---|---|---|
857c36192d | |||
f525c0eaa1 |
2 changed files with 20 additions and 5 deletions
4
modules/gtk.lua
Normal file
4
modules/gtk.lua
Normal file
|
@ -0,0 +1,4 @@
|
|||
save_config('gtk', [[
|
||||
[Settings]
|
||||
gtk-application-prefer-dark-theme = {dark}
|
||||
]], theme)
|
21
themer.lua
21
themer.lua
|
@ -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'
|
||||
|
||||
|
|
Loading…
Reference in a new issue