updated app name + fixed missing icon in pkgbuild

This commit is contained in:
nvrl committed 2026-06-30 04:58:03 +02:00
1 parent aa70077ad0
commit 86fa8aef03
7 files changed
+118 -5

No files matched your search

+12 -1
View File
@@ -93,11 +93,22 @@ fn main() -> glib::ExitCode {
.init();
let app = adw::Application::builder().application_id(APP_ID).build();
app.connect_startup(|_| load_proton_theme());
app.connect_startup(|_| {
load_proton_theme();
spawn_tray();
});
app.connect_activate(build_window);
app.run()
}
/// Spawn the tray icon process in the background.
fn spawn_tray() {
match Command::new("pdfs-tray").spawn() {
Ok(_) => tracing::info!("spawned `pdfs-tray`"),
Err(e) => tracing::error!("failed to spawn `pdfs-tray`: {e}"),
}
}
/// Install a CSS provider that overrides libadwaita's accent colour with Proton
/// purple, app-wide. Named-colour overrides recolour the stock widgets (switch,
/// buttons, progress fill) without per-widget styling.
+11
View File
@@ -180,6 +180,17 @@ fn main() -> Result<()> {
.init();
let dirs = AppDirs::new().context("resolve app dirs")?;
// Ensure only one instance of the tray runs.
let tray_sock = dirs.tray_socket();
if std::os::unix::net::UnixStream::connect(&tray_sock).is_ok() {
tracing::info!("Another instance of pdfs-tray is already running; exiting.");
return Ok(());
}
let _ = std::fs::remove_file(&tray_sock);
let _lock_socket = std::os::unix::net::UnixListener::bind(&tray_sock)
.context("failed to bind tray single-instance socket")?;
let socket = dirs.control_socket();
let default_mountpoint = dirs.default_mountpoint();