diff --git a/themes/night/background.png b/themes/night/background.png deleted file mode 100644 index d7f7a1c9f..000000000 Binary files a/themes/night/background.png and /dev/null differ diff --git a/themes/night/theme.lua b/themes/night/theme.lua index 0f482dc18..a5d84d91e 100644 --- a/themes/night/theme.lua +++ b/themes/night/theme.lua @@ -1,19 +1,19 @@ ------------------------------------------- --- Aesthetic Night awesomewm theme -- --- Created by https://github.com/rxyhn -- ------------------------------------------- +-------------------------------------------- +--- Aesthetic Night awesomewm theme --- +--- Created by https://github.com/rxyhn --- +-------------------------------------------- local theme_assets = require("beautiful.theme_assets") local xresources = require("beautiful.xresources") local rnotification = require("ruled.notification") local dpi = xresources.apply_dpi -local gfs = require("gears.filesystem") +local gears = require("gears") +local gfs = gears.filesystem local themes_path = gfs.get_themes_dir() --- inherit default theme -local theme = dofile(themes_path .. "default/theme.lua") --- load vector assets' generators for this theme +-- inherit xresources theme: +local theme = dofile(themes_path .. "xresources/theme.lua") theme.font = "sans 8" @@ -55,8 +55,39 @@ theme.menu_width = dpi(100) -- Notification theme.notification_border_color = theme.border_color_active --- Wallpaper -theme.wallpaper = themes_path .. "night/background.png" +-- Generate wallpaper: +local wallpaper_bg = "#162026" +local wallpaper_fg = theme.fg_normal +local wallpaper_alt_fg = theme.fg_focus + +local rsvg = pcall(function() + return require("lgi").Rsvg +end) + +if rsvg then + local handle = require("lgi").Rsvg.Handle.new_from_file(themes_path .. "xresources/wallpaper.svg") + + if handle then + handle:set_stylesheet([[ + .normal { + fill: ]] .. wallpaper_fg .. [[; + } + .background { + fill: ]] .. wallpaper_bg .. [[; + stroke: ]] .. wallpaper_bg .. [[; + } + .logo { + fill: ]] .. wallpaper_alt_fg .. [[; + } + ]]) + + theme.wallpaper = handle + end +else + gears.debug.print_warning("Could not load the wallpaper: librsvg is not installed.") +end + +theme.wallpaper_bg = wallpaper_bg -- Recolor Layout icons: theme = theme_assets.recolor_layout(theme, theme.fg_normal)