mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 07:15:47 +00:00
c75297fcf6
Embed bash and zsh completion scripts and add a `completions` subcommand. Extend the player CLI (library, audio device, instant mix) and surface `music_library` in snapshots. Add a shared active-server switcher in the header and locales; instant mix can reseed the queue from CLI and UI.
37 lines
1.2 KiB
Rust
37 lines
1.2 KiB
Rust
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
|
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
|
|
|
fn main() {
|
|
// WebKitGTK on Wayland is unstable — force X11/XWayland on all Linux packages.
|
|
// Users can still override by setting these vars before launch.
|
|
#[cfg(target_os = "linux")]
|
|
unsafe {
|
|
if std::env::var("GDK_BACKEND").is_err() {
|
|
std::env::set_var("GDK_BACKEND", "x11");
|
|
}
|
|
if std::env::var("WEBKIT_DISABLE_COMPOSITING_MODE").is_err() {
|
|
std::env::set_var("WEBKIT_DISABLE_COMPOSITING_MODE", "1");
|
|
}
|
|
}
|
|
|
|
let args: Vec<String> = std::env::args().collect();
|
|
if psysonic_lib::cli::wants_version(&args) {
|
|
psysonic_lib::cli::print_version();
|
|
return;
|
|
}
|
|
if psysonic_lib::cli::wants_help(&args) {
|
|
psysonic_lib::cli::print_help(
|
|
args.first().map(|s| s.as_str()).unwrap_or("psysonic"),
|
|
);
|
|
return;
|
|
}
|
|
if let Some(code) = psysonic_lib::cli::try_completions_dispatch(&args) {
|
|
std::process::exit(code);
|
|
}
|
|
if psysonic_lib::cli::wants_info(&args) {
|
|
psysonic_lib::cli::run_info_and_exit(&args);
|
|
}
|
|
|
|
psysonic_lib::run();
|
|
}
|