AwesomeWM does not read new theme correctly (?)

Ok, first of all let’s start saying that I’ve used awesome for a long time before (4/5 years ago), but I don’t know if I’m doing something wrong because I’m very rusty or if simply something as changed and I cannot find where it is said that it is so.
That out of the way my problem is more or less already stated in the tile:
I’ve followed the wiki for changing the theme in my rc.lua config with this

local theme_path = string.format("%s/.config/awesome/themes/%s/theme.lua", os.getenv("HOME"), "material")
beautiful.init(theme_path)

then I’ve copied the default theme folder in

.config/awesome/themes/default

and rename it material.
After that I’ve edited theme.lua in this way,

-- Define the image to load
theme.titlebar_close_button_normal = themes_path.."material/titlebar/close_normal.png"
theme.titlebar_close_button_focus  = themes_path.."material/titlebar/close_focus.png"

theme.titlebar_minimize_button_normal = themes_path.."material/titlebar/minimize_normal.png"
theme.titlebar_minimize_button_focus  = themes_path.."material/titlebar/minimize_focus.png"

theme.titlebar_ontop_button_normal_inactive = themes_path.."material/titlebar/ontop_normal_inactive.png"
theme.titlebar_ontop_button_focus_inactive  = themes_path.."material/titlebar/ontop_focus_inactive.png"
theme.titlebar_ontop_button_normal_active = themes_path.."material/titlebar/ontop_normal_active.png"
theme.titlebar_ontop_button_focus_active  = themes_path.."material/titlebar/ontop_focus_active.png"

theme.titlebar_sticky_button_normal_inactive = themes_path.."material/titlebar/sticky_normal_inactive.png"
theme.titlebar_sticky_button_focus_inactive  = themes_path.."material/titlebar/sticky_focus_inactive.png"
theme.titlebar_sticky_button_normal_active = themes_path.."material/titlebar/sticky_normal_active.png"
theme.titlebar_sticky_button_focus_active  = themes_path.."material/titlebar/sticky_focus_active.png"

theme.titlebar_floating_button_normal_inactive = themes_path.."material/titlebar/floating_normal_inactive.png"
theme.titlebar_floating_button_focus_inactive  = themes_path.."material/titlebar/floating_focus_inactive.png"
theme.titlebar_floating_button_normal_active = themes_path.."material/titlebar/floating_normal_active.png"
theme.titlebar_floating_button_focus_active  = themes_path.."material/titlebar/floating_focus_active.png"

theme.titlebar_maximized_button_normal_inactive = themes_path.."material/titlebar/maximized_normal_inactive.png"
theme.titlebar_maximized_button_focus_inactive  = themes_path.."material/titlebar/maximized_focus_inactive.png"
theme.titlebar_maximized_button_normal_active = themes_path.."material/titlebar/maximized_normal_active.png"
theme.titlebar_maximized_button_focus_active  = themes_path.."material/titlebar/maximized_focus_active.png"

theme.wallpaper = themes_path.."material/lovely_night.jpg"

-- You can use your own layout icons like this:
theme.layout_fairh = themes_path.."material/layouts/fairhw.png"
theme.layout_fairv = themes_path.."material/layouts/fairvw.png"
theme.layout_floating  = themes_path.."material/layouts/floatingw.png"
theme.layout_magnifier = themes_path.."material/layouts/magnifierw.png"
theme.layout_max = themes_path.."material/layouts/maxw.png"
theme.layout_fullscreen = themes_path.."material/layouts/fullscreenw.png"
theme.layout_tilebottom = themes_path.."material/layouts/tilebottomw.png"
theme.layout_tileleft   = themes_path.."material/layouts/tileleftw.png"
theme.layout_tile = themes_path.."material/layouts/tilew.png"
theme.layout_tiletop = themes_path.."material/layouts/tiletopw.png"
theme.layout_spiral  = themes_path.."material/layouts/spiralw.png"
theme.layout_dwindle = themes_path.."material/layouts/dwindlew.png"
theme.layout_cornernw = themes_path.."material/layouts/cornernww.png"
theme.layout_cornerne = themes_path.."material/layouts/cornernew.png"
theme.layout_cornersw = themes_path.."material/layouts/cornersww.png"
theme.layout_cornerse = themes_path.."material/layouts/cornersew.png"

