Closed darkowlzz closed 3 years ago
@darkowlzz this is great. Being able to pull from a local repo is a great Idea. Everything looks good and ready to go, but I can't merge until the conflicts are resolved. Would you mind resolving the conflicts? If you need help just let me know I would be happy to help.
Hi @lex148 , I've resolved the conflicts. You should be able to merge it now :) Thanks for reviewing.
This adds support for repos with URL as a local file (
file://
). This enables creating custom theme repos locally without the need to download a repo file.The implementation adds
Update::update_repos()
which iterates through the repos and fetches the themes. If the repo URL is a web URL, it downloads it. If the URL is a local file address, it reads the files as a repo.Introduces
url
crate for URL parsing and construction.With this change, a local theme repo file can be created, say
my-theme-repo.toml
:This repo can be added to
~/.config/leftwm/themes.toml
as:On running update:
The themes from the new repo gets added.
~~NOTE: I've learned about avoiding usage of
unwrap()
in production code. I introduced a lot of unwraps in config.rs with my recent changes, I'll fix them in a follow-up PR.~~Update: Added a separate commit to remove all
unwrap()
from non-test code in config.rs.