Giter VIP home page Giter VIP logo

Comments (38)

uttarayan21 avatar uttarayan21 commented on May 26, 2024 2

Thank you for the suggestion.
I have added a --config flag as well as MACCHINA_CONF environment variable both of which can set the config file.

from macchina.

gennaro-tedesco avatar gennaro-tedesco commented on May 26, 2024 2

Amazingly enough it seems that the line that breaks the code is:

palette         = "Light"

in the theme definition.

Your example works fine; I was curious and I tried with other themes, like Hydrogen and Helium - and they still broke. So I commented out one line at a time (monkey debugging method 😝 ) and saw that if yo remove palette = ... from any theme they work just fine. Likewise, if you add it to your example, it breaks again as well.

Can you confirm this is the case for you as well? See below for demo:

Screen.Recording.2021-12-16.at.23.38.58.mov

Now the Lithium theme does have its own palette section in the .toml, however the same behaviour happens with Hydrogen and Helium (namely removing palette = ... makes all work fine).

from macchina.

gennaro-tedesco avatar gennaro-tedesco commented on May 26, 2024 1

Woow, thank you for your quick effort! I guess you are referring to #98.

Thank you again and keep up the awesome macchina!

from macchina.

gennaro-tedesco avatar gennaro-tedesco commented on May 26, 2024 1

Awesome, I have installed it and confirm the changes with the $MACCHINA_CONF work as intended!

from macchina.

gennaro-tedesco avatar gennaro-tedesco commented on May 26, 2024 1

Updating to

macchina --version
macchina     6.0.5
libmacchina  6.0.0

all seems restored and fine again, I have tried with different configurations and all work well!

from macchina.

uttarayan21 avatar uttarayan21 commented on May 26, 2024

We are using dirs-rs to get the config directory.
According to that in macos config_dir is in // Mac: Some(/Users/Alice/Library/Application Support).
So you probably will have to place it in there.

from macchina.

gennaro-tedesco avatar gennaro-tedesco commented on May 26, 2024

I have tried the specifications indicated in dirs-rs, nevertheless the configuration is still ignored; not a big problem, I am just going to alias the options to the command instead.

Perhaps it can be useful, down the road, to expose to the user an environment variable or a flag through which they can point to whichever location they choose, something along the lines of

export $MACCHINA_PATH=/my/custom/config/path

that they can place in their shell profile or so.

from macchina.

gennaro-tedesco avatar gennaro-tedesco commented on May 26, 2024

Sorry to re-comment on a closed issue: I saw that a new release was issued: is this already available via brew or must we compile the binaries (upgrading it seems the latest is still 0.8.1)?

from macchina.

grtcdr avatar grtcdr commented on May 26, 2024

Sorry to re-comment on a closed issue: I saw that a new release was issued: is this already available via brew or must we compile the binaries (upgrading it seems the latest is still 0.8.1)?

It still isn't available on brew, see #100

from macchina.

grtcdr avatar grtcdr commented on May 26, 2024

Hey @gennaro-tedesco, version 0.8.21 should be out on homebrew. :)

from macchina.

gennaro-tedesco avatar gennaro-tedesco commented on May 26, 2024

.toml configuration ignored again with latest releases - same settings as per original post.

from macchina.

grtcdr avatar grtcdr commented on May 26, 2024

I'll have a look at it, sorry this happened (again).

from macchina.

gennaro-tedesco avatar gennaro-tedesco commented on May 26, 2024

Any progress on this by any chance?

from macchina.

grtcdr avatar grtcdr commented on May 26, 2024

I'm in the middle of refactoring the way configurations are handled, the progress is happening on the v6 branch. Due to the new architectural changes that macchina has undergone with the separation of themes from the main config, MACCHINA_CONF will become MACCHINA_DIR to accomodate for the usage of themes by specifying an entire directory.

from macchina.

gennaro-tedesco avatar gennaro-tedesco commented on May 26, 2024

I have seen that v6 has been released and I have updated it:

$ macchina -v
macchina     6.0.1
libmacchina  4.0.2

As explained here I moved the configuration to the new one, making use of themes in a separate folder as indicated. However, macchina again does not detect them: see screenshot below:

