awesome: detect theme on (re)start

This commit is contained in:
Łukasz Pankowski 2025-03-29 13:38:56 +01:00
parent 6d8e00fabf
commit dd9de18aa7

View File

@ -51,7 +51,20 @@ end
-- {{{ Variable definitions
-- Themes define colours, icons, font and wallpapers.
local theme = "theme_dark.lua"
local function read_theme()
local theme = "theme_dark.lua"
local f = io.open(os.getenv('HOME') .. '/.config/alacritty/alacritty.toml')
if f then
if string.find(f:read('*all'), 'light') then
theme = 'theme_light.lua'
end
f:close()
return theme
end
end
local theme = read_theme()
beautiful.init(gears.filesystem.get_configuration_dir() .. theme)
local function set_wallpaper(s)