diff --git a/Cargo.lock b/Cargo.lock index 7e5b5f9..6f5f998 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1596,6 +1596,7 @@ dependencies = [ "thiserror 2.0.18", "tokio", "url", + "xdgen", ] [[package]] @@ -2520,6 +2521,16 @@ dependencies = [ "xdg", ] +[[package]] +name = "freedesktop_entry_parser" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc6d3a3635983a889f065aa9ce760384713f23a9b4a04f696f86c39a5d7a6a5a" +dependencies = [ + "indexmap 2.13.0", + "nom 8.0.0", +] + [[package]] name = "fsevent-sys" version = "4.1.0" @@ -8634,6 +8645,18 @@ dependencies = [ "unicase", ] +[[package]] +name = "xdgen" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25af88f104f06d5aeb80c77e5eb85e6f6f355f86f6e34307a14befd716efe4bf" +dependencies = [ + "fluent", + "freedesktop_entry_parser", + "unic-langid", + "xmltree", +] + [[package]] name = "xkbcommon" version = "0.7.0" @@ -8689,12 +8712,27 @@ dependencies = [ "bytemuck", ] +[[package]] +name = "xml" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8aa498d22c9bbaf482329839bc5620c46be275a19a812e9a22a2b07529a642a" + [[package]] name = "xml-rs" version = "0.8.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ae8337f8a065cfc972643663ea4279e04e7256de865aa66fe25cec5fb912d3f" +[[package]] +name = "xmltree" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbc04313cab124e498ab1724e739720807b6dc405b9ed0edc5860164d2e4ff70" +dependencies = [ + "xml", +] + [[package]] name = "xmlwriter" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 30fda4a..e2c2f25 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,6 +53,9 @@ features = ["about", "multi-window", "tokio", "winit", "surface-message"] [target.'cfg(unix)'.dependencies] fork = "0.4" +[build-dependencies] +xdgen = "0.1" + [features] default = ["dbus-config", "wgpu", "wayland", "password_manager"] dbus-config = ["libcosmic/dbus-config"] diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..fc799c2 --- /dev/null +++ b/build.rs @@ -0,0 +1,24 @@ +use std::{env, fs, path::PathBuf}; +use xdgen::{App, Context, FluentString}; + +fn main() { + let id = "com.system76.CosmicTerm"; + let ctx = Context::new("i18n", env::var("CARGO_PKG_NAME").unwrap()).unwrap(); + let app = App::new(FluentString("cosmic-terminal")) + .comment(FluentString("comment")) + .keywords(FluentString("keywords")); + let output = PathBuf::from("target/xdgen"); + fs::create_dir_all(&output).unwrap(); + fs::write( + output.join(format!("{}.desktop", id)), + app.expand_desktop(format!("res/{}.desktop", id), &ctx) + .unwrap(), + ) + .unwrap(); + fs::write( + output.join(format!("{}.metainfo.xml", id)), + app.expand_metainfo(format!("res/{}.metainfo.xml", id), &ctx) + .unwrap(), + ) + .unwrap(); +} diff --git a/i18n/ar/cosmic_term.ftl b/i18n/ar/cosmic_term.ftl index df282cd..1c2f4e2 100644 --- a/i18n/ar/cosmic_term.ftl +++ b/i18n/ar/cosmic_term.ftl @@ -1,4 +1,6 @@ cosmic-terminal = طرفية COSMIC +comment = محاكي طرفي لسطح مكتب COSMIC +keywords = cli;طرفية;أوامر;صدفة; new-terminal = طرفية جديدة # Context Pages diff --git a/i18n/cs/cosmic_term.ftl b/i18n/cs/cosmic_term.ftl index 95405b1..21f42f0 100644 --- a/i18n/cs/cosmic_term.ftl +++ b/i18n/cs/cosmic_term.ftl @@ -1,3 +1,5 @@ +comment = Emulátor terminálu pro pracovní prostředí COSMIC +keywords = Příkaz;Shell;Terminál;Konzole;CLI; settings = Nastavení appearance = Vzhled theme = Motiv diff --git a/i18n/en/cosmic_term.ftl b/i18n/en/cosmic_term.ftl index 00d892c..08bc0a4 100644 --- a/i18n/en/cosmic_term.ftl +++ b/i18n/en/cosmic_term.ftl @@ -1,4 +1,6 @@ cosmic-terminal = COSMIC Terminal +comment = Terminal emulator for the COSMIC desktop +keywords = Command;Shell;Terminal;CLI; new-terminal = New terminal # Context Pages diff --git a/i18n/es-ES/cosmic_term.ftl b/i18n/es-ES/cosmic_term.ftl index 154f5bd..e0ad38b 100644 --- a/i18n/es-ES/cosmic_term.ftl +++ b/i18n/es-ES/cosmic_term.ftl @@ -1,4 +1,6 @@ cosmic-terminal = Terminal COSMIC +comment = Emulador de terminal de escritorio COSMIC +keywords = Comando;Shell;Terminal;Consola; new-terminal = Nuevo terminal # Context Pages diff --git a/i18n/hu/cosmic_term.ftl b/i18n/hu/cosmic_term.ftl index 37ce161..13cabd1 100644 --- a/i18n/hu/cosmic_term.ftl +++ b/i18n/hu/cosmic_term.ftl @@ -1,4 +1,6 @@ cosmic-terminal = COSMIC Terminál +comment = Terminálemulátor a COSMIC asztali környezethez +keywords = parancssor;terminál; new-terminal = Új terminál # Context Pages diff --git a/i18n/it/cosmic_term.ftl b/i18n/it/cosmic_term.ftl index 9d96497..ba59cf0 100644 --- a/i18n/it/cosmic_term.ftl +++ b/i18n/it/cosmic_term.ftl @@ -1,4 +1,6 @@ cosmic-terminal = Terminale COSMIC +comment = Emulatore di terminale di COSMIC +keywords = Comando;Shell;Terminale;Console; new-terminal = Nuovo terminale # Context Pages diff --git a/i18n/pl/cosmic_term.ftl b/i18n/pl/cosmic_term.ftl index 9a01731..0ee3fc3 100644 --- a/i18n/pl/cosmic_term.ftl +++ b/i18n/pl/cosmic_term.ftl @@ -1,4 +1,6 @@ cosmic-terminal = Terminal COSMIC +comment = Emulator terminala dla pulpitu COSMIC +keywords = Cli;WierszPoleceń;Powłoka;Terminal; new-terminal = Nowy terminal # Context Pages diff --git a/i18n/pt-BR/cosmic_term.ftl b/i18n/pt-BR/cosmic_term.ftl index d9250fd..367cfd2 100644 --- a/i18n/pt-BR/cosmic_term.ftl +++ b/i18n/pt-BR/cosmic_term.ftl @@ -1,4 +1,6 @@ cosmic-terminal = Terminal COSMIC +comment = Emulador de terminal do desktop COSMIC +keywords = Comando;Shell;Terminal; new-terminal = Novo terminal # Context Pages diff --git a/i18n/pt/cosmic_term.ftl b/i18n/pt/cosmic_term.ftl index e29b2ec..f4b63bd 100644 --- a/i18n/pt/cosmic_term.ftl +++ b/i18n/pt/cosmic_term.ftl @@ -1,4 +1,6 @@ cosmic-terminal = Terminal COSMIC +comment = Emulador de terminal do desktop COSMIC +keywords = Comando;Shell;Terminal;Console; new-terminal = Novo terminal # Context Pages diff --git a/i18n/ru/cosmic_term.ftl b/i18n/ru/cosmic_term.ftl index dfa6b60..d351b38 100644 --- a/i18n/ru/cosmic_term.ftl +++ b/i18n/ru/cosmic_term.ftl @@ -1,4 +1,6 @@ cosmic-terminal = Терминал COSMIC +comment = Эмулятор терминала для рабочей среды COSMIC +keywords = Команда;Оболочка;Терминал;Консоль; new-terminal = Новый терминал # Context Pages diff --git a/i18n/sk/cosmic_term.ftl b/i18n/sk/cosmic_term.ftl index 5c101b5..48bf133 100644 --- a/i18n/sk/cosmic_term.ftl +++ b/i18n/sk/cosmic_term.ftl @@ -1,4 +1,6 @@ cosmic-terminal = Terminál COSMIC +comment = Emulátor terminálu pre pracovné prostredie COSMIC +keywords = Príkaz;Shell;Terminál;Konzola; new-terminal = Nový terminál # Kontextové stránky diff --git a/i18n/sv-SE/cosmic_term.ftl b/i18n/sv-SE/cosmic_term.ftl index cc21887..2664e5e 100644 --- a/i18n/sv-SE/cosmic_term.ftl +++ b/i18n/sv-SE/cosmic_term.ftl @@ -1,4 +1,6 @@ cosmic-terminal = COSMIC Terminal +comment = Terminalemulator för skribordsmiljön COSMIC +keywords = Kommando;Skal;Terminal;CLI;Konsol; new-terminal = Ny terminal # Context Pages diff --git a/justfile b/justfile index 9835c8e..93be2ca 100644 --- a/justfile +++ b/justfile @@ -13,11 +13,11 @@ bin-src := cargo-target-dir / 'release' / name bin-dst := base-dir / 'bin' / name desktop := APPID + '.desktop' -desktop-src := 'res' / desktop +desktop-src := 'target/xdgen' / desktop desktop-dst := clean(rootdir / prefix) / 'share' / 'applications' / desktop metainfo := APPID + '.metainfo.xml' -metainfo-src := 'res' / metainfo +metainfo-src := 'target/xdgen' / metainfo metainfo-dst := clean(rootdir / prefix) / 'share' / 'metainfo' / metainfo icons-src := 'res' / 'icons' / 'hicolor' diff --git a/res/com.system76.CosmicTerm.desktop b/res/com.system76.CosmicTerm.desktop index dd19157..de41169 100644 --- a/res/com.system76.CosmicTerm.desktop +++ b/res/com.system76.CosmicTerm.desktop @@ -1,26 +1,6 @@ -#TODO: more build-out, desktop actions, translations? [Desktop Entry] Name=COSMIC Terminal -Name[ar]=طرفية COSMIC -Name[cs]=Terminál COSMIC -Name[zh_CN]=COSMIC 终端 -Name[pl]=Terminal COSMIC -Name[pt_BR]=Terminal -Name[ru]=Терминал -Name[hu]=COSMIC Terminál -Name[pt]=Terminal -Name[sk]=Terminál COSMIC -Name[es]=Terminal COSMIC -Name[it]=Terminale di COSMIC -Name[sv]=COSMIC Terminal Comment=Terminal emulator for the COSMIC desktop -Comment[ar]=محاكي طرفي لسطح مكتب COSMIC -Comment[cs]=Emulátor terminálu pro pracovní prostředí COSMIC -Comment[sk]=Emulátor terminálu pre pracovné prostredie COSMIC -Comment[ru]=Эмулятор терминала для рабочей среды COSMIC -Comment[hu]=Terminálemulátor a COSMIC asztali környezethez -Comment[it]=Emulatore di terminale di COSMIC -Comment[sv]=Terminalemulator för skribordsmiljön COSMIC Exec=cosmic-term Terminal=false Type=Application @@ -28,14 +8,3 @@ StartupNotify=true Icon=com.system76.CosmicTerm Categories=COSMIC;System;TerminalEmulator; Keywords=Command;Shell;Terminal;CLI; -Keywords[ar]=cli;طرفية;أوامر;صدفة; -Keywords[cs]=Příkaz;Shell;Terminál;Konzole;CLI; -Keywords[pl]=Cli;WierszPoleceń;Powłoka;Terminal; -Keywords[pt_BR]=Comando;Shell;Terminal; -Keywords[hu]=parancssor;terminál; -Keywords[pt]=Comando;Shell;Terminal;Console; -Keywords[sk]=Príkaz;Shell;Terminál;Konzola; -Keywords[ru]=Команда;Оболочка;Терминал;Консоль; -Keywords[es]=Comando;Shell;Terminal;Consola; -Keywords[it]=Comando;Shell;Terminale;Console; -Keywords[sv]=Kommando;Skal;Terminal;CLI;Konsol diff --git a/res/com.system76.CosmicTerm.metainfo.xml b/res/com.system76.CosmicTerm.metainfo.xml index 0ff2aca..dcc3635 100644 --- a/res/com.system76.CosmicTerm.metainfo.xml +++ b/res/com.system76.CosmicTerm.metainfo.xml @@ -9,27 +9,7 @@ https://github.com/pop-os/cosmic-term https://github.com/pop-os/cosmic-term COSMIC Terminal - طرفية COSMIC - Terminál COSMIC - Terminal COSMIC - COSMIC Terminál - Terminal - Terminal - Terminál COSMIC - Terminal COSMIC - Terminale di COSMIC - COSMIC Terminal Terminal emulator for the COSMIC desktop - محاكي طرفي لسطح مكتب COSMIC - Emulátor terminálu pro pracovní prostředí COSMIC - Emulator terminala dla pulpitu COSMIC - Terminálemulátor a COSMIC asztali környezethez - Emulador de terminal do desktop COSMIC - Emulador de terminal do desktop COSMIC - Emulátor terminálu pre pracovné prostredie COSMIC - Emulador de terminal de escritorio COSMIC - Emulatore di terminale di COSMIC - Terminalemulator för skrivbordsmiljön COSMIC

Terminal emulator for the COSMIC desktop

محاكي طرفي لسطح مكتب COSMIC

@@ -43,6 +23,12 @@

Emulatore di terminale di COSMIC

Terminalemulator för skrivbordsmiljön COSMIC

+ + Command + Shell + Terminal + CLI + com.system76.CosmicTerm.desktop https://raw.githubusercontent.com/pop-os/cosmic-term/master/res/icons/hicolor/256x256/apps/com.system76.CosmicTerm.svg diff --git a/src/main.rs b/src/main.rs index 0984566..6cc48ca 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1761,6 +1761,7 @@ impl Application for App { .icon(widget::icon::from_name(Self::APP_ID)) .version(env!("CARGO_PKG_VERSION")) .author("System76") + .comments(fl!("comment")) .license("GPL-3.0-only") .license_url("https://spdx.org/licenses/GPL-3.0-only") .developers([("Jeremy Soller", "jeremy@system76.com")])