-
Notifications
You must be signed in to change notification settings - Fork 48
Conversation
This commit is the first in a series of commits that will introduce new CLI interface for Gradience. Currently we need to move some parts of code that reside mostly in frontend modules to their new backend modules, and this commit is the beggining of this whole ordeal. * Refactor Preset model object, in order to make it more readable and to allow `new` function that directly takes new values for properties * Move presets_dir from models/preset to new backend/globals module * Create new utils/colors module (will be used in later commits) * Update all modules that are affected by above changes
* add more checks in new_preset_from_monet function * return full Preset object instead of dict data * remove some unused code
This commit adds a new CLI interface made using argparse library. Current status of CLI interface is very WIP, as it lacks logic for the majority of commands and doesn't work properly on Flatpak and local builds. Currently working commands: monet, version
Thanks again @tfuxu for your contribution, if you need help for refactoring or things like that, i'll be glad to help. Also, since that you refactored the repo structure, it'll be nice to be able to have multiple preset open at the same time or when a preset is opening by the user instead of erasing the current one, create a new window with the new preset. (@daudix-UFO will be happy 🚀 ) |
Yep, I would like to have an option to open new gradience window, this would be really helpful when creating themes with multiple variants |
I currently need to move functions for accessing a list of installed and favorited presets from frontend to backend, so if you want, you can try to move them (put them in
Sure, should be relatively easy to add, but I think that this exceeds the point of this PR, so maybe in a later date I could look into that. |
Ofc |
…t specifying an Adw.ToastOverlay object
…pak_theming commands
* add more exception handling to backend/preset_downloader and backend/models/preset modules
@0xMRTT |
Will the be added in aur as gradience-cli ? for testing?? |
No, you won't be able to install CLI as a standalone package, because it is tied directly to Gradience code. The only way to get CLI will be to download a full Gradience package. |
how I can download a preset? for some reason it does not work for me
|
You need to type display name (don't forget to put it in quotes if it has spaces in name) |
|
Looks like a bug. Well, I'll check what's wrong here, and try to fix that. |
|
|
hmm, strange |
Well, that's a bummer. I've checked |
I think I have an idea how to fix this. |
If only libportal were working from cli |
Fixed bug from #675 (comment) |
Okay, I was able to create a function from functions in |
OK, it's not a big deal to enable one checkbox in Flatseal, or we can add access to downloads folder and say user that you need to put preset there? |
That might be an idea to consider |
Okay, another idea. |
This is how it will look as a command:
|
* add try..except statement to shutil.copy operation in `import` command
* move sandbox check from `frontend/cli` module to `backend/globals`
Okay, I've tested new commits on Flatpak and now everything works as expected. |
Alright, @daudix-UFO everything tested? Can we merge? |
@tfuxu I think we can! 🚀 |
As it is merged now. |
You have to wait for the release, yes it will be available in aur |
Description
This PR introduces a CLI (command-line interface) for Gradience.
It is currently highly work-in-progress, as I still need to write functions for the majority of commands, and some of the options doesn't yet have any help information.We are now at reviewing process, so in following days this PR should be merged into upstream.CLI to-do list:
presets
favorites
import
apply
new
(will be worked on later)download
monet
flatpak-overrides
help
Fixes #671
Type of change
Changelog
backend/
modules,models/preset
module to make it more readable,Testing
How to test the changes
Currently known working build types:
Notes:
To run CLI in Flatpak builds, use this command:
flatpak run --command=gradience-cli com.github.GradienceTeam.Gradience.Devel
For local builds there is a small guide on how to get CLI working:
local.sh
orMakefile
,./local_cli.sh [command]