feat: use cosmic-config to remember active page
This commit is contained in:
parent
18527db707
commit
14a4a23bc9
4 changed files with 30 additions and 233 deletions
153
Cargo.lock
generated
153
Cargo.lock
generated
|
|
@ -383,18 +383,6 @@ version = "2.3.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6776fc96284a0bb647b615056fc496d1fe1644a7ab01829818a6d91cae888b84"
|
checksum = "6776fc96284a0bb647b615056fc496d1fe1644a7ab01829818a6d91cae888b84"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "bitvec"
|
|
||||||
version = "1.0.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c"
|
|
||||||
dependencies = [
|
|
||||||
"funty",
|
|
||||||
"radium",
|
|
||||||
"tap",
|
|
||||||
"wyz",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "block"
|
name = "block"
|
||||||
version = "0.1.6"
|
version = "0.1.6"
|
||||||
|
|
@ -440,28 +428,6 @@ dependencies = [
|
||||||
"utf8-width",
|
"utf8-width",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "bytecheck"
|
|
||||||
version = "0.6.11"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "8b6372023ac861f6e6dc89c8344a8f398fb42aaba2b5dbc649ca0c0e9dbcb627"
|
|
||||||
dependencies = [
|
|
||||||
"bytecheck_derive",
|
|
||||||
"ptr_meta",
|
|
||||||
"simdutf8",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "bytecheck_derive"
|
|
||||||
version = "0.6.11"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61"
|
|
||||||
dependencies = [
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"syn 1.0.109",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bytemuck"
|
name = "bytemuck"
|
||||||
version = "1.13.1"
|
version = "1.13.1"
|
||||||
|
|
@ -792,7 +758,6 @@ version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"apply",
|
"apply",
|
||||||
"async-channel",
|
"async-channel",
|
||||||
"bytecheck",
|
|
||||||
"color-eyre",
|
"color-eyre",
|
||||||
"cosmic-panel-config",
|
"cosmic-panel-config",
|
||||||
"cosmic-settings-page",
|
"cosmic-settings-page",
|
||||||
|
|
@ -807,7 +772,6 @@ dependencies = [
|
||||||
"libcosmic",
|
"libcosmic",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"regex",
|
"regex",
|
||||||
"rkyv",
|
|
||||||
"rust-embed",
|
"rust-embed",
|
||||||
"slotmap",
|
"slotmap",
|
||||||
"tokio",
|
"tokio",
|
||||||
|
|
@ -1642,12 +1606,6 @@ dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "funty"
|
|
||||||
version = "2.0.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures"
|
name = "futures"
|
||||||
version = "0.3.28"
|
version = "0.3.28"
|
||||||
|
|
@ -3430,26 +3388,6 @@ version = "1.0.8"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "332cd62e95873ea4f41f3dfd6bbbfc5b52aec892d7e8d534197c4720a0bbbab2"
|
checksum = "332cd62e95873ea4f41f3dfd6bbbfc5b52aec892d7e8d534197c4720a0bbbab2"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "ptr_meta"
|
|
||||||
version = "0.1.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1"
|
|
||||||
dependencies = [
|
|
||||||
"ptr_meta_derive",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "ptr_meta_derive"
|
|
||||||
version = "0.1.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac"
|
|
||||||
dependencies = [
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"syn 1.0.109",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "qoi"
|
name = "qoi"
|
||||||
version = "0.4.1"
|
version = "0.4.1"
|
||||||
|
|
@ -3477,12 +3415,6 @@ dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "radium"
|
|
||||||
version = "0.7.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rand"
|
name = "rand"
|
||||||
version = "0.8.5"
|
version = "0.8.5"
|
||||||
|
|
@ -3639,15 +3571,6 @@ version = "0.7.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78"
|
checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "rend"
|
|
||||||
version = "0.4.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "581008d2099240d37fb08d77ad713bcaec2c4d89d50b5b21a8bb1996bbab68ab"
|
|
||||||
dependencies = [
|
|
||||||
"bytecheck",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "renderdoc-sys"
|
name = "renderdoc-sys"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
|
|
@ -3681,34 +3604,6 @@ dependencies = [
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "rkyv"
|
|
||||||
version = "0.7.42"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "0200c8230b013893c0b2d6213d6ec64ed2b9be2e0e016682b7224ff82cff5c58"
|
|
||||||
dependencies = [
|
|
||||||
"bitvec",
|
|
||||||
"bytecheck",
|
|
||||||
"hashbrown 0.12.3",
|
|
||||||
"ptr_meta",
|
|
||||||
"rend",
|
|
||||||
"rkyv_derive",
|
|
||||||
"seahash",
|
|
||||||
"tinyvec",
|
|
||||||
"uuid",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "rkyv_derive"
|
|
||||||
version = "0.7.42"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "b2e06b915b5c230a17d7a736d1e2e63ee753c256a8614ef3f5147b13a4f5541d"
|
|
||||||
dependencies = [
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"syn 1.0.109",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ron"
|
name = "ron"
|
||||||
version = "0.8.0"
|
version = "0.8.0"
|
||||||
|
|
@ -3877,12 +3772,6 @@ dependencies = [
|
||||||
"tiny-skia 0.7.0",
|
"tiny-skia 0.7.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "seahash"
|
|
||||||
version = "4.1.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "self_cell"
|
name = "self_cell"
|
||||||
version = "0.10.2"
|
version = "0.10.2"
|
||||||
|
|
@ -4006,12 +3895,6 @@ version = "0.3.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "238abfbb77c1915110ad968465608b68e869e0772622c9656714e73e5a1a522f"
|
checksum = "238abfbb77c1915110ad968465608b68e869e0772622c9656714e73e5a1a522f"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "simdutf8"
|
|
||||||
version = "0.1.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "simplecss"
|
name = "simplecss"
|
||||||
version = "0.2.1"
|
version = "0.2.1"
|
||||||
|
|
@ -4288,12 +4171,6 @@ dependencies = [
|
||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "tap"
|
|
||||||
version = "1.0.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tempfile"
|
name = "tempfile"
|
||||||
version = "3.5.0"
|
version = "3.5.0"
|
||||||
|
|
@ -4427,21 +4304,6 @@ dependencies = [
|
||||||
"zerovec",
|
"zerovec",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "tinyvec"
|
|
||||||
version = "1.6.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50"
|
|
||||||
dependencies = [
|
|
||||||
"tinyvec_macros",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "tinyvec_macros"
|
|
||||||
version = "0.1.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tokio"
|
name = "tokio"
|
||||||
version = "1.28.2"
|
version = "1.28.2"
|
||||||
|
|
@ -4772,12 +4634,6 @@ version = "0.1.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5190c9442dcdaf0ddd50f37420417d219ae5261bbf5db120d0f9bab996c9cba1"
|
checksum = "5190c9442dcdaf0ddd50f37420417d219ae5261bbf5db120d0f9bab996c9cba1"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "uuid"
|
|
||||||
version = "1.3.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "345444e32442451b267fc254ae85a209c64be56d2890e601a0c37ff0c3c5ecd2"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "valuable"
|
name = "valuable"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
|
@ -5515,15 +5371,6 @@ version = "0.5.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "60e49e42bdb1d5dc76f4cd78102f8f0714d32edfa3efb82286eb0f0b1fc0da0f"
|
checksum = "60e49e42bdb1d5dc76f4cd78102f8f0714d32edfa3efb82286eb0f0b1fc0da0f"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "wyz"
|
|
||||||
version = "0.5.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed"
|
|
||||||
dependencies = [
|
|
||||||
"tap",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "x11-dl"
|
name = "x11-dl"
|
||||||
version = "2.21.0"
|
version = "2.21.0"
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ rust-version = "1.65.0"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
apply = "0.3.0"
|
apply = "0.3.0"
|
||||||
async-channel = "1.8.0"
|
async-channel = "1.8.0"
|
||||||
bytecheck = "0.6.11"
|
|
||||||
color-eyre = "0.6.2"
|
color-eyre = "0.6.2"
|
||||||
cosmic-settings-page = { path = "../page" }
|
cosmic-settings-page = { path = "../page" }
|
||||||
cosmic-settings-system = { path = "../pages/system" }
|
cosmic-settings-system = { path = "../pages/system" }
|
||||||
|
|
@ -20,7 +19,6 @@ i18n-embed-fl = "0.6.7"
|
||||||
libcosmic = {workspace = true}
|
libcosmic = {workspace = true}
|
||||||
once_cell = "1.17.2"
|
once_cell = "1.17.2"
|
||||||
regex = "1.8.3"
|
regex = "1.8.3"
|
||||||
rkyv = { version = "0.7.42", features = ["validation"]}
|
|
||||||
rust-embed = "6.6.1"
|
rust-embed = "6.6.1"
|
||||||
slotmap = "1.0.6"
|
slotmap = "1.0.6"
|
||||||
tokio = "1.28.2"
|
tokio = "1.28.2"
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ use cosmic::{
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
config::{self, Config},
|
config::Config,
|
||||||
pages::{
|
pages::{
|
||||||
desktop::{self, panel},
|
desktop::{self, panel},
|
||||||
sound, system, time,
|
sound, system, time,
|
||||||
|
|
@ -43,7 +43,6 @@ use std::process;
|
||||||
pub struct SettingsApp {
|
pub struct SettingsApp {
|
||||||
pub active_page: page::Entity,
|
pub active_page: page::Entity,
|
||||||
pub config: Config,
|
pub config: Config,
|
||||||
pub config_path: config::PathManager,
|
|
||||||
pub debug: bool,
|
pub debug: bool,
|
||||||
pub is_condensed: bool,
|
pub is_condensed: bool,
|
||||||
pub nav_bar_toggled_condensed: bool,
|
pub nav_bar_toggled_condensed: bool,
|
||||||
|
|
@ -87,13 +86,10 @@ impl Application for SettingsApp {
|
||||||
type Theme = Theme;
|
type Theme = Theme;
|
||||||
|
|
||||||
fn new(_: Self::Flags) -> (Self, Command<Self::Message>) {
|
fn new(_: Self::Flags) -> (Self, Command<Self::Message>) {
|
||||||
let mut config_path = config::PathManager::new();
|
|
||||||
|
|
||||||
let mut app = SettingsApp {
|
let mut app = SettingsApp {
|
||||||
sharp_corners: false,
|
sharp_corners: false,
|
||||||
active_page: page::Entity::default(),
|
active_page: page::Entity::default(),
|
||||||
config: config_path.config("main", Config::deserialize),
|
config: Config::new(),
|
||||||
config_path,
|
|
||||||
debug: false,
|
debug: false,
|
||||||
is_condensed: false,
|
is_condensed: false,
|
||||||
nav_bar: segmented_button::Model::default(),
|
nav_bar: segmented_button::Model::default(),
|
||||||
|
|
@ -389,8 +385,8 @@ impl SettingsApp {
|
||||||
|
|
||||||
if current_page != page {
|
if current_page != page {
|
||||||
self.config.active_page = Box::from(&*self.pages.info[page].id);
|
self.config.active_page = Box::from(&*self.pages.info[page].id);
|
||||||
self.config_path
|
self.config
|
||||||
.config("main", |path| self.config.serialize(path));
|
.set_active_page(Box::from(&*self.pages.info[page].id));
|
||||||
}
|
}
|
||||||
|
|
||||||
self.search_clear();
|
self.search_clear();
|
||||||
|
|
|
||||||
|
|
@ -1,99 +1,55 @@
|
||||||
// Copyright 2023 System76 <info@system76.com>
|
// Copyright 2023 System76 <info@system76.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
|
||||||
mod path {
|
use cosmic::cosmic_config::{self, ConfigGet, ConfigSet};
|
||||||
use std::path::Path;
|
|
||||||
|
|
||||||
#[must_use]
|
const NAME: &str = "com.system76.CosmicSettings";
|
||||||
|
|
||||||
pub struct Manager {
|
const ACTIVE_PAGE: &str = "active-page";
|
||||||
base: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Manager {
|
|
||||||
#[allow(clippy::new_without_default)]
|
|
||||||
pub fn new() -> Self {
|
|
||||||
let mut base = dirs::config_dir()
|
|
||||||
.expect("XDG config directory missing")
|
|
||||||
.join("cosmic-settings")
|
|
||||||
.into_os_string()
|
|
||||||
.into_string()
|
|
||||||
.expect("XDG config path is not UTF-8");
|
|
||||||
|
|
||||||
base.push('/');
|
|
||||||
|
|
||||||
if !Path::new(&base).exists() {
|
|
||||||
let _res = std::fs::create_dir_all(&base);
|
|
||||||
}
|
|
||||||
|
|
||||||
Self { base }
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn config<T>(&mut self, page: &str, with: impl Fn(&Path) -> T) -> T {
|
|
||||||
let truncate_length = self.base.len();
|
|
||||||
|
|
||||||
self.base.push_str(page);
|
|
||||||
self.base.push_str(".config");
|
|
||||||
|
|
||||||
let output = with(Path::new(&self.base));
|
|
||||||
self.base.truncate(truncate_length);
|
|
||||||
output
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub use path::Manager as PathManager;
|
|
||||||
|
|
||||||
use bytecheck::CheckBytes;
|
|
||||||
use rkyv::{ser::Serializer, Archive, Deserialize, Serialize};
|
|
||||||
use std::{io::Read, path::Path};
|
|
||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
#[repr(C)]
|
#[derive(Debug)]
|
||||||
#[derive(Archive, Debug, Deserialize, Serialize)]
|
|
||||||
#[archive_attr(derive(CheckBytes, Debug))]
|
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
|
pub cosmic_config: Option<cosmic_config::Config>,
|
||||||
pub active_page: Box<str>,
|
pub active_page: Box<str>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Config {
|
impl Config {
|
||||||
pub fn deserialize(path: &Path) -> Self {
|
pub fn new() -> Self {
|
||||||
let Ok(mut file) = std::fs::File::open(path) else {
|
let mut config = Self::default();
|
||||||
return Self::default();
|
|
||||||
|
let context = match cosmic_config::Config::new(NAME, 1) {
|
||||||
|
Ok(context) => context,
|
||||||
|
Err(why) => {
|
||||||
|
tracing::warn!(?why, "failed to get config");
|
||||||
|
return Self::default();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut buffer = Vec::with_capacity(128);
|
if let Ok(page) = context.get::<Box<str>>(ACTIVE_PAGE) {
|
||||||
if file.read_to_end(&mut buffer).is_err() {
|
config.active_page = page;
|
||||||
return Self::default();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer.shrink_to_fit();
|
config.cosmic_config = Some(context);
|
||||||
|
|
||||||
let Ok(archived) = rkyv::check_archived_root::<Self>(buffer.as_slice()) else {
|
config
|
||||||
return Self::default();
|
|
||||||
};
|
|
||||||
|
|
||||||
archived
|
|
||||||
.deserialize(&mut rkyv::Infallible)
|
|
||||||
.unwrap_or_default()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn serialize(&self, path: &Path) {
|
pub fn set_active_page(&mut self, page: Box<str>) {
|
||||||
let mut serializer = rkyv::ser::serializers::AllocSerializer::<0>::default();
|
if let Some(context) = self.cosmic_config.as_ref() {
|
||||||
|
if let Err(why) = context.set::<Box<str>>(ACTIVE_PAGE, page.clone()) {
|
||||||
|
tracing::error!(?why, "failed to store active page ID");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if serializer.serialize_value(self).is_err() {
|
self.active_page = page;
|
||||||
return;
|
|
||||||
};
|
|
||||||
|
|
||||||
let bytes = serializer.into_serializer().into_inner();
|
|
||||||
|
|
||||||
let _res = std::fs::write(path, &bytes);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Config {
|
impl Default for Config {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
cosmic_config: None,
|
||||||
active_page: Box::from("desktop"),
|
active_page: Box::from("desktop"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue