Skip to content

Commit

Permalink
Merge pull request #37 from luigi311/titlebar
Browse files Browse the repository at this point in the history
Hide titlebar on phosh
  • Loading branch information
luigi311 authored Oct 23, 2024
2 parents 0ef6523 + a0d5a92 commit 99fde63
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 99fde63

Please sign in to comment.