Screenshot 2021-12-16 at 02 07 38

ls ~/.config/macchina/themes
Permissions Size User           Date Modified Name
.rw-r--r--   966 gennarotedesco 16 Dec 01:53  Helium.toml
.rw-r--r--   966 gennarotedesco 16 Dec 01:53  Hydrogen.toml

the themes are there, I have copied and pasted the documentation examples without changing anything. Still, I am unable to get it to work.

At this point I would ask if there is a plan to really test it on macOS and make it work: I am trying really hard to use it but I am spending more time looking at these GitHub issues than ever actually using the tool.

from macchina.

grtcdr avatar grtcdr commented on May 26, 2024

I am trying really hard to use it but I am spending more time looking at these GitHub issues than ever actually using the tool.

I get your frustration, and I'm really sorry you're having all this trouble :(

At this point I would ask if there is a plan to really test it on macOS and make it work

I unfortunately don't have the hardware, or time to maintain a wide variety of operating systems, all of which have their own fair share of weird quirks. I can however try to help you to the best of my ability :)

@123marvin123 is the primary contributor to the macOS side of things and his schedule is pretty tight, so I'm all you got.

Anyways, can you please post the two themes?

from macchina.

gennaro-tedesco avatar gennaro-tedesco commented on May 26, 2024

The themes are the ones shown here and the macchina.toml is the same as in the link, only obviously having theme = "Helium/Hydrogen" accordingly.

I have tried with "bare themes" too, namely making a minimal theme with 1-2 lines just to see if the configuration is read, and they do not work either, so I suspect the macchina.toml does not see the reference to the macchina/themes folder?

from macchina.

grtcdr avatar grtcdr commented on May 26, 2024

I suspect the macchina.toml does not see the reference to the macchina/themes folder?

This is probably the case, although I'm having a hard time tracking such a bug down, especially since I've carefully tweaked the configuration paths in v6 to look at the correct paths depending on the operating system, and macOS being the only OS suffering from this doesn't help. I'll look even harder, there's got to be a way.

from macchina.

123marvin123 avatar 123marvin123 commented on May 26, 2024

I will look at this issue today and push a solution for macOS.

from macchina.

grtcdr avatar grtcdr commented on May 26, 2024

I will look at this issue today and push a solution for macOS.

Can you work on this in the v6.0.2 branch?

from macchina.

123marvin123 avatar 123marvin123 commented on May 26, 2024

Please also see #239. There seems to be an issue with the Helium theme which silently fails. Also, the dirs crate does not respect $XDG_CONFIG_HOME, the default location for the macchina.toml file is under /Users/YOU/.config/macchina/macchina.toml, alternatively you can provide the config via the --config flag.

from macchina.

gennaro-tedesco avatar gennaro-tedesco commented on May 26, 2024

#239 is about the Hydrogen theme, not Helium, is it not? From the screenshot above (see my previous comment) one can see that the location of my configuration is indeed /Users/YOU/.config/macchina (with macchina.toml and /themes in there) - so I would say the paths are correct.

Do we want to create a minimally reproducible curl example to execute and try, say something along the lines of

brew install macchina
curl .../macchina.toml
curl .../macchina/themes

so that we make sure that we both reproduce the same?

from macchina.

123marvin123 avatar 123marvin123 commented on May 26, 2024

#239 is about the Hydrogen theme, not Helium, is it not? From the screenshot above (see my previous comment) one can see that the location of my configuration is indeed /Users/YOU/.config/macchina (with macchina.toml and /themes in there) - so I would say the paths are correct.

Do we want to create a minimally reproducible curl example to execute and try, say something along the lines of

brew install macchina
curl .../macchina.toml
curl .../macchina/themes

so that we make sure that we both reproduce the same?

Oh, you're right, it's about the Hydrogen theme, sorry. We can create a reproducible example, please keep in mind that the changes that I made today are not (yet) in Homebrew. I created a new branch in the repository to keep track of our minimally reproducible example:

brew install macchina
cd ~/.config
mkdir macchina && cd macchina
curl https://raw.githubusercontent.com/Macchina-CLI/macchina/issue-97-example/contrib/macchina.toml > macchina.toml
mkdir themes && cd themes
curl https://raw.githubusercontent.com/Macchina-CLI/macchina/issue-97-example/contrib/themes/Lithium.toml > Lithium.toml

But even for the old version (6.0.1), this returns the proper output with the correct theme (for me):
CleanShot 2021-12-16 at 22 38 04@2x

There is a bug in 6.0.1 that will always print an error message if there is no default config file found:
CleanShot 2021-12-16 at 22 39 03@2x

But that's fixed in 6.0.2. Can you try the example above?

from macchina.

grtcdr avatar grtcdr commented on May 26, 2024

Well that's a good ending :)

I'm sorry I wasn't able to catch this before the release of v6, but I'm glad you figured it out.

I'll have that fixed ASAP.

from macchina.

123marvin123 avatar 123marvin123 commented on May 26, 2024

Amazingly enough it seems that the line that breaks the code is:

palette         = "Light"

in the theme definition.

Your example works fine; I was curious and I tried with other themes, like Hydrogen and Helium - and they still broke. So I commented out one line at a time (monkey debugging method 😝 ) and saw that if yo remove palette = ... from any theme they work just fine. Likewise, if you add it to your example, it breaks again as well.

Can you confirm this is the case for you as well? See below for demo:

Screen.Recording.2021-12-16.at.23.38.58.mov

Now the Lithium theme does have its own palette section in the .toml, however the same behaviour happens with Hydrogen and Helium (namely removing palette = ... makes all work fine).

Yes, it happens with all themes, since palette = ... is actually not correct syntax anymore. So when macchina tries to read the theme file, it fails. It's really necessary that we print an error message to inform the user in that case.

from macchina.

grtcdr avatar grtcdr commented on May 26, 2024

Hydrogen is the only offender, all other themes use the latest format.

It's really necessary that we print an error message to inform the user in that case.

We're still working on making error handling the best it can be, it's not exactly trivial to get it right.

from macchina.

grtcdr avatar grtcdr commented on May 26, 2024

One question though, is Homebrew packaging the manpages?

from macchina.

gennaro-tedesco avatar gennaro-tedesco commented on May 26, 2024

Sorry guys, release to v6.0.3 two days ago changed it again? :p

Probably time for me to let go of this unrequited love 😭

from macchina.

grtcdr avatar grtcdr commented on May 26, 2024

Changed what?

from macchina.

gennaro-tedesco avatar gennaro-tedesco commented on May 26, 2024

The .toml configuration is ignored again: I do not get exceptions/errors whilst invoking macchina, however the settings are not being parsed.

from macchina.

grtcdr avatar grtcdr commented on May 26, 2024

crying

--config doesn't work either, I assume?

from macchina.

grtcdr avatar grtcdr commented on May 26, 2024

I think I know what's going on, please bear with me.

from macchina.

grtcdr avatar grtcdr commented on May 26, 2024

I made a slight modification, and it seems to be working on my machine through the manual path that is $HOME/.config/macchina/macchina.toml and not $XDG_CONFIG_HOME/.config/macchina/macchina.toml. So you don't have to set XDG_CONFIG_HOME.

from macchina.

gennaro-tedesco avatar gennaro-tedesco commented on May 26, 2024

In my case $XDG_CONFIG_HOME is not set either, and the path is the correct one to $HOME/.config. Do the themes still live in $HOME/.config/macchina/themes (I remember previously we had a problem in the path to the theme not being recognised, and I thought this may still be the case??)?

from macchina.

grtcdr avatar grtcdr commented on May 26, 2024

Do the themes still live in $HOME/.config/macchina/themes

No, but I found the culprit.

from macchina.

grtcdr avatar grtcdr commented on May 26, 2024

There shouldn't be any more issues now.

from macchina.

grtcdr avatar grtcdr commented on May 26, 2024

How are things looking now, @gennaro-tedesco ?

from macchina.

grtcdr avatar grtcdr commented on May 26, 2024

Thanks for bearing with me, and sorry about all this.

from macchina.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.