Skip to content

Commit

Permalink
tanoshi-tauri: Hide title bar on phosh
Browse files Browse the repository at this point in the history
  • Loading branch information
luigi311 committed Oct 23, 2024
1 parent fb00426 commit 25b8e8e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions crates/tanoshi-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
)]

extern crate log;
use std::env;
use tauri::Manager;

mod server;

Expand All @@ -23,6 +25,21 @@ fn main() {
.plugin(tauri_plugin_clipboard_manager::init())
.plugin(tauri_plugin_fs::init())
.plugin(Server::new())
.setup(|app| {
let window = app.get_webview_window("main").unwrap();

// Check if running on Phosh
if let Ok(session) = env::var("XDG_SESSION_DESKTOP") {
println!("Session: {}", session);
if session == "phosh" {
// Hide title bar if running on Phosh
window.set_decorations(false).unwrap();
} else {
window.set_decorations(true).unwrap();
}
}
Ok(())
})
.run(tauri::generate_context!())
.expect("error while running tauri application");
}

0 comments on commit 25b8e8e

Please sign in to comment.