Added program icons
Moorly CI / linux-build (push) Successful in 4m21s
Moorly CI / windows-build (push) Successful in 4m25s

This commit is contained in:
Squid committed 2026-11-12 22:18:18 +01:00
1 parent 4494dee4a8
commit cb512d743b
9 files changed
+540 -92

No files matched your search

+9 -6
View File
@@ -59,7 +59,12 @@ pub fn enable() -> Result<(), String> {
}
std::fs::write(&path, entry_contents(&executable))
.map_err(|error| format!("Could not write the autostart entry: {error}"))
.map_err(|error| format!("Could not write the autostart entry: {error}"))?;
#[cfg(target_os = "linux")]
crate::icons::refresh_linux_caches();
Ok(())
}
/// Removes our autostart entry, leaving every other entry untouched.
@@ -86,7 +91,7 @@ fn entry_contents(executable: &std::path::Path) -> String {
Name=Moorly\n\
Comment=SSH and terminal client\n\
Exec=\"{executable}\"\n\
Icon=utilities-terminal\n\
Icon=dev.moorly.Moorly\n\
Terminal=false\n\
Categories=Network;Utility;TerminalEmulator;\n\
StartupNotify=true\n\
@@ -97,10 +102,7 @@ fn entry_contents(executable: &std::path::Path) -> String {
#[cfg(windows)]
fn entry_contents(executable: &std::path::Path) -> String {
format!(
"@echo off\r\nstart \"\" \"{}\"\r\n",
executable.display()
)
format!("@echo off\r\nstart \"\" \"{}\"\r\n", executable.display())
}
#[cfg(not(any(target_os = "linux", windows)))]
@@ -115,6 +117,7 @@ mod tests {
let entry = super::entry_contents(std::path::Path::new("/usr/bin/moorly"));
assert!(entry.contains("Exec=\"/usr/bin/moorly\""));
assert!(entry.contains("Icon=dev.moorly.Moorly"));
assert!(entry.contains("X-Moorly-Generated=true"));
}
}