Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose Public Themes Folder #115

Open
ghost opened this issue Mar 5, 2021 · 8 comments
Open

Expose Public Themes Folder #115

ghost opened this issue Mar 5, 2021 · 8 comments

Comments

@ghost
Copy link

ghost commented Mar 5, 2021

We were chatting around in #thelounge some today and came to find that the path for the public themes folder is @ /usr/local/share/.config/yarn/global/node_modules/thelounge/public/themes/ inside the container. Would be nice if this was exposed in a way for it to be mounted with normal perms for copying custom themes in.

Though in brief testing with copying CSS files into the container (docker cp), I didn't really have any luck getting those themes to appear in thelounge, even if I set the owner to root and permissions to 644 like morning.css and default.css. I suspect that's because thelounge requires restarts to see new files in here (restart would of course destroy the file copied in)? I don't know as I don't have a non-Docker lounge to play with...

@jathek
Copy link

jathek commented Sep 12, 2021

We were chatting around in #thelounge some today and came to find that the path for the public themes folder is @ /usr/local/share/.config/yarn/global/node_modules/thelounge/public/themes/ inside the container. Would be nice if this was exposed in a way for it to be mounted with normal perms for copying custom themes in.

Though in brief testing with copying CSS files into the container (docker cp), I didn't really have any luck getting those themes to appear in thelounge, even if I set the owner to root and permissions to 644 like morning.css and default.css. I suspect that's because thelounge requires restarts to see new files in here (restart would of course destroy the file copied in)? I don't know as I don't have a non-Docker lounge to play with...

You could add the file in like this in a compose file, which would persist across restarts:

    volumes:
      - $DOCKERDIR/thelounge/themes/custom_theme.css:/usr/local/share/.config/yarn/global/node_modules/thelounge/public/themes/custom_theme.css

@ghost
Copy link
Author

ghost commented Sep 12, 2021

I tried ./thelounge-themes:/usr/local/share/.config/yarn/global/node_modules/thelounge/public/themes previously (as an example). Perhaps trying to mount the entire folder was where I was going wrong when testing this. Been many months tho, hard to say what all was tested at the time... 😅 I'll have to take another look Soon™.

@JoeArcher007
Copy link

JoeArcher007 commented Oct 26, 2021

@xnaas I believe I've ran into an issue when using ./foldername instead of the full path leading to funkiness in Docker. I don't know why or what was the issue, but it would never allow to read what was there. Once I put the full path into the folder, it would work correctly. I'll test this out on my end as I was hoping to get some themes in to TheLounge as well from the Docker side of things.

I think you scratch all that I said above, I was reading it totally differently, but nearcatch gave me an idea to try out.

@williamboman
Copy link
Member

Aren't themes installed in thelounge's package path, which defaults to THELOUNGE_HOME + "/packages". In the docker container that'd be /var/opt/thelounge/packages. If you're using a data dir you've probably mounted it on
/var/opt/thelounge, per recommendation in the docs. Or am I missing something?

@ghost
Copy link
Author

ghost commented Nov 4, 2021

I'll have to take another look Soon™.

Soon™ will come Someday™. Fret not.

Or am I missing something?

Yes. We're not talking about installed themes. We're talking about manually creating your own theme (not dealing with pushing to npm or creating a package) and dropping it in the public/themes folder.

More:

@JoeArcher007
Copy link

Hopefully this comment proves helpful. I was looking at using NPM to install another theme and have it stay but wasn't able to get that going. (Couldn't get the NPM to install in the docker container at the time). If that's possible, I'm all eyes/ears on how to get it working. Will have to play around with that myself too to see if I can get it going that way.

So in essence, my issue was different than xnaas whereas I just wanted to use NPM to install other themes I had seen online.

@ghost
Copy link
Author

ghost commented Nov 5, 2021

@JoeArcher007: If you're using the official container, it should just be docker exec --user node -it <container_name> thelounge install <npm-theme-or-plugin-name>.

@brunnre8
Copy link
Member

note that you don't need npm (the registry)... installing from a local folder works as well by giving a file: prefix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants