KittyKatt / screenFetch

Fetches system/theme information in terminal for Linux desktop screenshots.
GNU General Public License v3.0
3.84k stars 454 forks source link

Awesome WM shows theme based on parsing the config source code #690

Closed necauqua closed 3 years ago

necauqua commented 3 years ago

So awesomeWM config is lua-based and as far as I can tell it parses the source code of rc.lua file.

For me, for example, it shows the WM theme as WM Theme: '..require 'modules.settings' .theme..', because this is how I programmed my config, which is, IMO, pretty dumb.

If you remove the code that is matched by the script from rc.lua (by moving it to a function another file which is then called from rc.lua), then the theme is just blank.

You can actually ask awesome for the theme, evaluating the code, so that no matter how it was specified, you get the actual real value used, with this script:

dbus-send --print-reply --dest=org.awesomewm.awful --type=method_call / org.awesomewm.awful.Remote.Eval string:"return require\"beautiful\".theme_path" | grep -oP '[^/]*(?=/"$)'

Or if you don't mind using a script which comes with awesome, a shorter version which does the same thing:

awesome-client 'return require"beautiful".theme_path' | grep -oP '[^/]*(?=/"$)'

I could've opened a PR even, but idk how do you feel about dbus and remote code execution and stuff, and also this issue is limited to awesomeWM users (not very popular I guess)

KittyKatt commented 3 years ago

Using external tools is totally fine and even encouraged if they get the job done in a much easier manner, so long as we can be relatively certain those tools will be there given a certain set of constraints (like wm=awesome). Feel free to open a PR.