Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
vhdirk committed Dec 30, 2023
1 parent 8cab916 commit 705dc31
Show file tree
Hide file tree
Showing 17 changed files with 1,340 additions and 1,439 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: ['https://www.buymeacoffee.com/edfloreshz', 'https://www.paypal.com/paypalme/edfloreshz', 'https://donate.stripe.com/fZe9B24JU7Xa8AUdQQ']
# custom: ['https://www.buymeacoffee.com/edfloreshz', 'https://www.paypal.com/paypalme/edfloreshz', 'https://donate.stripe.com/fZe9B24JU7Xa8AUdQQ']
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A tiling terminal emulator for GNOME on Linux using GTK4, written in Rust.

## Goal

Terms is an experiment. I like [Tilix](Tilix) and I like [Black Box](BlackBox). Why can't I have both?
Terms is an experiment. I like [Tilix][Tilix] and I like [BlackBox]. Why can't I have both?

## Status

Expand Down Expand Up @@ -54,10 +54,16 @@ Join the GNOME and gtk-rs community!

Lots of ideas and code from these projects:

- [Podcasts](https://gitlab.gnome.org/World/podcasts)
- [Shortwave](https://gitlab.gnome.org/World/Shortwave)
- [BlackBox](https://gitlab.gnome.org/raggesilver/blackbox)
- [Tilix](https://github.com/gnunn1/tilix)
- [Fractal](https://gitlab.gnome.org/World/fractal)
- [Zoha](https://github.com/hkoosha/zoha4)

- [Podcasts]
- [Shortwave]
- [BlackBox]
- [Tilix]
- [Fractal]
- [Zoha]

[Podcasts]: https://gitlab.gnome.org/World/podcasts
[Shortwave]: https://gitlab.gnome.org/World/Shortwave
[BlackBox]: https://gitlab.gnome.org/raggesilver/blackbox
[Tilix]: https://github.com/gnunn1/tilix
[Fractal]: https://gitlab.gnome.org/World/fractal
[Zoha]: https://github.com/hkoosha/zoha4
73 changes: 33 additions & 40 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,62 +1,55 @@
use std::{env, fs, path::Path, process::Command};

fn render_schema(gschema: &str, out_dir: &Path) {
let gettext_package = env::var("GETTEXT_PACKAGE").unwrap();
let app_id = env::var("APP_ID").unwrap();
let gettext_package = env::var("GETTEXT_PACKAGE").unwrap();
let app_id = env::var("APP_ID").unwrap();

let contents = fs::read_to_string(gschema).unwrap();
let contents = fs::read_to_string(gschema).unwrap();
eprintln!("{:?}", contents);
let new = contents
.replace("@gettext-package@", &gettext_package)
.replace("@app-id@", &app_id);
let new = contents.replace("@gettext-package@", &gettext_package).replace("@app-id@", &app_id);

let filename = Path::new(gschema).file_name().unwrap();
let outfile = Path::new(filename).file_stem().unwrap();
let outpath = out_dir.join(outfile);
let outfile = Path::new(filename).file_stem().unwrap();
let outpath = out_dir.join(outfile);

fs::write(outpath.clone(), new).unwrap();
fs::write(outpath.clone(), new).unwrap();

let outpath_file = outpath.to_string_lossy();
println!("cargo:rerun-if-changed={gschema}");
println!("cargo:rerun-if-changed={gschema}");
println!("cargo:rerun-if-changed={outpath_file}");
}

pub fn compile_schemas<P: AsRef<Path>>(gschemas: &[P]) {
let out_dir = env::var("OUT_DIR").unwrap();
let out_dir = Path::new(&out_dir);

for gschema in gschemas {
render_schema(&gschema.as_ref().to_string_lossy(), out_dir);
}

let schema_dir = env::var("GSETTINGS_SCHEMA_DIR").unwrap();
let output = Command::new("glib-compile-schemas")
.arg("--targetdir")
.arg(schema_dir)
.arg(out_dir)
.output()
.unwrap();

assert!(
output.status.success(),
"glib-compile-schemas failed with exit status {} and stderr:\n{}",
output.status,
String::from_utf8_lossy(&output.stderr)
);
let out_dir = env::var("OUT_DIR").unwrap();
let out_dir = Path::new(&out_dir);

for gschema in gschemas {
render_schema(&gschema.as_ref().to_string_lossy(), out_dir);
}

let schema_dir = env::var("GSETTINGS_SCHEMA_DIR").unwrap();
let output = Command::new("glib-compile-schemas")
.arg("--targetdir")
.arg(schema_dir)
.arg(out_dir)
.output()
.unwrap();

assert!(
output.status.success(),
"glib-compile-schemas failed with exit status {} and stderr:\n{}",
output.status,
String::from_utf8_lossy(&output.stderr)
);
}

fn compile_glib() {
glib_build_tools::compile_resources(
&["data/resources/"],
"data/resources/resources.gresource.xml",
"resources.gresource",
);

compile_schemas(&["data/com.github.vhdirk.Terms.gschema.xml.in"]);
glib_build_tools::compile_resources(&["data/resources/"], "data/resources/resources.gresource.xml", "resources.gresource");

compile_schemas(&["data/com.github.vhdirk.Terms.gschema.xml.in"]);
}

fn main() {
// TODO: we probably only want to do this when not running under meson
compile_glib();
// TODO: we probably only want to do this when not running under meson
compile_glib();
}
4 changes: 2 additions & 2 deletions po/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Create a new translation

To start translating, duplicate any of the `.po` files and start translating it,
To start translating, duplicate any of the `.po` files and start translating it,
rename it to match your country code and add your contry code.

Be sure to add your country code to the [LINGUAS](https://github.com/edfloreshz/done/blob/main/po/LINGUAS) file too.
Be sure to add your country code to the [LINGUAS](https://github.com/vhdirk/terms/blob/main/po/LINGUAS) file too.

|Code |Language |
|----------|------------------------------------------|
Expand Down
6 changes: 3 additions & 3 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
edition = "2021"
max_width = 80
hard_tabs = true
max_width = 160
hard_tabs = false
match_block_trailing_comma = true
merge_derives = true
newline_style = "Unix"
reorder_imports = true
reorder_modules = true
tab_spaces = 2
tab_spaces = 4
use_field_init_shorthand = true
Loading

0 comments on commit 705dc31

Please sign in to comment.