thelounge-docker
thelounge-docker copied to clipboard
Expose Public Themes Folder
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...
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 toroot
and permissions to644
likemorning.css
anddefault.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
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™.
@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.
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?
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:
- https://github.com/thelounge/thelounge/search?q=%22public+folder%22
- https://github.com/thelounge/thelounge/search?q=public+themes (couldn't get this refined better, but search code for
public/themes
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.
@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>
.
note that you don't need npm (the registry)... installing from a local folder works as well by giving a file: prefix