Skip to content

Commit

Permalink
add header to alacritty theme file
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed Nov 24, 2024
1 parent 2abaa81 commit b679585
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
9 changes: 9 additions & 0 deletions alacritty/spring_night.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# Alacritty theme for spring-night colorscheme
#
# Author: rhysd <lin90162@yahoo.co.jp>
# License: MIT
# Copyright (c) 2016 rhysd
#
# PLEASE DO NOT MODIFY THIS FILE DIRECTLY!
# Generated by script vim-color-spring-night/gen/src/main.rs

[colors.primary]
background = "#132132"
foreground = "#fffeeb"
Expand Down
21 changes: 20 additions & 1 deletion gen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -964,8 +964,27 @@ impl<'a, W: Write> AlacrittyThemeWriter<'a, W> {
}
}

fn write_header(&mut self) -> io::Result<()> {
write!(
self.out,
r#"# Alacritty theme for spring-night colorscheme
#
# Author: rhysd <lin90162@yahoo.co.jp>
# License: MIT
# Copyright (c) 2016 rhysd
#
# PLEASE DO NOT MODIFY THIS FILE DIRECTLY!
# Generated by script vim-color-spring-night/gen/{source}
"#,
source = file!(),
)
}

#[rustfmt::skip]
fn write(&mut self) -> io::Result<()> {
self.write_header()?;

writeln!(self.out, "[colors.primary]")?;
writeln!(self.out, "background = \"{}\"", &self.palette[self.theme.background].gui.normal())?;
writeln!(self.out, "foreground = \"{}\"", &self.palette[self.theme.normal.foreground].gui.normal())?;
Expand Down Expand Up @@ -1048,7 +1067,7 @@ fn write_to_stdout() -> Result<()> {
fn main() -> Result<()> {
let (program, args) = {
let mut argv = env::args();
(argv.next().unwrap(), argv.collect::<Vec<_>>())
(argv.next().unwrap(), argv)
};

let opts = {
Expand Down

0 comments on commit b679585

Please sign in to comment.