mirror of
https://github.com/arabianq/pipewire-soundpad.git
synced 2026-04-28 06:21:23 +00:00
move creation of dirs to the separate function
This commit is contained in:
+21
-16
@@ -1,10 +1,31 @@
|
|||||||
use eframe::NativeOptions;
|
use eframe::NativeOptions;
|
||||||
use egui::Vec2;
|
use egui::Vec2;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
|
use std::fs::create_dir;
|
||||||
|
|
||||||
mod app;
|
mod app;
|
||||||
|
|
||||||
fn main() -> Result<(), eframe::Error> {
|
fn main() -> Result<(), eframe::Error> {
|
||||||
|
create_dirs();
|
||||||
|
|
||||||
|
let mut options = NativeOptions {
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
|
options.viewport.min_inner_size = Some(Vec2::new(400.0, 400.0));
|
||||||
|
options.vsync = true;
|
||||||
|
options.hardware_acceleration = eframe::HardwareAcceleration::Preferred;
|
||||||
|
|
||||||
|
eframe::run_native(
|
||||||
|
"PipeWire SoundPad",
|
||||||
|
options,
|
||||||
|
Box::new(|cc| {
|
||||||
|
egui_material_icons::initialize(&cc.egui_ctx);
|
||||||
|
Ok(Box::new(app::App::new(cc)))
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn create_dirs() {
|
||||||
let config_dir_path = dirs::config_dir().unwrap().join("pwsp");
|
let config_dir_path = dirs::config_dir().unwrap().join("pwsp");
|
||||||
fs::create_dir_all(&config_dir_path).ok();
|
fs::create_dir_all(&config_dir_path).ok();
|
||||||
|
|
||||||
@@ -26,20 +47,4 @@ fn main() -> Result<(), eframe::Error> {
|
|||||||
{
|
{
|
||||||
fs::File::create(config_dir_path.join("saved_volume")).ok();
|
fs::File::create(config_dir_path.join("saved_volume")).ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut options = NativeOptions {
|
|
||||||
..Default::default()
|
|
||||||
};
|
|
||||||
options.viewport.min_inner_size = Some(Vec2::new(400.0, 400.0));
|
|
||||||
options.vsync = true;
|
|
||||||
options.hardware_acceleration = eframe::HardwareAcceleration::Preferred;
|
|
||||||
|
|
||||||
eframe::run_native(
|
|
||||||
"PipeWire SoundPad",
|
|
||||||
options,
|
|
||||||
Box::new(|cc| {
|
|
||||||
egui_material_icons::initialize(&cc.egui_ctx);
|
|
||||||
Ok(Box::new(app::App::new(cc)))
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user