misterio77 / flavours Goto Github PK
View Code? Open in Web Editor NEW🎨💧 An easy to use base16 scheme manager that integrates with any workflow.
License: MIT License
🎨💧 An easy to use base16 scheme manager that integrates with any workflow.
License: MIT License
Hi,
First of all flavours itself works like a charm and I could hardly be happier!
My only problem is changing the colors of my shell. The actual updating works fine but I can not figure out a proper hook to apply. sourcing the bashrc can not change my current session of course so i am a bit dumbfounded.
Currently update works by simply reading the yaml and cutting where we find a ':'. I ended up using yaml serde on apply module, so it would be nice to implement this.
After cargo install flavours
, every time I start a new terminal instance:
/path/to/bin/flavours:1: no matches found: ^@^@^@^@^@^@^@__nl_symbol_ptr^@__DATA^@^@^@^@^@^@^@^@^@^@^@^P%^@^A^@^@^@^P^@^@^@^@^@^@^@^@^P%^@^C^@^@^@^@^@^@^@^@^@^@^@^F^@^@^@^?^@^@^@^@^@^@^@^@^@^@^@__got^@^@^@^@^@^@^@^@^@^@^@__DATA^@^@^@^@^@^@^@^@^@^@^P^P%^@^A^@^@^@^H^@^@^@^@^@^@^@^P^P%^@^C^@^@^@^@^@^@^@^@^@^@^@^F^@^@^@\M-^A^@^@^@^@^@^@^@^@^@^@^@__la_symbol_ptr^@__DATA^@^@^@^@^@^@^@^@^@^@^X^P%^@^A^@^@^@\M-x^C^@^@^@^@^@^@^X^P%^@^C^@^@^@^@^@^@^@^@^@^@^@^G^@^@^@\M-^B^@^@^@^@^@^@^@^@^@^@^@__const^@^@^@^@^@^@^@^@^@__DATA^@^@^@^@^@^@^@^@^@^@^P^T%^@^A^@^@^@\M-^H?^A^@^@^@^@^@^P^T%^@^C^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@__data^@^@^@^@^@^@^@^@^@^@__DATA^@^@^@^@^@^@^@^@^@^@\M-^XS
/path/to/bin/flavours:1: permission denied:
/path/to/bin/flavours:1: permission denied:
/path/to/bin/flavours:1: permission denied:
/path/to/bin/flavours:1: permission denied:
/path/to/bin/flavours:1: permission denied:
/path/to/bin/flavours:1: permission denied:
/path/to/bin/flavours:1: permission denied:
[3] 61515
/path/to/bin/flavours:1: parse error near `&'
/path/to/bin/flavours:1: parse error in command substitution
/path/to/bin/flavours:1: command not found: \M-O\M-z\M-m\M-~^G
[3] - exit 127
Note that everything seems to work correctly apart from that.
I am really not in a position to help with the fixing on my own but I'm happy to try things if I can help.
I have a vimscript file that I would like to insert a color scheme to. Using the start
and end
parameters, I am experiencing difficulties as the character for comments in vimscript is "
. Attempting to do such gives me this error:
Couldn't replace lines in "/home/siri/.config/nvim/colors.vim": Couldn't find starting string.
Escaping with /
(i.e /"
) as in Rust or \
(i.e \"
) as in TOML gives me the same exact error. Using single quotes and not escaping ('"
) as in TOML does not work either.
For now, my solution is to use rewrite=true
and store the color scheme in a separate file. However it would be more optimal for my use case if I can group airline and vim themes in the same file.
Hello, I've been playing around with flavours for a couple hours now and It's pretty great. I've been having trouble getting it to recognize my custom schemes and templates in my .config/flavours directory. I cloned it to my machine and was playing around with it looking for a bug and ... couldn't find one? The cloned version works just fine. Both the outputs are shown below
/usr/bin/flavours
installed through aur:❱ flavours apply nord
Error: Couldn't read template i3/nebi3 at "/home/neb/.local/share/flavours/base16/templates/i3/templates/nebi3.mustache". Check if the correct template/subtemplate was specified, and run the update templates command if you didn't already.
Caused by:
No such file or directory (os error 2)
cargo run
:❱ cargo run -- apply nord
Finished dev [unoptimized + debuginfo] target(s) in 0.21s
Running `target/debug/flavours apply nord`
Some("/home/neb/.config/flavours/templates/i3/templates/nebi3.mustache"), Is_file: true
Some("/home/neb/.config/flavours/templates/nvim/templates/default.mustache"), Is_file: false
Some("/home/neb/.config/flavours/templates/kitty/templates/default.mustache"), Is_file: false
the extra "is_file" lines were my attempts at debugging it's the only change I've made to the code
I double checked if it was recognizing my config file as shown:
❱ flavours -v
Using directory: "/home/neb/.local/share/flavours"
Using config file: "/home/neb/.config/flavours/config.toml"
I'm at a loss for why these two builds would be different, and why only the AUR build would be unable to recognize the templates and schemes directories in my .config. Hoping you might have some insights
thanks!
Right now flavours recreates the colour schemes from files afresh every time the generate command is called.
If we could store the generated colour scheme in a folder (perhaps in the same folder as other colour schemes or in $HOME/.cache/) and then when that same file is used to generate a colour scheme, using the pre-generated one instead of generating a new one would cut some of the workload and thus resulting time I guess.
When I write incorrect syntax in my config.toml
, I get the following error message:
$ flavours apply $theme
Error: Couldn't parse configuration file. Check if it's syntatically correct
Caused by:
expected an equals, found a colon at line 7 column 8
I think it would be helpful to include the path to the config file. I wasn't sure if this was referring to the flavours config or my other config files :)
First, flavours is great, thanks! I like to have complementary schemes, as in solarized-light in my terminal and solarized-dark for things like i3. For now I can make this work by having different config files and running:
flavours -c ~/.config/flavours/config-light.toml apply solarized-light
flavours -c ~/.config/flavours/config-dark.toml apply solarized-dark
Would it be useful to implement a different way to handle this? Perhaps one could specify items to apply themes to in the apply command, either by name (which would probably be the value of the template variable) or maybe some tag in the configuration to apply to many items at once. Like:
flavours apply solarized-light --name alacritty
flavours apply solarized-light --tag light
Where the alacritty item would have a line like tag = 'light'
.
Hi,
I recently started getting an error when trying to run flavours info
. After listing a few schemes it gives the following error:
Error: Couldn't parse scheme toast. Check if it's syntatically correct.
Caused by:
missing field `scheme` at line 1 column 6
This seems especially odd to me since as far as I can tell there is no theme named 'toast' in Base16, and the next theme alphabetically should be "classic". have tried deleting ~/.local/share/flavours
and running flavours update all
, but I still get the same error.
I am still able to use the other subcommands as expected.
I think most of the config will be the same for most users. It would be nice to provide a default config, and add an "enabled" flag defaulting to false.
Or even better, defaulting the "enabled" flag to "auto" which detects whether a program exists.
Could you add flavours to the Alpine Package Repository (APK)?
As mentioned, I'm on MacOS.
Expected:
what is shown in the help message when flavours
is run on its own, that is:
~/.config/flavours/config.toml
,~/.local/share/flavours
,Got:
~/Library/Application Support/flavours/
That wouldn't be a problem except for the fact that the help message is misleading and I cannot figure out how to change the config and data files to their rightful place.
Really liking the project apart from that, thanks!
From reading the source it looks like you already support Base24, not just Base16.
Or am I confused?
Hi,
Trying to install flavours by running cargo install flavours
but I get the following output:
Compiling flavours v0.5.1
error[E0599]: no variant or associated item named `UnifiedHelpMessage` found for enum `AppSettings` in the current scope
--> /home/jsoares/.cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.1/src/cli.rs:9:31
|
9 | .setting(AppSettings::UnifiedHelpMessage)
| ^^^^^^^^^^^^^^^^^^ variant or associated item not found in `AppSettings`
error[E0599]: no variant or associated item named `ColoredHelp` found for enum `AppSettings` in the current scope
--> /home/jsoares/.cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.1/src/cli.rs:13:31
|
13 | .setting(AppSettings::ColoredHelp)
| ^^^^^^^^^^^ variant or associated item not found in `AppSettings`
error[E0599]: no variant or associated item named `UnifiedHelpMessage` found for enum `AppSettings` in the current scope
--> /home/jsoares/.cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.1/src/cli.rs:49:39
|
49 | .setting(AppSettings::UnifiedHelpMessage)
| ^^^^^^^^^^^^^^^^^^ variant or associated item not found in `AppSettings`
error[E0599]: no variant or associated item named `ColoredHelp` found for enum `AppSettings` in the current scope
--> /home/jsoares/.cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.1/src/cli.rs:53:39
|
53 | .setting(AppSettings::ColoredHelp)
| ^^^^^^^^^^^ variant or associated item not found in `AppSettings`
error[E0599]: no variant or associated item named `UnifiedHelpMessage` found for enum `AppSettings` in the current scope
--> /home/jsoares/.cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.1/src/cli.rs:58:39
|
58 | .setting(AppSettings::UnifiedHelpMessage)
| ^^^^^^^^^^^^^^^^^^ variant or associated item not found in `AppSettings`
error[E0599]: no variant or associated item named `ColoredHelp` found for enum `AppSettings` in the current scope
--> /home/jsoares/.cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.1/src/cli.rs:62:39
|
62 | .setting(AppSettings::ColoredHelp)
| ^^^^^^^^^^^ variant or associated item not found in `AppSettings`
error[E0599]: no variant or associated item named `UnifiedHelpMessage` found for enum `AppSettings` in the current scope
--> /home/jsoares/.cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.1/src/cli.rs:80:39
|
80 | .setting(AppSettings::UnifiedHelpMessage)
| ^^^^^^^^^^^^^^^^^^ variant or associated item not found in `AppSettings`
error[E0599]: no variant or associated item named `ColoredHelp` found for enum `AppSettings` in the current scope
--> /home/jsoares/.cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.1/src/cli.rs:84:39
|
84 | .setting(AppSettings::ColoredHelp)
| ^^^^^^^^^^^ variant or associated item not found in `AppSettings`
error[E0599]: no variant or associated item named `UnifiedHelpMessage` found for enum `AppSettings` in the current scope
--> /home/jsoares/.cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.1/src/cli.rs:102:39
|
102 | .setting(AppSettings::UnifiedHelpMessage)
| ^^^^^^^^^^^^^^^^^^ variant or associated item not found in `AppSettings`
error[E0599]: no variant or associated item named `ColoredHelp` found for enum `AppSettings` in the current scope
--> /home/jsoares/.cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.1/src/cli.rs:106:39
|
106 | .setting(AppSettings::ColoredHelp)
| ^^^^^^^^^^^ variant or associated item not found in `AppSettings`
error[E0599]: no variant or associated item named `UnifiedHelpMessage` found for enum `AppSettings` in the current scope
--> /home/jsoares/.cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.1/src/cli.rs:156:39
|
156 | .setting(AppSettings::UnifiedHelpMessage)
| ^^^^^^^^^^^^^^^^^^ variant or associated item not found in `AppSettings`
error[E0599]: no variant or associated item named `ColoredHelp` found for enum `AppSettings` in the current scope
--> /home/jsoares/.cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.1/src/cli.rs:160:39
|
160 | .setting(AppSettings::ColoredHelp)
| ^^^^^^^^^^^ variant or associated item not found in `AppSettings`
error[E0599]: no variant or associated item named `UnifiedHelpMessage` found for enum `AppSettings` in the current scope
--> /home/jsoares/.cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.1/src/cli.rs:183:39
|
183 | .setting(AppSettings::UnifiedHelpMessage)
| ^^^^^^^^^^^^^^^^^^ variant or associated item not found in `AppSettings`
error[E0599]: no variant or associated item named `ColoredHelp` found for enum `AppSettings` in the current scope
--> /home/jsoares/.cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.1/src/cli.rs:187:39
|
187 | .setting(AppSettings::ColoredHelp)
| ^^^^^^^^^^^ variant or associated item not found in `AppSettings`
error[E0599]: no variant or associated item named `UnifiedHelpMessage` found for enum `AppSettings` in the current scope
--> /home/jsoares/.cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.1/src/cli.rs:198:39
|
198 | .setting(AppSettings::UnifiedHelpMessage)
| ^^^^^^^^^^^^^^^^^^ variant or associated item not found in `AppSettings`
error[E0599]: no variant or associated item named `ColoredHelp` found for enum `AppSettings` in the current scope
--> /home/jsoares/.cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.1/src/cli.rs:202:39
|
202 | .setting(AppSettings::ColoredHelp)
| ^^^^^^^^^^^ variant or associated item not found in `AppSettings`
error[E0061]: this function takes 4 arguments but 3 arguments were supplied
--> /home/jsoares/.cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.1/src/completions.rs:12:25
|
12 | Some("bash") => generate::<Bash, _>(&mut build_cli(), "flavours", &mut io::stdout()),
| ^^^^^^^^^^^^^^^^^^^ ---------------- ---------- ----------------- supplied 3 arguments
| |
| expected 4 arguments
|
note: function defined here
--> /home/jsoares/.cargo/registry/src/github.com-1ecc6299db9ec823/clap_generate-3.0.0-beta.5/src/lib.rs:239:8
|
239 | pub fn generate<G, S>(gen: G, app: &mut clap::App, bin_name: S, buf: &mut dyn Write)
| ^^^^^^^^
error[E0061]: this function takes 4 arguments but 3 arguments were supplied
--> /home/jsoares/.cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.1/src/completions.rs:13:27
|
13 | Some("elvish") => generate::<Elvish, _>(&mut build_cli(), "flavours", &mut io::stdout()),
| ^^^^^^^^^^^^^^^^^^^^^ ---------------- ---------- ----------------- supplied 3 arguments
| |
| expected 4 arguments
|
note: function defined here
--> /home/jsoares/.cargo/registry/src/github.com-1ecc6299db9ec823/clap_generate-3.0.0-beta.5/src/lib.rs:239:8
|
239 | pub fn generate<G, S>(gen: G, app: &mut clap::App, bin_name: S, buf: &mut dyn Write)
| ^^^^^^^^
error[E0061]: this function takes 4 arguments but 3 arguments were supplied
--> /home/jsoares/.cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.1/src/completions.rs:15:13
|
15 | generate::<PowerShell, _>(&mut build_cli(), "flavours", &mut io::stdout())
| ^^^^^^^^^^^^^^^^^^^^^^^^^ ---------------- ---------- ----------------- supplied 3 arguments
| |
| expected 4 arguments
|
note: function defined here
--> /home/jsoares/.cargo/registry/src/github.com-1ecc6299db9ec823/clap_generate-3.0.0-beta.5/src/lib.rs:239:8
|
239 | pub fn generate<G, S>(gen: G, app: &mut clap::App, bin_name: S, buf: &mut dyn Write)
| ^^^^^^^^
error[E0061]: this function takes 4 arguments but 3 arguments were supplied
--> /home/jsoares/.cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.1/src/completions.rs:19:13
|
19 | generate::<Fish, _>(&mut build_cli(), "flavours", &mut buffer);
| ^^^^^^^^^^^^^^^^^^^ ---------------- ---------- ----------- supplied 3 arguments
| |
| expected 4 arguments
|
note: function defined here
--> /home/jsoares/.cargo/registry/src/github.com-1ecc6299db9ec823/clap_generate-3.0.0-beta.5/src/lib.rs:239:8
|
239 | pub fn generate<G, S>(gen: G, app: &mut clap::App, bin_name: S, buf: &mut dyn Write)
| ^^^^^^^^
error[E0061]: this function takes 4 arguments but 3 arguments were supplied
--> /home/jsoares/.cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.1/src/completions.rs:33:13
|
33 | generate::<Zsh, _>(&mut build_cli(), "flavours", &mut buffer);
| ^^^^^^^^^^^^^^^^^^ ---------------- ---------- ----------- supplied 3 arguments
| |
| expected 4 arguments
|
note: function defined here
--> /home/jsoares/.cargo/registry/src/github.com-1ecc6299db9ec823/clap_generate-3.0.0-beta.5/src/lib.rs:239:8
|
239 | pub fn generate<G, S>(gen: G, app: &mut clap::App, bin_name: S, buf: &mut dyn Write)
| ^^^^^^^^
Some errors have detailed explanations: E0061, E0599.
For more information about an error, try `rustc --explain E0061`.
error: could not compile `flavours` due to 21 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `flavours v0.5.1`, intermediate artifacts can be found at `/tmp/cargo-installoG5gXA`
Caused by:
build failed
I've also tried installing version 0.4.0 but the same thing occurs, the output is slightly different (has 26 errors instead of 21).
Kind Regards,
jsoares
At the moment we're using clap-generate to generate completion scripts.
The only issue is completing apply
and info
with available schemes. As they are dynamic, i wasn't able to make clap's possible_values
take that list.
Currently, i've been able to make it work by manually changing the completion file after generation, but maybe there's a way to fix it inside the code, or maybe with a github action?
Hello.
I was trying to test flavours but encountered this error just after installation. I installed flavours from the aur and ran flavours update all
as suggested by the readme. On running this, flavours returns this:
~ flavours update all
fatal: could not read Username for 'https://github.com': terminal prompts disabled
fatal: could not read Username for 'https://github.com': terminal prompts disabled
fatal: cannot change to '/home/rider/.config/flavours/base16/sources/schemes': No such file or directory
Error: Git failed to run on repository 'https://github.com/chriskempson/base16-schemes-source.git'. Check if your repo list is valid.
I only changed the environment variable FLAVOURS_DATA_DIRECTORY
to ~/.config/flavours
. I made no change regarding flavours config file.
The repo, upon checking does not exist. I can use git just fine on my terminal and browser so i have no idea what bought this on.
Thanks for the awesome tool :)
Hi,
I love flavours
, thanks so much!
Would it be possible to have it available from Homebrew?
Let me know if I can be of any help.
Hi!
Some templates generate a script to be executed. Unless there's a way I don't know of, I'm supposed to use the hook = …
entry to:
Maybe there should be an easier way to do it: it could for instance create a tempfile()
, execute it, and clean it up, making even the file = …
entry optional.
Right now the application outputs the color codes in hex, but some apps (e.g zathura) don't allow transparency unless specified in RGBA format.
Something like {{base05-rgb}}
or {{base05-rgba}}
just as we have {{base05-hex}}
.
As mentioned here, we can use {{base05-rgb-r}} {{base05-rgb-g}} {{base05-rgb-b}}
to get the r g and b values instead.
Happens when running flavours generate dark ./image-name.jpg
From what I can gather it's coming from the image-rs library. Not really sure what I can do to fix.
I couldn't find a way to autocomplete query command with available schemes (that means it will not be possible to autocomplete apply command as well) while keeping the glob matching functionality.
Performance seems to be great right now (the program runs in about 10ms if no hooks are ran).
But there's a place where we could improve, specifically when the template variables are replaced.
Right now we do multiple passes on the template (one for each variable).
I'm not so sure on how to make multiple passes in a idiomatic-ish way, but will take a look.
thread 'main' panicked at 'failed printing to stdout: Broken pipe (os error 32)', library/std/src/io/stdio.rs:895:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
shows up sometimes whenever I pipe the output of flavours info $(flavours current)
using head like this
flavours info $(flavours current) | head -n<integer>
The command works fine and the error can be avoided by redirecting it to /dev/null but thought I'd let you know just in case.
also running with env variable RUST_BACKTRACE=1
doesn't provide a backtrace
Hi there! First of all, great tool! I'm having a lot of fun with it.
While installing flavours on a different machine using cargo build
(same using the AUR package), I encountered an error.
As it turns out, just upgrading my Rust version from 1.52 to 1.57 solved the issue.
It took me a second to figure out, since I am not experienced with Rust, and I imagine I am not the only one. Would it be an idea to set a minimum Rust version in cargo.toml
? It seems that this is possible as of recent (rust-lang/cargo#9732).
Alternatively, I would propose to add one or two lines in the README.md
stating upgrading as a potential fix for build errors. The latter I could do myself, the former is probably easier for someone with experience in Rust 😛.
Hey there!
First off, thank you for developing this, it looks incredibly promising! 👍
I just can't seem to get it to work, whenever I run flavours apply <theme-name>
(nord
for example) I just get the following error message:
Error: Couldn't get items from config file. Check the default file or github for config examples.
This is my configuration:
# Commands go through bash
shell = "bash -c '{}'"
# Sway supports the default '#' comments, so it can be ommited
# 'rewrite' is also ommited, as it defaults to false
[[items]]
file = "~/.config/kitty/colors.conf"
subtemplate = "default"
template = "kitty"
And I ran flavours update all
several times now.
Have a good day!
Hey! i love ur library but im worried how can i configure colors for alacritty like this
colors:
primary:
background: '0x282828'
foreground: '0xdfbf8e'
normal:
black: '0x665c54'
red: '0xea6962'
green: '0xa9b665'
yellow: '0xe78a4e'
blue: '0x7daea3'
magenta: '0xd3869b'
cyan: '0x89b482'
white: '0xdfbf8e'
bright:
black: '0x928374'
red: '0xea6962'
green: '0xa9b665'
yellow: '0xe3a84e'
blue: '0x7daea3'
magenta: '0xd3869b'
cyan: '0x89b482'
white: '0xdfbf8e'
against to this
colors:
# Default colors
primary:
background: '0x{{base00-hex}}'
foreground: '0x{{base05-hex}}'
# Colors the cursor will use if `custom_cursor_colors` is true
cursor:
text: '0x{{base00-hex}}'
cursor: '0x{{base05-hex}}'
# Normal colors
normal:
black: '0x{{base00-hex}}'
red: '0x{{base08-hex}}'
green: '0x{{base0B-hex}}'
yellow: '0x{{base0A-hex}}'
blue: '0x{{base0D-hex}}'
magenta: '0x{{base0E-hex}}'
cyan: '0x{{base0C-hex}}'
white: '0x{{base05-hex}}'
# Bright colors
bright:
black: '0x{{base03-hex}}'
red: '0x{{base09-hex}}'
green: '0x{{base01-hex}}'
yellow: '0x{{base02-hex}}'
blue: '0x{{base04-hex}}'
magenta: '0x{{base06-hex}}'
cyan: '0x{{base0F-hex}}'
white: '0x{{base07-hex}}'
draw_bold_text_with_bright_colors: false
for example i have different color for background and for black color but in this template it uses same color. So im limited because of this ? base16 provides only 16 colors but theoretically i can use for alacritty 18-20 different colors (include colors for cursor)
I'm a much better rust programmer by now. When i programmed most of flavours, i was still using very imperative approuches, which could now be replaced by more idiomatic code, OOP patterns, for example.
I've been thinking about reestructuring the project as a library, just wondering if this could be useful or consumed anywhere outside itself.
I'd love to hear feedback and advice, if anyone happens to have some
Hi,
I have been tinkering with flavours to make my color configs flexible. Updating, applying, and generating schemes have been a breeze so far. However, building seems to have an issue: I have to provide a path to the .mustache
or .yaml
files for the scheme and template, otherwise the build command won't work.
Kindly see the asciicast below for an example with scheme nord
and template i3
. Applying the themes goes seamlessly (although you won't see it due to limitations of asciicinema), but I struggle to build a scheme.
I do not have Rust experience although I am more than happy to answer questions to help make this awesome software more awesome 😄.
Maybe it could be better to only clone repos if needed, and pull them instead
It would be nice to allow users to run the hook inside their chosen shell. Through a configuration? Maybe trying to autodetect as well.
That would allow both shell expansion and syntax on hooks
Currently process:command is being used for cloning repos, and, being syncronous, is very slow.
Maybe is there a way to make them async?
I've been getting into NixOS (and immutable stuff in general). Given the fact that flavours generate
can output a scheme to stdout, would be nice if flavours apply
could read a scheme from stdin.
I think flavours is pretty easy to use, but that's probably biased as i wrote it.
Would love to hear docs suggestions, and am accepting help documenting as well.
Let me know how you use flavours and what features aren't very clear.
Some sort of example would be helpful
Maybe optionally check return code as well
Hi again,
I've really been liking flavours
so far, the main gripe I have is that depending on the image the color scheme generation algorithm can give (imo) some weird color choices. Here is an example: https://imgur.com/a/U8Aa0kR as you can see the image is quite dark and basically just shades of blue, while the generated colors are very bright neon colors with not much blue, and the background color is a relatively bright purple.
I can give more examples if needed. I suspect it has trouble finding colors when an image is made up of similar shades of a color ?
I understand that colors are very much subject to personal preference, so if you disagree and deem this to be expected behaviour then please feel free to close this issue.
A lot of the apply work is done in the apply function right now. I should probably split it up so it can be reused later (for instance, getting the scheme for a "info" subcommand).
Hi,
First of all, thank you so much for this wonderful tool. It's made my life a lot easier and its design is fantastic!
I'm not sure if I'm just not seeing it, but is there a way to easily list available templates? Listing schemes is not an issue of course, but when I want to check which apps are supported I find myself having to look in ~/.local/share/flavours/templates/
. Is there a way of listing templates directly in flavours
, and if not, would you consider it for future versions?
Thank you again!
Hey,
I really like using this tool as it simplifies my theme changing habit a lot. However one thing I think which could be better would be to be able specify the templates and schemes sources directly in the config.toml file.
I think it would be easier especially when initializing the tool to have them in the configuration file as it is configure IMHO instead of having to manually create all the folder arborescence in .local/...
I could try submitting a PR for this if you're interested although I've never writtenrrust before
Cheers
Hi,
Sometimes, for whatever reason, you might want to use a different subtemplate for some program based on the scheme that you're using.
Example:
I have a custom template for sway which I like for most schemes. However, for some schemes I would like a different template (otherwise it looks bad or is hardly readable). I could change my custom template when I'm using these schemes, or I could write a new custom template and reference it in my config file, however those are "a lot" of manual steps that I don't want to do every time I change scheme, which is more or less often.
If a subtemplate named exactly like the scheme being used is found for a certain component (e.g base16/templates/sway/templates/darkmoss.mustache
), use it instead of the one given in the config.
This would be my preferred behaviour and it shouldn't interfere with other workflows, however, I understand it might have some undesired effects on some edge cases. It could also be optionally activated to mitigate this.
Would you be interested in such a functionality? I have a MR ready if so. If you have some feedback I could try to implement it. I'm a rust noob but am learning ;)
Since I don't have Arch or Nix I wanted to install simply using cargo install flavours
. However it runs into compilation errors (see output below). Specifying a version didn't work either (e.g. cargo install flavours --version 0.5.0
, etc.). I pinned down the problem to the clap
and clap_generate
packages but couldn't solve it anyway. It downloads and compiles the version 3.0.0-beta.4 although you specify 3.0.0-beta.2 in the Cargo.toml. I am just a Rust beginner, so it might be an easy to correct error,
I looked into the pkgbuild for Arch and was able to install it using those commands in Ubuntu.
Here's the output of cargo install (trimmed for visibility):
Compiling flavours v0.5.0
error[E0599]: no variant or associated item named `GlobalVersion` found for enum `AppSettings` in the current scope
--> /home/<user>/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.0/src/cli.rs:8:31
|
8 | .setting(AppSettings::GlobalVersion)
| ^^^^^^^^^^^^^ variant or associated item not found in `AppSettings`
error[E0599]: no variant or associated item named `DisableVersion` found for enum `AppSettings` in the current scope
--> /home/<user>/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.0/src/cli.rs:52:39
|
52 | .setting(AppSettings::DisableVersion)
| ^^^^^^^^^^^^^^
| |
| variant or associated item not found in `AppSettings`
| help: there is a variant with a similar name: `DisableVersionFlag`
error[E0599]: no variant or associated item named `DisableVersion` found for enum `AppSettings` in the current scope
--> /home/<user>/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.0/src/cli.rs:61:39
|
61 | .setting(AppSettings::DisableVersion)
| ^^^^^^^^^^^^^^
| |
| variant or associated item not found in `AppSettings`
| help: there is a variant with a similar name: `DisableVersionFlag`
error[E0599]: no method named `multiple` found for struct `Arg` in the current scope
--> /home/<user>/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.0/src/cli.rs:68:22
|
68 | .multiple(true)
| ^^^^^^^^ method not found in `Arg<'_>`
error[E0599]: no variant or associated item named `DisableVersion` found for enum `AppSettings` in the current scope
--> /home/<user>/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.0/src/cli.rs:83:39
|
83 | .setting(AppSettings::DisableVersion)
| ^^^^^^^^^^^^^^
| |
| variant or associated item not found in `AppSettings`
| help: there is a variant with a similar name: `DisableVersionFlag`
error[E0599]: no method named `multiple` found for struct `Arg` in the current scope
--> /home/<user>/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.0/src/cli.rs:90:22
|
90 | .multiple(true)
| ^^^^^^^^ method not found in `Arg<'_>`
error[E0599]: no variant or associated item named `DisableVersion` found for enum `AppSettings` in the current scope
--> /home/<user>/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.0/src/cli.rs:105:39
|
105 | .setting(AppSettings::DisableVersion)
| ^^^^^^^^^^^^^^
| |
| variant or associated item not found in `AppSettings`
| help: there is a variant with a similar name: `DisableVersionFlag`
error[E0599]: no variant or associated item named `DisableVersion` found for enum `AppSettings` in the current scope
--> /home/<user>/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.0/src/cli.rs:159:39
|
159 | .setting(AppSettings::DisableVersion)
| ^^^^^^^^^^^^^^
| |
| variant or associated item not found in `AppSettings`
| help: there is a variant with a similar name: `DisableVersionFlag`
error[E0599]: no method named `multiple` found for struct `Arg` in the current scope
--> /home/<user>/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.0/src/cli.rs:166:22
|
166 | .multiple(true)
| ^^^^^^^^ method not found in `Arg<'_>`
error[E0599]: no variant or associated item named `DisableVersion` found for enum `AppSettings` in the current scope
--> /home/<user>/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.0/src/cli.rs:186:39
|
186 | .setting(AppSettings::DisableVersion)
| ^^^^^^^^^^^^^^
| |
| variant or associated item not found in `AppSettings`
| help: there is a variant with a similar name: `DisableVersionFlag`
error[E0599]: no variant or associated item named `DisableVersion` found for enum `AppSettings` in the current scope
--> /home/<user>/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.0/src/cli.rs:201:39
|
201 | .setting(AppSettings::DisableVersion)
| ^^^^^^^^^^^^^^
| |
| variant or associated item not found in `AppSettings`
| help: there is a variant with a similar name: `DisableVersionFlag`
For more information about this error, try `rustc --explain E0599`.
error: could not compile `flavours` due to 11 previous errors
Just wanted to give a heads-up. Thanks for your effort developing this package!
Cheers.
By reading the source code, I found the undocumented feature of flavours —completions zsh
. But eval-ing it doesn’t work, and redirecting it to a file and sourcing it doesn’t work.
❯ flavours --completions zsh > /tmp/flavours.completions.zsh
❯ eval "$(flavours --completions zsh)"
_arguments:comparguments:325: can only be called from completion function
❯ source /tmp/flavours.completions.zsh
_arguments:comparguments:325: can only be called from completion function
Any help would be appreciated. (I have used bash
since 1995 and just switched to zsh
a few months ago, so I'm out of my element here.)
Hello,
I installed flavours from the AUR and couldn't make it work on my new laptop. It used to work on my previous one but didn't try recently (will try to when I find it again).
I have lots of lines in the likes of fatal: impossible d'accéder à 'https://github.com/afq984/base16-xfce4-terminal/' : Could not resolve host: github.com
when updating templates and schemes.
What I don't quite understand is that I can go to github without issues on my browser and also curl
github.com without errors.
I selfhost AdGuard Home and thought it might have interfered but I didn't find anything wrong in the logs (github.com requests are answered and not blocked). I tried disabling AdGuard's protection just in case but it changed nothing. I'll try with a different wifi just in case.
I have no idea how to troubleshoot this more,
Thanks :)
Proposed interface:
.subcommand(
App::new("build")
.about("Builds template with given scheme, outputs to stdout")
.setting(AppSettings::UnifiedHelpMessage)
.setting(AppSettings::DeriveDisplayOrder)
.setting(AppSettings::DisableHelpSubcommand)
.setting(AppSettings::DisableVersion)
.setting(AppSettings::ColoredHelp)
.arg(
Arg::new("scheme")
.about("Path to scheme file.")
.long("scheme")
.short('s')
.required(true)
.value_hint(ValueHint::FilePath)
)
.arg(
Arg::new("template")
.about("Path to template file.")
.long("template")
.short('t')
.required(true)
.value_hint(ValueHint::FilePath)
)
)
I got the feeling that I could implement this, even though I've never done Rust, by looking at:
flavours/src/operations/apply.rs
Line 108 in addbd72
flavours/src/operations/generate.rs
Line 7 in addbd72
Lines 39 to 42 in addbd72
Would you be open to this if I submitted a PR?
I was trying out flavours
but I have run into a problem.
I want to reload qutebrowser
here is the relevant part of the config:
[[item]]
file='$XDG_CONFIG_HOME/qutebrowser/colours.py'
template='qutebrowser'
subtemplate='minimal'
rewrite=true
hook='pgrep -x qutebrowser && qutebrowser :config-source'
But unfortunately qutebrowser does not reload. If I run the hook command in a terminal it works fine. if I remove the pgrep part and use:
hook='qutebrowser :config-source'
it also works but causes issues (not related to flavours
) when qutebrowser is not running.
Note that flavours
does not print out an error message.
Some hooks work better when ran before or after others. Maybe you want to sync stuff changing colors, and a few commands take too long to complete. I'll try to add an optional priority setting. I brainstormed it being an integer, with 0 being default, higher numbers running before lower ones.
I see there is a vim template but I cannot get it to work. I also see that you are not using flavours to change your colorscheme in your dotfiles for vim/nvim. Why not?
Although the picture in the README is bad quality, it seems like there is vim in there?
I'd really love some good documentation with a few recipes to get inspiration, I might submit a PR to improve that part. If I can get it to work, that is 😆
I'm just testing for now but I'm loving it up until now.
Got a small problem though : I'm not sure where I should put my custom templates. I need one for .Xresources since using # Start flavours didn't work in it, but I originally created it in ~/.local/share/flavours/base16/templates/xresources/templates
by copying the default one. It worked (i could select it using subtemplate = myfilename in my config.toml, but after a flavours update all, it disappeared.
Did I misplace the file ? Or is it unwanted behavior that it god deleted with an update ?
If I did misplace it, where would you recomand putting it ? I'd try some things myself, but I'd rather have confirmation before doing all my configurations if there's a risk the files might get deleted later.
Thanks for all the work
Currently, query is designed to show all schemes matching (glob) pattern. Apply is designed to apply one random scheme chosen among matches, if matched more than one.
Maybe there's a better way to handle it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.