but nothing changed. Or at least, the wallpaper is now solid black, and all the icons are gone, as if the file don’t exists (even if obviously they are all there).

Any idea what’s I’m doing wrong?

What about

"%s/.config/awesome/themes/default/%s/theme.lua"

I suppose your directory is something like home/.config/awesome/themes/default/material/theme.lua

Edit : If the new path I gave does not fix it for you, please share the output of this command

tree ~/.config/awesome

I’ve checked but isn’t the problem. My tree is

/home/nemo/.config/awesome
├── rc.lua
└── themes
    └── material
        ├── background.png
        ├── background_white.png
        ├── layouts
        │   ├── cornerne.png
        │   ├── cornernew.png
        │   ├── cornernw.png
        │   ├── cornernww.png
        │   ├── cornerse.png
        │   ├── cornersew.png
        │   ├── cornersw.png
        │   ├── cornersww.png
        │   ├── dwindle.png
        │   ├── dwindlew.png
        │   ├── fairh.png
        │   ├── fairhw.png
        │   ├── fairv.png
        │   ├── fairvw.png
        │   ├── floating.png
        │   ├── floatingw.png
        │   ├── fullscreen.png
        │   ├── fullscreenw.png
        │   ├── magnifier.png
        │   ├── magnifierw.png
        │   ├── max.png
        │   ├── maxw.png
        │   ├── spiral.png
        │   ├── spiralw.png
        │   ├── tilebottom.png
        │   ├── tilebottomw.png
        │   ├── tileleft.png
        │   ├── tileleftw.png
        │   ├── tile.png
        │   ├── tiletop.png
        │   ├── tiletopw.png
        │   └── tilew.png
        ├── lovely_night.jpg
        ├── README
        ├── submenu.png
        ├── taglist
        │   ├── squarefw.png
        │   └── squarew.png
        ├── theme.lua
        └── titlebar
            ├── close_focus.png
            ├── close_normal.png
            ├── floating_focus_active.png
            ├── floating_focus_inactive.png
            ├── floating_normal_active.png
            ├── floating_normal_inactive.png
            ├── maximized_focus_active.png
            ├── maximized_focus_inactive.png
            ├── maximized_normal_active.png
            ├── maximized_normal_inactive.png
            ├── minimize_focus.png
            ├── minimize_normal.png
            ├── ontop_focus_active.png
            ├── ontop_focus_inactive.png
            ├── ontop_normal_active.png
            ├── ontop_normal_inactive.png
            ├── sticky_focus_active.png
            ├── sticky_focus_inactive.png
            ├── sticky_normal_active.png
            └── sticky_normal_inactive.png

5 directories, 61 files

I’m not seeing something obvious?

EDIT: tried with absolute path too and didn’t get any results.

Ok, lets think of some other issue…

In first one, variable is named theme_path. In second one, its named themes_path (an extra s)

Could that be causing images to not load?

1 Like

Wow, I’m a big dummy to not have noticed it!
That being said, I’ve corrected it, but sadly it doesn’t works anyway, but now rc.lua throws an error, so maybe we are going in the righr direction:

/home/nemo/.config/awesome/rc.lua:564:bad argument #-1 to '_newindex' (string expected, got nil)

The problem here is that I’ve not changed those line from the default in rc.lua nor in the theme.lua. And also I’ve double checked my theme.lua and the two variables are both string :face_with_raised_eyebrow: :thinking:

here the two whole files:

rc.lua
theme.lua

PS is a slightly old paste so theme.lua present the error themes/theme but in the new one is correct. I’ll change the link as soon as I can, but for the sake of the other error everything is the same.

-- Define the image to load
theme.titlebar_close_button_normal = theme_path.."material/titlebar/close_normal.png"
theme.titlebar_close_button_focus  = theme_path.."material/titlebar/close_focus.png"
 
theme.titlebar_minimize_button_normal = theme_path.."material/titlebar/minimize_normal.png"
theme.titlebar_minimize_button_focus  = theme_path.."material/titlebar/minimize_focus.png"
 
theme.titlebar_ontop_button_normal_inactive = theme_path.."material/titlebar/ontop_normal_inactive.png"
theme.titlebar_ontop_button_focus_inactive  = theme_path.."material/titlebar/ontop_focus_inactive.png"
theme.titlebar_ontop_button_normal_active = theme_path.."material/titlebar/ontop_normal_active.png"
theme.titlebar_ontop_button_focus_active  = theme_path.."material/titlebar/ontop_focus_active.png"
 
theme.titlebar_sticky_button_normal_inactive = theme_path.."material/titlebar/sticky_normal_inactive.png"
theme.titlebar_sticky_button_focus_inactive  = theme_path.."material/titlebar/sticky_focus_inactive.png"
theme.titlebar_sticky_button_normal_active = theme_path.."material/titlebar/sticky_normal_active.png"
theme.titlebar_sticky_button_focus_active  = theme_path.."material/titlebar/sticky_focus_active.png"
 
theme.titlebar_floating_button_normal_inactive = theme_path.."material/titlebar/floating_normal_inactive.png"
theme.titlebar_floating_button_focus_inactive  = theme_path.."material/titlebar/floating_focus_inactive.png"
theme.titlebar_floating_button_normal_active = theme_path.."material/titlebar/floating_normal_active.png"
theme.titlebar_floating_button_focus_active  = theme_path.."material/titlebar/floating_focus_active.png"
 
theme.titlebar_maximized_button_normal_inactive = theme_path.."material/titlebar/maximized_normal_inactive.png"
theme.titlebar_maximized_button_focus_inactive  = theme_path.."material/titlebar/maximized_focus_inactive.png"
theme.titlebar_maximized_button_normal_active = theme_path.."material/titlebar/maximized_normal_active.png"
theme.titlebar_maximized_button_focus_active  = theme_path.."material/titlebar/maximized_focus_active.png"
 
theme.wallpaper = theme_path.."material/lovely_night.jpg"
 
-- You can use your own layout icons like this:
theme.layout_fairh = theme_path.."material/layouts/fairhw.png"
theme.layout_fairv = theme_path.."material/layouts/fairvw.png"
theme.layout_floating  = theme_path.."material/layouts/floatingw.png"
theme.layout_magnifier = theme_path.."material/layouts/magnifierw.png"
theme.layout_max = theme_path.."material/layouts/maxw.png"
theme.layout_fullscreen = theme_path.."material/layouts/fullscreenw.png"
theme.layout_tilebottom = theme_path.."material/layouts/tilebottomw.png"
theme.layout_tileleft   = theme_path.."material/layouts/tileleftw.png"
theme.layout_tile = theme_path.."material/layouts/tilew.png"
theme.layout_tiletop = theme_path.."material/layouts/tiletopw.png"
theme.layout_spiral  = theme_path.."material/layouts/spiralw.png"
theme.layout_dwindle = theme_path.."material/layouts/dwindlew.png"
theme.layout_cornernw = theme_path.."material/layouts/cornernww.png"
theme.layout_cornerne = theme_path.."material/layouts/cornernew.png"
theme.layout_cornersw = theme_path.."material/layouts/cornersww.png"
theme.layout_cornerse = theme_path.."material/layouts/cornersew.png"

sorry, I don’t understand your answer

in your rc.lua you have
this
local theme_path = string.format("%s/.config/awesome/themes/%s/theme.lua", os.getenv(“HOME”), “material”)

and in theme.lua
you have theme.titlebar_sticky_button_normal_inactive = themes_path.
themes_path
try with theme_path in theme.lua

2 Likes

change this
theme.titlebar_close_button_normal = themes_path…“material/titlebar/close_normal.png”
to
theme.titlebar_close_button_normal = theme_path…“material/titlebar/close_normal.png”

remove the s from themes_path to theme_path

in your theme.lua config file

2 Likes

Oh ok, that what you where saying. That’s was already suggested by flyingcakes and is already applied (as stated in the post where I’ve posted the files). The paste is a little old and in my system the problem with the themes typo is already corrected, but I cannot change the link right now so you see the old and wrong file. That being said I’ll change the link as soon as possible with the correct one. Sorry

Just uploaded.
here you can find everything that I’ve in my folder under ~/.config/awesome

dotfiles

Ok it’s fixed.
I’ve found out with some help that the problem was in the theme.lua file, there I’ve reinitialized the theme and I shouldn’t have; that simple line was screwing with the all config (so the answer for the fist topic is: I’m really rusty!)

Thanks everyone for the help and sorry for the stupid questions.

1 Like

No such thing on EndeavourOS.

Pudge

4 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.