You are not logged in.

#1 2018-09-20 17:26:17

Sorky
Member
Registered: 2012-07-25
Posts: 20

[SOLVED] Awesome WM - Sample code issues [A]Don't change theme.dir

Just starting out with the new awesome (old but basic user)

trying to make a  theme, so starting by copying the default...

a>    copied /usr/share/awesome/themes/default to /home/david/.config/awesome/themes/mine
b>    copied /usr/share/awesome/themes/default to /usr/share/awesome/themes/yours

copied /etc/xdg/awesome/rc,lua to /home/david/.config/awesome/rc,lua

A>    edited line 48 [beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua")] from "default" to "mine" and restart _BUT_ awesome goes mental
B>    edited line 48 [beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua")] from "default" to "yours" and restart and that seems ok

Why is <a> & <A> _BAD_ but <b> and <B> not?

Shouldn't I do the new theme in my home dir?

Last edited by Sorky (2018-10-09 11:41:27)

Offline

#2 2018-09-20 17:31:52

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Awesome WM - Sample code issues [A]Don't change theme.dir

Please edit your thread title to one that actually describes your issue: https://wiki.archlinux.org/index.php/Co … ow_to_post


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2018-09-21 09:53:15

Sorky
Member
Registered: 2012-07-25
Posts: 20

Re: [SOLVED] Awesome WM - Sample code issues [A]Don't change theme.dir

Title changed to match the pain (hope that conforms)

Original post explains the background / reproduction
This post raises troubling questions

Update - Searched the theme and they seem to be very badly defined IMHO

theme.layout_cornernw        = themes_path .. "sky/layouts/cornernw.png"
theme.layout_cornerne        = themes_path .. "sky/layouts/cornerne.png"
theme.layout_cornersw        = themes_path .. "sky/layouts/cornersw.png"
theme.layout_cornerse        = themes_path .. "sky/layouts/cornerse.png"

theme.awesome_icon           = themes_path .. "sky/awesome-icon.png"

-- from default for now...
theme.menu_submenu_icon     = themes_path .. "default/submenu.png"

-- Generate taglist squares:
local taglist_square_size = dpi(4)
theme.taglist_squares_sel = theme_assets.taglist_squares_sel(
    taglist_square_size, theme.fg_normal
)
theme.taglist_squares_unsel = theme_assets.taglist_squares_unsel(
    taglist_square_size, theme.fg_normal
)

-- MISC
theme.wallpaper             = themes_path .. "sky/sky-background.png"
theme.taglist_squares       = "true"
theme.titlebar_close_button = "true"
theme.menu_height = dpi(15)
theme.menu_width  = dpi(100)

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

Note: theme.awesome_icon           = themes_path .. "sky/awesome-icon.png"

    The theme.lua is in the "sky" directory ans actually contains the theme name
    Copying as I did was never going to work
    I'd have expected "themes_path" to give the location of the theme.lua file

Note: theme.menu_submenu_icon     = themes_path .. "default/submenu.png"

    The extra themes rely on the default theme as well
    Can't just copy one theme


Basically leaves me either modifying the supplied [not ideal] or completely rewriting from scratch [which is not something I'm keen to undertake]


In the interest of hopefully continuing with Awesome, I hope I haven't offended anyone to much with my opinions that I can still ask ..

1. The old awesome v2 or v3 seemed to not have these restrictions - am I missing something?

2. Is there a forum somewhere that focuses on Awesome specifically?

3, Should I report the issues as bugs?

Last edited by Sorky (2018-09-21 10:01:01)

Offline

#4 2018-09-21 10:50:16

Zhme
Member
Registered: 2017-06-11
Posts: 72

Re: [SOLVED] Awesome WM - Sample code issues [A]Don't change theme.dir

I was having some issues with theming awesome as well, I found that explicitly stating my theme path was more effective than using the themes_path variable.

beautiful.init("~/.config/awesome/themes/default/theme.lua")

Offline

#5 2018-09-23 05:50:58

Sorky
Member
Registered: 2012-07-25
Posts: 20

Re: [SOLVED] Awesome WM - Sample code issues [A]Don't change theme.dir

Thanks - That helped!

Also needed to do this in the theme...

--local themes_path = gfs.get_themes_dir()
local themes_path = "~/.config/awesome/themes/"

Offline

#6 2018-09-23 06:17:16

Sorky
Member
Registered: 2012-07-25
Posts: 20

Re: [SOLVED] Awesome WM - Sample code issues [A]Don't change theme.dir

looks like both would not be needed if I could...

awesome.themes_path="~/.config/awesome/themes"

Any ideas how/where?

Offline

#7 2018-09-30 14:19:31

Sorky
Member
Registered: 2012-07-25
Posts: 20

Re: [SOLVED] Awesome WM - Sample code issues [A]Don't change theme.dir

Anyone know why

awesome.themes_path="~/.config/awesome/themes"

doesn't work?

Offline

#8 2018-10-04 12:09:47

Moltke
Member
Registered: 2016-07-12
Posts: 59

Re: [SOLVED] Awesome WM - Sample code issues [A]Don't change theme.dir

Sorky wrote:

Anyone know why

awesome.themes_path="~/.config/awesome/themes"

doesn't work?

I'm not expert, in fact recently started using awesome like a couple of months ago, however, as long as I read here https://awesomewm.org/doc/api/index.html beautiful manages themes and I haven't seen "awesome" among any library, function, variable, object, api. I think that for this to work you'd have to create the "awesome" variable into the lua library, I'm not really sure about this though, just  my 2 cents...


Judges have decimated, meanings of our laws, already guilt? something has a flow, wrongly accused, blindly confused, open your eyes, wake up realize!

Offline

#9 2018-10-05 07:30:18

Sorky
Member
Registered: 2012-07-25
Posts: 20

Re: [SOLVED] Awesome WM - Sample code issues [A]Don't change theme.dir

Agree - First two lines of rc.lua...

-- {{{ Required libraries
local awesome, client, mouse, screen, tag = awesome, client, mouse, screen, tag

even tried "awesome.themes_path="/home/david/.config/awesome/themes" in case the "~" was an issue

Is it read-only and set on install which seems a bit limiting if it is

Definitely needs further investigation as there is a lot of variation in the themes I've seen and a easy & consistent setup would seem like a positive step going forward

Particularly given the suggested "copy to your local directory for modification" just doesn't seem to work

Offline

#10 2018-10-05 11:39:30

Moltke
Member
Registered: 2016-07-12
Posts: 59

Re: [SOLVED] Awesome WM - Sample code issues [A]Don't change theme.dir

By the way, here https://www.reddit.com/r/awesomewm/ and here https://stackoverflow.com/questions/tagged/awesome-wm you might be able to find some more help  regarding awesome-wm. The "copy to your local directory" is more like a safe way for you to do modifications without compromising the main files, so even if you manage to screw your lua file in ~/HOME beyond reapair/recovery then you can simply copy the one from /etc/XDG and start over, which I think is quite convenient.


Judges have decimated, meanings of our laws, already guilt? something has a flow, wrongly accused, blindly confused, open your eyes, wake up realize!

Offline

#11 2018-10-07 22:04:25

Sorky
Member
Registered: 2012-07-25
Posts: 20

Re: [SOLVED] Awesome WM - Sample code issues [A]Don't change theme.dir

That's the whole problem and point of the thread... "copy to your local directory" doesn't work [at least without doing edits that are not well documented]

Ideally you just copy rc.lua and then copy the themes/default to your local directory and they'd be used automagically [one well documented edit in rc.lua would be ok]

IMHO the sample themes need work such as...

  a) theme.dir should be defined based on the location of the theme file: ie: theme.dir = string.match(debug.getinfo(1,"S").source,"/.*/")
  b) theme sky (and others) also reference theme default

Offline

#12 2018-10-09 01:03:34

Moltke
Member
Registered: 2016-07-12
Posts: 59

Re: [SOLVED] Awesome WM - Sample code issues [A]Don't change theme.dir

That's the whole problem and point of the thread... "copy to your local directory" doesn't work [at least without doing edits that are not well documented]

Oh...I see...Then the title of this thread should be "can't copy rc.lua and theme.lua to my home dir" or something like that, cause honestly the way it looks and how you explained your whole situation it seemed as if you were trying to apply your own lua code into the lua library. And it is well documented https://awesomewm.org/apidoc/documentat … e.md.html#  you just have to carefully read throught it.
In your terminal type

$ sudo cp  /etc/xdg/awesome/rc.lua  /home/sorky/.config/awesome

and for the theme.lua

$ sudo cp  /usr/share/awesome/themes/theme name/theme.lua  /home/sorky/.config/awesome

and that should be it. Then you can perform as many modificatios as you need to those files. Also, I'd suggest you create some ".backup" directory to put your awesome files in there and keep them safe just in case; better safe than sorry.

$ mkdir .backup

pay attention to the " . " before the dir name, it means it'll be a hidden dir. Next, you could write a script to copy your rc.lua and theme.lua or better yet the whole dir into it

# /bin/bash cp -r -n /home/sorky/.config/awesome  /home/sorky/.backup

name it cp.sh or wahtever you want and if you wish then create a cronjob so it runs once or twice or as many times as you need/want a month/week/day/hour

$ crontab -e

then append something like this at the bottom of the file "0 1 * * DAY /home/sorky/cp.sh change DAY for the actual day i.e SUN MON FRI or 3 5 7 and the rest according to your needs.


Judges have decimated, meanings of our laws, already guilt? something has a flow, wrongly accused, blindly confused, open your eyes, wake up realize!

Offline

#13 2018-10-09 11:37:19

Sorky
Member
Registered: 2012-07-25
Posts: 20

Re: [SOLVED] Awesome WM - Sample code issues [A]Don't change theme.dir

Yeah - I guess I overloaded the first post, but the essence was <a> = recommended = didn't work and <b> = edit/clone of the original = did

I'm well past the issue anyway so I'm marking it solved / closed

PS: I copied the entire theme directory so I could change images which is why I ran into issues (changed theme.dir) - I could have done just the theme.lua file and only edited the images I wanted with their own path

Offline

Board footer

Powered by FluxBB