chore: add rustfmt config
This commit is contained in:
parent
cb4a0d3a3a
commit
4b1f388a4f
78 changed files with 394 additions and 485 deletions
15
.zed/settings.json
Normal file
15
.zed/settings.json
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"format_on_save": "on",
|
||||
"lsp": {
|
||||
"rust-analyzer": {
|
||||
"initialization_options": {
|
||||
"check": {
|
||||
"command": "clippy",
|
||||
},
|
||||
"rustfmt": {
|
||||
"extraArgs": ["+nightly"],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
use std::{env, fs, path::PathBuf};
|
||||
use std::path::PathBuf;
|
||||
use std::{env, fs};
|
||||
use xdgen::{App, Context, FluentString};
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ use crate::PageCommands;
|
|||
use crate::config::Config;
|
||||
#[cfg(feature = "page-accessibility")]
|
||||
use crate::pages::accessibility;
|
||||
use crate::pages::applications;
|
||||
#[cfg(feature = "page-bluetooth")]
|
||||
use crate::pages::bluetooth;
|
||||
use crate::pages::desktop::{self, appearance};
|
||||
|
|
@ -19,26 +18,21 @@ use crate::pages::networking;
|
|||
use crate::pages::power;
|
||||
#[cfg(feature = "page-sound")]
|
||||
use crate::pages::sound;
|
||||
use crate::pages::{self, system, time};
|
||||
use crate::pages::{self, applications, system, time};
|
||||
use crate::subscription::desktop_files;
|
||||
use crate::widget::{page_title, search_header};
|
||||
use cosmic::app::context_drawer::ContextDrawer;
|
||||
use cosmic::app::{Core, Task};
|
||||
#[cfg(feature = "wayland")]
|
||||
use cosmic::cctk::{sctk::output::OutputInfo, wayland_client::protocol::wl_output::WlOutput};
|
||||
use cosmic::{
|
||||
Element,
|
||||
app::{Core, Task, context_drawer::ContextDrawer},
|
||||
iced::{
|
||||
self, Length, Subscription,
|
||||
event::{self, PlatformSpecific},
|
||||
keyboard, window,
|
||||
},
|
||||
prelude::*,
|
||||
surface,
|
||||
widget::{
|
||||
button, column, container, icon, id_container, nav_bar, row, scrollable, segmented_button,
|
||||
settings, text_input,
|
||||
},
|
||||
use cosmic::iced::event::{self, PlatformSpecific};
|
||||
use cosmic::iced::{self, Length, Subscription, keyboard, window};
|
||||
use cosmic::prelude::*;
|
||||
use cosmic::widget::{
|
||||
button, column, container, icon, id_container, nav_bar, row, scrollable, segmented_button,
|
||||
settings, text_input,
|
||||
};
|
||||
use cosmic::{Element, surface};
|
||||
#[cfg(feature = "cosmic-comp-config")]
|
||||
use cosmic_comp_config::CosmicCompConfig;
|
||||
#[cfg(feature = "wayland")]
|
||||
|
|
@ -52,8 +46,9 @@ use desktop::{
|
|||
#[cfg(feature = "wayland")]
|
||||
use event::wayland;
|
||||
use page::Entity;
|
||||
use std::borrow::Cow;
|
||||
use std::collections::BTreeSet;
|
||||
use std::{borrow::Cow, str::FromStr};
|
||||
use std::str::FromStr;
|
||||
|
||||
#[allow(clippy::struct_excessive_bools)]
|
||||
#[allow(clippy::module_name_repetitions)]
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
// Copyright 2023 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use cosmic::{
|
||||
cosmic_config::{self, ConfigGet, ConfigSet},
|
||||
cosmic_theme::palette::Srgba,
|
||||
};
|
||||
use cosmic::cosmic_config::{self, ConfigGet, ConfigSet};
|
||||
use cosmic::cosmic_theme::palette::Srgba;
|
||||
|
||||
const NAME: &str = "com.system76.CosmicSettings";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
// Copyright 2023 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use i18n_embed::{
|
||||
DefaultLocalizer, LanguageLoader, Localizer,
|
||||
fluent::{FluentLanguageLoader, fluent_language_loader},
|
||||
};
|
||||
use i18n_embed::fluent::{FluentLanguageLoader, fluent_language_loader};
|
||||
use i18n_embed::{DefaultLocalizer, LanguageLoader, Localizer};
|
||||
use rust_embed::RustEmbed;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,8 @@ pub mod widget;
|
|||
use std::path::PathBuf;
|
||||
|
||||
use clap::{Parser, Subcommand};
|
||||
use cosmic::{app::CosmicFlags, iced::Limits};
|
||||
use cosmic::app::CosmicFlags;
|
||||
use cosmic::iced::Limits;
|
||||
use i18n_embed::DesktopLanguageRequester;
|
||||
use ron::error::SpannedError;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
|
|
|||
|
|
@ -1,20 +1,15 @@
|
|||
use std::collections::HashSet;
|
||||
use std::fmt::Write;
|
||||
|
||||
use cosmic::{
|
||||
Apply,
|
||||
iced::core::text::Wrapping,
|
||||
iced::{Element, Length, stream},
|
||||
surface,
|
||||
widget::{self, icon, settings, svg, text},
|
||||
};
|
||||
use cosmic::iced::core::text::Wrapping;
|
||||
use cosmic::iced::{Element, Length, stream};
|
||||
use cosmic::widget::{self, icon, settings, svg, text};
|
||||
use cosmic::{Apply, surface};
|
||||
use cosmic_comp_config::{ZoomConfig, ZoomMovement};
|
||||
use cosmic_config::{ConfigGet, ConfigSet};
|
||||
use cosmic_settings_config::{Action, Binding, shortcuts};
|
||||
use cosmic_settings_page::{
|
||||
self as page, Entity,
|
||||
section::{self, Section},
|
||||
};
|
||||
use cosmic_settings_page::section::{self, Section};
|
||||
use cosmic_settings_page::{self as page, Entity};
|
||||
use futures::SinkExt;
|
||||
use slotmap::SlotMap;
|
||||
use tracing::error;
|
||||
|
|
|
|||
|
|
@ -1,21 +1,16 @@
|
|||
use cosmic::{
|
||||
Apply, Element, Task,
|
||||
cosmic_theme::{CosmicPalette, ThemeBuilder},
|
||||
iced::core::text::Wrapping,
|
||||
iced::stream,
|
||||
surface,
|
||||
theme::CosmicTheme,
|
||||
widget::{dropdown, settings, text},
|
||||
};
|
||||
use cosmic::cosmic_theme::{CosmicPalette, ThemeBuilder};
|
||||
use cosmic::iced::core::text::Wrapping;
|
||||
use cosmic::iced::stream;
|
||||
use cosmic::theme::CosmicTheme;
|
||||
use cosmic::widget::{dropdown, settings, text};
|
||||
use cosmic::{Apply, Element, Task, surface};
|
||||
pub use cosmic_comp_config::ZoomMovement;
|
||||
use cosmic_config::CosmicConfigEntry;
|
||||
use cosmic_settings_a11y_manager_subscription as cosmic_a11y_manager;
|
||||
use cosmic_settings_accessibility_subscription as a11y_bus;
|
||||
use cosmic_settings_daemon_config::CosmicSettingsDaemonConfig;
|
||||
use cosmic_settings_page::{
|
||||
self as page, Insert,
|
||||
section::{self, Section},
|
||||
};
|
||||
use cosmic_settings_page::section::{self, Section};
|
||||
use cosmic_settings_page::{self as page, Insert};
|
||||
use futures::SinkExt;
|
||||
use num_traits::FromPrimitive;
|
||||
use slotmap::SlotMap;
|
||||
|
|
|
|||
|
|
@ -2,19 +2,14 @@
|
|||
// Copyright 2024 bbb651 <bar.ye651@gmail.com>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use std::{
|
||||
borrow::Cow,
|
||||
collections::{BTreeMap, BTreeSet},
|
||||
path::{Path, PathBuf},
|
||||
sync::Arc,
|
||||
};
|
||||
use std::borrow::Cow;
|
||||
use std::collections::{BTreeMap, BTreeSet};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::Arc;
|
||||
|
||||
use cosmic::{
|
||||
Apply, Element, Task,
|
||||
iced::{Alignment, Length},
|
||||
surface,
|
||||
widget::{self, dropdown, icon, settings},
|
||||
};
|
||||
use cosmic::iced::{Alignment, Length};
|
||||
use cosmic::widget::{self, dropdown, icon, settings};
|
||||
use cosmic::{Apply, Element, Task, surface};
|
||||
use cosmic_config::{ConfigGet, ConfigSet};
|
||||
use cosmic_settings_config::shortcuts::SystemActions;
|
||||
use cosmic_settings_config::shortcuts::action::System;
|
||||
|
|
|
|||
|
|
@ -1,25 +1,17 @@
|
|||
// Copyright 2023 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use std::{
|
||||
process::ExitStatus,
|
||||
sync::{
|
||||
Arc,
|
||||
atomic::{AtomicBool, Ordering},
|
||||
},
|
||||
};
|
||||
use std::process::ExitStatus;
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
|
||||
use cosmic::{
|
||||
Apply, Element, Task,
|
||||
cosmic_config::{self, ConfigGet, ConfigSet},
|
||||
iced::stream,
|
||||
surface,
|
||||
widget::{self, dropdown, settings, text},
|
||||
};
|
||||
use cosmic::cosmic_config::{self, ConfigGet, ConfigSet};
|
||||
use cosmic::iced::stream;
|
||||
use cosmic::widget::{self, dropdown, settings, text};
|
||||
use cosmic::{Apply, Element, Task, surface};
|
||||
use cosmic_comp_config::{EavesdroppingKeyboardMode, XwaylandDescaling, XwaylandEavesdropping};
|
||||
use cosmic_randr_shell::List;
|
||||
use cosmic_settings_page::Section;
|
||||
use cosmic_settings_page::{self as page, section};
|
||||
use cosmic_settings_page::{self as page, Section, section};
|
||||
use futures::SinkExt;
|
||||
use slotmap::SlotMap;
|
||||
use tokio::sync::oneshot;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
|
||||
use cosmic::iced::core::text::Wrapping;
|
||||
use cosmic::iced::{Alignment, Length, color};
|
||||
use cosmic::widget::{self, settings, space::horizontal as horizontal_space, text};
|
||||
use cosmic::widget::space::horizontal as horizontal_space;
|
||||
use cosmic::widget::{self, settings, text};
|
||||
use cosmic::{Apply, Element, Task, theme};
|
||||
use cosmic_settings_bluetooth_subscription::*;
|
||||
use cosmic_settings_page::{self as page, Section, section};
|
||||
|
|
|
|||
|
|
@ -3,11 +3,9 @@ use cosmic::config::CosmicTk;
|
|||
use cosmic::cosmic_config::{Config, ConfigSet};
|
||||
use cosmic::cosmic_theme::Spacing;
|
||||
use cosmic::iced::core::{Color, Length};
|
||||
use cosmic::widget::{
|
||||
ColorPickerModel, color_picker::ColorPickerUpdate, container, flex_row, settings, text,
|
||||
};
|
||||
use cosmic::{Apply, Task};
|
||||
use cosmic::{Element, widget};
|
||||
use cosmic::widget::color_picker::ColorPickerUpdate;
|
||||
use cosmic::widget::{ColorPickerModel, container, flex_row, settings, text};
|
||||
use cosmic::{Apply, Element, Task, widget};
|
||||
use cosmic_config::ConfigGet;
|
||||
use std::sync::Arc;
|
||||
use tracing::error;
|
||||
|
|
@ -15,11 +13,8 @@ use tracing::error;
|
|||
use crate::app;
|
||||
use crate::widget::color_picker_context_view;
|
||||
|
||||
use super::{
|
||||
ContextView, Message, font_config, icon_themes,
|
||||
icon_themes::{IconHandles, IconThemes},
|
||||
theme_manager,
|
||||
};
|
||||
use super::icon_themes::{IconHandles, IconThemes};
|
||||
use super::{ContextView, Message, font_config, icon_themes, theme_manager};
|
||||
|
||||
pub struct Content {
|
||||
context_view: Option<ContextView>,
|
||||
|
|
|
|||
|
|
@ -3,11 +3,8 @@
|
|||
|
||||
use std::sync::Arc;
|
||||
|
||||
use cosmic::{
|
||||
Apply, Element, Task,
|
||||
config::{CosmicTk, FontConfig},
|
||||
widget,
|
||||
};
|
||||
use cosmic::config::{CosmicTk, FontConfig};
|
||||
use cosmic::{Apply, Element, Task, widget};
|
||||
use cosmic_config::ConfigSet;
|
||||
|
||||
use crate::app;
|
||||
|
|
|
|||
|
|
@ -1,14 +1,13 @@
|
|||
// Copyright 2024 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use std::{collections::BTreeMap, path::PathBuf};
|
||||
use std::collections::BTreeMap;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use super::Message;
|
||||
use cosmic::{
|
||||
Element,
|
||||
iced::{Background, Length},
|
||||
widget::{button, icon, text},
|
||||
};
|
||||
use cosmic::Element;
|
||||
use cosmic::iced::{Background, Length};
|
||||
use cosmic::widget::{button, icon, text};
|
||||
use tokio::io::AsyncBufReadExt;
|
||||
|
||||
const ICON_PREV_N: usize = 6;
|
||||
|
|
|
|||
|
|
@ -21,14 +21,13 @@ use cosmic::cosmic_theme::{CornerRadii, Density, Roundness, ThemeBuilder, ThemeM
|
|||
use cosmic::dialog::file_chooser::{self, FileFilter};
|
||||
use cosmic::iced::Subscription;
|
||||
use cosmic::iced::core::{Alignment, Length};
|
||||
use cosmic::widget::{
|
||||
button, color_picker::ColorPickerUpdate, container, row, settings, space::horizontal, text,
|
||||
};
|
||||
use cosmic::widget::color_picker::ColorPickerUpdate;
|
||||
use cosmic::widget::space::horizontal;
|
||||
use cosmic::widget::{button, container, row, settings, text};
|
||||
use cosmic::{Apply, Element, Task, widget};
|
||||
#[cfg(feature = "wayland")]
|
||||
use cosmic_panel_config::CosmicPanelConfig;
|
||||
use cosmic_settings_page::Section;
|
||||
use cosmic_settings_page::{self as page, section};
|
||||
use cosmic_settings_page::{self as page, Section, section};
|
||||
use ron::ser::PrettyConfig;
|
||||
use slotmap::{Key, SlotMap};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
use cosmic::iced::core::{Alignment, Length, text::Wrapping};
|
||||
use cosmic::iced::core::text::Wrapping;
|
||||
use cosmic::iced::core::{Alignment, Length};
|
||||
use cosmic::widget::icon::{from_name, icon};
|
||||
use cosmic::widget::{button, container, settings, text};
|
||||
use cosmic::{Apply, Element};
|
||||
|
|
|
|||
|
|
@ -1,22 +1,16 @@
|
|||
use cosmic::{
|
||||
Apply, Element, Task,
|
||||
app::ContextDrawer,
|
||||
cosmic_config::CosmicConfigEntry,
|
||||
iced::{Alignment, Length},
|
||||
widget::{button, container, row},
|
||||
};
|
||||
use cosmic::app::ContextDrawer;
|
||||
use cosmic::cosmic_config::CosmicConfigEntry;
|
||||
use cosmic::iced::{Alignment, Length};
|
||||
use cosmic::widget::{button, container, row};
|
||||
use cosmic::{Apply, Element, Task};
|
||||
use cosmic_panel_config::CosmicPanelConfig;
|
||||
use cosmic_settings_page::{self as page, Section, section};
|
||||
use slotmap::{Key, SlotMap};
|
||||
use std::borrow::Cow;
|
||||
|
||||
use crate::{
|
||||
app,
|
||||
pages::{
|
||||
self,
|
||||
desktop::panel::applets_inner::{self, AppletsPage, ContextDrawerVariant, lists},
|
||||
},
|
||||
};
|
||||
use crate::app;
|
||||
use crate::pages::desktop::panel::applets_inner::{self, AppletsPage, ContextDrawerVariant, lists};
|
||||
use crate::pages::{self};
|
||||
|
||||
pub(crate) struct Page {
|
||||
inner: applets_inner::Page,
|
||||
|
|
|
|||
|
|
@ -1,11 +1,8 @@
|
|||
use std::collections::HashMap;
|
||||
|
||||
use cosmic::Apply;
|
||||
use cosmic::{
|
||||
Element, Task,
|
||||
cosmic_config::{ConfigSet, CosmicConfigEntry},
|
||||
widget::{settings, text},
|
||||
};
|
||||
use cosmic::cosmic_config::{ConfigSet, CosmicConfigEntry};
|
||||
use cosmic::widget::{settings, text};
|
||||
use cosmic::{Apply, Element, Task};
|
||||
use cosmic_panel_config::{CosmicPanelConfig, CosmicPanelContainerConfig};
|
||||
use cosmic_settings_page::{self as page, Section, section};
|
||||
use slotmap::SlotMap;
|
||||
|
|
|
|||
|
|
@ -10,23 +10,21 @@ use cosmic::iced;
|
|||
use cosmic::iced::core::clipboard::IconSurface;
|
||||
use cosmic::widget::{Column, button, column, container, icon, list_column, row, text, text_input};
|
||||
|
||||
use cosmic::{
|
||||
Apply, Element,
|
||||
cosmic_config::{Config, CosmicConfigEntry},
|
||||
iced::core::{
|
||||
Clipboard, Shell, Widget, layout, renderer,
|
||||
widget::{Operation, Tree, tree},
|
||||
},
|
||||
iced::runtime::{Task, core::id::Id},
|
||||
iced::{
|
||||
Alignment, Border, Color, Length, Point, Rectangle, Size, Vector, core::window, event,
|
||||
mouse, overlay, touch,
|
||||
},
|
||||
theme,
|
||||
use cosmic::cosmic_config::{Config, CosmicConfigEntry};
|
||||
use cosmic::iced::core::widget::{Operation, Tree, tree};
|
||||
use cosmic::iced::core::{Clipboard, Shell, Widget, layout, renderer, window};
|
||||
use cosmic::iced::runtime::Task;
|
||||
use cosmic::iced::runtime::core::id::Id;
|
||||
use cosmic::iced::{
|
||||
Alignment, Border, Color, Length, Point, Rectangle, Size, Vector, event, mouse, overlay, touch,
|
||||
};
|
||||
use cosmic::{Apply, Element, theme};
|
||||
|
||||
use std::borrow::Cow;
|
||||
use std::fmt::Debug;
|
||||
use std::mem;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::{borrow::Cow, fmt::Debug, mem, sync::LazyLock};
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use crate::{app, pages};
|
||||
use cosmic_panel_config::CosmicPanelConfig;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
use cosmic::{
|
||||
Element, Task,
|
||||
cctk::sctk::reexports::client::{Proxy, backend::ObjectId, protocol::wl_output::WlOutput},
|
||||
cosmic_config::{self, CosmicConfigEntry},
|
||||
cosmic_theme::{Density, Roundness},
|
||||
iced::{Alignment, Length},
|
||||
surface,
|
||||
widget::{button, container, dropdown, row, settings, slider, space, text},
|
||||
};
|
||||
use cosmic::cctk::sctk::reexports::client::Proxy;
|
||||
use cosmic::cctk::sctk::reexports::client::backend::ObjectId;
|
||||
use cosmic::cctk::sctk::reexports::client::protocol::wl_output::WlOutput;
|
||||
use cosmic::cosmic_config::{self, CosmicConfigEntry};
|
||||
use cosmic::cosmic_theme::{Density, Roundness};
|
||||
use cosmic::iced::{Alignment, Length};
|
||||
use cosmic::widget::{button, container, dropdown, row, settings, slider, space, text};
|
||||
use cosmic::{Element, Task, surface};
|
||||
|
||||
use cosmic::Apply;
|
||||
use cosmic_config::ConfigSet;
|
||||
|
|
@ -15,7 +14,8 @@ use cosmic_panel_config::{
|
|||
CosmicPanelOuput, PanelAnchor, PanelSize,
|
||||
};
|
||||
use cosmic_settings_page::{self as page, Section};
|
||||
use std::{collections::HashMap, time::Duration};
|
||||
use std::collections::HashMap;
|
||||
use std::time::Duration;
|
||||
|
||||
pub struct PageInner {
|
||||
pub(crate) config_helper: Option<cosmic_config::Config>,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
use std::collections::HashMap;
|
||||
|
||||
use cosmic::{Task, cosmic_config::CosmicConfigEntry};
|
||||
use cosmic::Task;
|
||||
use cosmic::cosmic_config::CosmicConfigEntry;
|
||||
use cosmic_panel_config::{CosmicPanelConfig, CosmicPanelContainerConfig};
|
||||
use cosmic_settings_page::{self as page, Section, section};
|
||||
use slotmap::SlotMap;
|
||||
|
|
|
|||
|
|
@ -7,37 +7,25 @@ pub mod widgets;
|
|||
pub use config::Config;
|
||||
use url::Url;
|
||||
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
path::{Path, PathBuf},
|
||||
sync::Arc,
|
||||
};
|
||||
use std::collections::HashMap;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::Arc;
|
||||
|
||||
use cosmic::app::ContextDrawer;
|
||||
#[cfg(feature = "xdg-portal")]
|
||||
use cosmic::dialog::file_chooser;
|
||||
use cosmic::{
|
||||
Apply, Element, Task,
|
||||
iced::core::text::{Ellipsize, EllipsizeHeightLimit},
|
||||
widget::{ColorPickerModel, color_picker::ColorPickerUpdate, icon},
|
||||
};
|
||||
use cosmic::{app::ContextDrawer, iced::runtime::core::image::Handle as ImageHandle};
|
||||
use cosmic::{
|
||||
iced::Subscription,
|
||||
widget::{
|
||||
button, dropdown, list_column, row,
|
||||
segmented_button::{self, SingleSelectModel},
|
||||
settings,
|
||||
space::horizontal as horizontal_space,
|
||||
tab_bar, text,
|
||||
},
|
||||
};
|
||||
use cosmic::{
|
||||
iced::{Alignment, Color, Length, window},
|
||||
surface,
|
||||
use cosmic::iced::core::text::{Ellipsize, EllipsizeHeightLimit};
|
||||
use cosmic::iced::runtime::core::image::Handle as ImageHandle;
|
||||
use cosmic::iced::{Alignment, Color, Length, Subscription, window};
|
||||
use cosmic::widget::color_picker::ColorPickerUpdate;
|
||||
use cosmic::widget::segmented_button::{self, SingleSelectModel};
|
||||
use cosmic::widget::space::horizontal as horizontal_space;
|
||||
use cosmic::widget::{
|
||||
ColorPickerModel, button, dropdown, icon, list_column, row, settings, tab_bar, text,
|
||||
};
|
||||
use cosmic::{Apply, Element, Task, surface};
|
||||
use cosmic_bg_config::Source;
|
||||
use cosmic_settings_page::Section;
|
||||
use cosmic_settings_page::{self as page, section};
|
||||
use cosmic_settings_page::{self as page, Section, section};
|
||||
use cosmic_settings_wallpaper::{self as wallpaper, Entry, ScalingMode};
|
||||
use image::imageops::FilterType::Lanczos3;
|
||||
use image::{ImageBuffer, Rgba};
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
use super::Message;
|
||||
use cosmic::iced::Radius;
|
||||
use cosmic::iced::core::Border;
|
||||
use cosmic::iced::core::{Background, Color, Degrees, Length, gradient::Linear};
|
||||
use cosmic::iced::core::gradient::Linear;
|
||||
use cosmic::iced::core::{Background, Border, Color, Degrees, Length};
|
||||
use cosmic::iced::runtime::core::image::Handle as ImageHandle;
|
||||
use cosmic::prelude::*;
|
||||
use cosmic::widget::{Space, button, container};
|
||||
|
|
|
|||
|
|
@ -1,18 +1,14 @@
|
|||
// Copyright 2023 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use cosmic::{
|
||||
Apply, Element,
|
||||
iced::Length,
|
||||
surface,
|
||||
widget::{self, settings},
|
||||
};
|
||||
use cosmic::iced::Length;
|
||||
use cosmic::widget::{self, settings};
|
||||
use cosmic::{Apply, Element, surface};
|
||||
|
||||
use cosmic_comp_config::CosmicCompConfig;
|
||||
use cosmic_config::{ConfigGet, ConfigSet};
|
||||
use cosmic_settings_config::{Action, Binding, Shortcuts, shortcuts};
|
||||
use cosmic_settings_page::Section;
|
||||
use cosmic_settings_page::{self as page, section};
|
||||
use cosmic_settings_page::{self as page, Section, section};
|
||||
use slotmap::SlotMap;
|
||||
use tracing::error;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,15 +3,11 @@
|
|||
|
||||
// TODO make settings work
|
||||
|
||||
use cosmic::{
|
||||
Apply, Element,
|
||||
cosmic_config::{self, ConfigGet, ConfigSet},
|
||||
surface,
|
||||
widget::{self, settings},
|
||||
};
|
||||
use cosmic::cosmic_config::{self, ConfigGet, ConfigSet};
|
||||
use cosmic::widget::{self, settings};
|
||||
use cosmic::{Apply, Element, surface};
|
||||
use cosmic_comp_config::workspace::{Action, WorkspaceConfig, WorkspaceLayout, WorkspaceMode};
|
||||
use cosmic_settings_page::Section;
|
||||
use cosmic_settings_page::{self as page, section};
|
||||
use cosmic_settings_page::{self as page, Section, section};
|
||||
use slotmap::SlotMap;
|
||||
use tracing::error;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,11 +5,9 @@ use cosmic::Renderer;
|
|||
use cosmic::iced::core::renderer::Quad;
|
||||
use cosmic::iced::core::widget::{Tree, tree};
|
||||
use cosmic::iced::core::{
|
||||
self as core, Border, Clipboard, Element, Layout, Length, Rectangle, Renderer as IcedRenderer,
|
||||
Shell, Size, Widget,
|
||||
self as core, Border, Clipboard, Element, Layout, Length, Point, Rectangle,
|
||||
Renderer as IcedRenderer, Shell, Size, Widget, alignment, layout, mouse, renderer, text, touch,
|
||||
};
|
||||
use cosmic::iced::core::{Point, layout, mouse, renderer, touch};
|
||||
use cosmic::iced::core::{alignment, text};
|
||||
use cosmic::widget::segmented_button::{self, SingleSelectModel};
|
||||
use cosmic_randr_shell::{self as randr, OutputKey};
|
||||
use randr::Transform;
|
||||
|
|
|
|||
|
|
@ -20,9 +20,10 @@ use cosmic_settings_page::{self as page, Section, section};
|
|||
use futures::SinkExt;
|
||||
use indexmap::Equivalent;
|
||||
use slotmap::{Key, SecondaryMap, SlotMap};
|
||||
use std::collections::BTreeMap;
|
||||
use std::process::ExitStatus;
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::sync::{Arc, LazyLock};
|
||||
use std::{collections::BTreeMap, process::ExitStatus};
|
||||
use tokio::sync::oneshot;
|
||||
|
||||
static DPI_SCALES: &[u32] = &[50, 75, 100, 125, 150, 175, 200, 225, 250, 275, 300];
|
||||
|
|
|
|||
|
|
@ -5,14 +5,11 @@ pub mod shortcuts;
|
|||
|
||||
use std::cmp;
|
||||
|
||||
use cosmic::{
|
||||
Apply, Element, Task,
|
||||
app::{ContextDrawer, context_drawer},
|
||||
cosmic_config::{self, ConfigSet},
|
||||
iced::{Alignment, Length},
|
||||
theme,
|
||||
widget::{self, ListColumn, button, container, icon, list, row, settings},
|
||||
};
|
||||
use cosmic::app::{ContextDrawer, context_drawer};
|
||||
use cosmic::cosmic_config::{self, ConfigSet};
|
||||
use cosmic::iced::{Alignment, Length};
|
||||
use cosmic::widget::{self, ListColumn, button, container, icon, list, row, settings};
|
||||
use cosmic::{Apply, Element, Task, theme};
|
||||
use cosmic_comp_config::{KeyboardConfig, NumlockState, XkbConfig};
|
||||
use cosmic_settings_page::{self as page, Section, section};
|
||||
use itertools::Itertools;
|
||||
|
|
|
|||
|
|
@ -652,7 +652,8 @@ impl Model {
|
|||
modifiers,
|
||||
..
|
||||
}) => {
|
||||
use cosmic::iced::keyboard::{Key, key::Named};
|
||||
use cosmic::iced::keyboard::Key;
|
||||
use cosmic::iced::keyboard::key::Named;
|
||||
|
||||
if matches!(
|
||||
key,
|
||||
|
|
@ -669,7 +670,8 @@ impl Model {
|
|||
location,
|
||||
..
|
||||
}) => {
|
||||
use cosmic::iced::keyboard::{Key, key::Named};
|
||||
use cosmic::iced::keyboard::Key;
|
||||
use cosmic::iced::keyboard::key::Named;
|
||||
|
||||
if matches!(
|
||||
key,
|
||||
|
|
|
|||
|
|
@ -590,7 +590,8 @@ impl page::Page<crate::pages::Message> for Page {
|
|||
&self,
|
||||
core: &cosmic::Core,
|
||||
) -> cosmic::iced::Subscription<crate::pages::Message> {
|
||||
use cosmic::iced::{self, event::listen_with};
|
||||
use cosmic::iced::event::listen_with;
|
||||
use cosmic::iced::{self};
|
||||
|
||||
cosmic::iced::Subscription::batch(vec![
|
||||
if self.add_shortcut.active
|
||||
|
|
@ -605,7 +606,8 @@ impl page::Page<crate::pages::Message> for Page {
|
|||
modifiers,
|
||||
..
|
||||
}) => {
|
||||
use cosmic::iced::keyboard::{Key, key::Named};
|
||||
use cosmic::iced::keyboard::Key;
|
||||
use cosmic::iced::keyboard::key::Named;
|
||||
if matches!(
|
||||
key,
|
||||
Key::Named(Named::Super | Named::Alt | Named::Control | Named::Shift)
|
||||
|
|
@ -624,7 +626,8 @@ impl page::Page<crate::pages::Message> for Page {
|
|||
location,
|
||||
..
|
||||
}) => {
|
||||
use cosmic::iced::keyboard::{Key, key::Named};
|
||||
use cosmic::iced::keyboard::Key;
|
||||
use cosmic::iced::keyboard::key::Named;
|
||||
if matches!(
|
||||
key,
|
||||
Key::Named(Named::Super | Named::Alt | Named::Control | Named::Shift)
|
||||
|
|
|
|||
|
|
@ -2,8 +2,9 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use super::{ShortcutMessage, ShortcutModel};
|
||||
use cosmic::app::ContextDrawer;
|
||||
use cosmic::iced::platform_specific::shell::wayland::commands::keyboard_shortcuts_inhibit;
|
||||
use cosmic::{Element, Task, app::ContextDrawer};
|
||||
use cosmic::{Element, Task};
|
||||
use cosmic_settings_config::shortcuts::Action;
|
||||
use cosmic_settings_config::shortcuts::action::ResizeDirection;
|
||||
use cosmic_settings_page::{self as page, Section, section};
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@ pub mod tiling;
|
|||
|
||||
use cosmic::app::ContextDrawer;
|
||||
use cosmic::iced::Length;
|
||||
use cosmic::widget::{self, list::ListButton, settings, text};
|
||||
use cosmic::widget::list::ListButton;
|
||||
use cosmic::widget::{self, settings, text};
|
||||
use cosmic::{Apply, Element, Task};
|
||||
use cosmic_config::ConfigGet;
|
||||
use cosmic_settings_config::Binding;
|
||||
|
|
@ -23,8 +24,7 @@ use cosmic_settings_config::shortcuts::action::{
|
|||
Direction, FocusDirection, Orientation, ResizeDirection,
|
||||
};
|
||||
use cosmic_settings_config::shortcuts::{self, Action, Shortcuts};
|
||||
use cosmic_settings_page::Section;
|
||||
use cosmic_settings_page::{self as page, section};
|
||||
use cosmic_settings_page::{self as page, Section, section};
|
||||
use itertools::Itertools;
|
||||
use shortcuts::action::System as SystemAction;
|
||||
use slab::Slab;
|
||||
|
|
|
|||
|
|
@ -2,8 +2,9 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
//
|
||||
use super::{ShortcutMessage, ShortcutModel};
|
||||
use cosmic::app::ContextDrawer;
|
||||
use cosmic::iced::platform_specific::shell::wayland::commands::keyboard_shortcuts_inhibit;
|
||||
use cosmic::{Element, Task, app::ContextDrawer};
|
||||
use cosmic::{Element, Task};
|
||||
use cosmic_settings_config::shortcuts::Action;
|
||||
use cosmic_settings_config::shortcuts::action::Direction;
|
||||
use cosmic_settings_page::{self as page, Section, section};
|
||||
|
|
|
|||
|
|
@ -2,8 +2,9 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use super::{ShortcutMessage, ShortcutModel};
|
||||
use cosmic::app::ContextDrawer;
|
||||
use cosmic::iced::platform_specific::shell::wayland::commands::keyboard_shortcuts_inhibit;
|
||||
use cosmic::{Element, Task, app::ContextDrawer};
|
||||
use cosmic::{Element, Task};
|
||||
use cosmic_settings_config::shortcuts::Action;
|
||||
use cosmic_settings_config::shortcuts::action::System as SystemAction;
|
||||
use cosmic_settings_page::{self as page, Section, section};
|
||||
|
|
|
|||
|
|
@ -2,8 +2,9 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use super::{ShortcutMessage, ShortcutModel};
|
||||
use cosmic::app::ContextDrawer;
|
||||
use cosmic::iced::platform_specific::shell::wayland::commands::keyboard_shortcuts_inhibit;
|
||||
use cosmic::{Element, Task, app::ContextDrawer};
|
||||
use cosmic::{Element, Task};
|
||||
use cosmic_settings_config::shortcuts::Action;
|
||||
use cosmic_settings_config::shortcuts::action::Orientation;
|
||||
use cosmic_settings_page::{self as page, Section, section};
|
||||
|
|
|
|||
|
|
@ -2,10 +2,8 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use crate::app;
|
||||
use cosmic::{
|
||||
Task,
|
||||
cosmic_config::{self, ConfigGet, ConfigSet},
|
||||
};
|
||||
use cosmic::Task;
|
||||
use cosmic::cosmic_config::{self, ConfigGet, ConfigSet};
|
||||
use cosmic_comp_config::input::{
|
||||
AccelConfig, AccelProfile, ClickMethod, InputConfig, ScrollConfig, ScrollMethod, TapButtonMap,
|
||||
TapConfig,
|
||||
|
|
|
|||
|
|
@ -5,8 +5,7 @@ use cosmic::iced::{Alignment, Length};
|
|||
use cosmic::widget::{self, row, settings, text};
|
||||
use cosmic::{Apply, Element};
|
||||
use cosmic_comp_config::input::AccelProfile;
|
||||
use cosmic_settings_page::Section;
|
||||
use cosmic_settings_page::{self as page, section};
|
||||
use cosmic_settings_page::{self as page, Section, section};
|
||||
use slotmap::SlotMap;
|
||||
|
||||
use super::Message;
|
||||
|
|
|
|||
|
|
@ -8,8 +8,7 @@ use cosmic::{Apply, Element};
|
|||
use cosmic_comp_config::CosmicCompConfig;
|
||||
use cosmic_comp_config::input::{AccelProfile, ClickMethod, ScrollMethod};
|
||||
use cosmic_comp_config::workspace::{WorkspaceConfig, WorkspaceLayout};
|
||||
use cosmic_settings_page::Section;
|
||||
use cosmic_settings_page::{self as page, section};
|
||||
use cosmic_settings_page::{self as page, Section, section};
|
||||
use slotmap::SlotMap;
|
||||
use tracing::error;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@ pub mod vpn;
|
|||
pub mod wifi;
|
||||
pub mod wired;
|
||||
|
||||
use std::{ffi::OsStr, process::Stdio, sync::Arc};
|
||||
use std::ffi::OsStr;
|
||||
use std::process::Stdio;
|
||||
use std::sync::Arc;
|
||||
|
||||
use anyhow::Context;
|
||||
use cosmic::{Apply, Element, Task, widget};
|
||||
use cosmic_dbus_networkmanager::{
|
||||
interface::enums::{DeviceState, DeviceType},
|
||||
nm::NetworkManager,
|
||||
};
|
||||
use cosmic_dbus_networkmanager::interface::enums::{DeviceState, DeviceType};
|
||||
use cosmic_dbus_networkmanager::nm::NetworkManager;
|
||||
use cosmic_settings_network_manager_subscription as network_manager;
|
||||
use cosmic_settings_page::{self as page, Section, section};
|
||||
use futures::{SinkExt, StreamExt};
|
||||
|
|
|
|||
|
|
@ -8,16 +8,16 @@ use std::sync::{Arc, LazyLock};
|
|||
|
||||
use anyhow::Context;
|
||||
use cosmic::dialog::file_chooser::FileFilter;
|
||||
use cosmic::task;
|
||||
use cosmic::{
|
||||
Apply, Element, Task,
|
||||
iced::core::text::Wrapping,
|
||||
iced::{Alignment, Length},
|
||||
widget::{self, icon, space::horizontal as horizontal_space, text_input::focus},
|
||||
};
|
||||
use cosmic::iced::core::text::Wrapping;
|
||||
use cosmic::iced::{Alignment, Length};
|
||||
use cosmic::widget::space::horizontal as horizontal_space;
|
||||
use cosmic::widget::text_input::focus;
|
||||
use cosmic::widget::{self, icon};
|
||||
use cosmic::{Apply, Element, Task, task};
|
||||
use cosmic_settings_network_manager_subscription::current_networks::ActiveConnectionInfo;
|
||||
use cosmic_settings_network_manager_subscription::nm_secret_agent::{self, PasswordFlag};
|
||||
use cosmic_settings_network_manager_subscription::{
|
||||
self as network_manager, NetworkManagerState, UUID, current_networks::ActiveConnectionInfo,
|
||||
self as network_manager, NetworkManagerState, UUID,
|
||||
};
|
||||
use cosmic_settings_page::{self as page, Section, section};
|
||||
use futures::{FutureExt, SinkExt, StreamExt};
|
||||
|
|
|
|||
|
|
@ -1,25 +1,22 @@
|
|||
// Copyright 2024 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use std::{
|
||||
collections::{BTreeMap, BTreeSet},
|
||||
sync::{Arc, LazyLock},
|
||||
};
|
||||
use std::collections::{BTreeMap, BTreeSet};
|
||||
use std::sync::{Arc, LazyLock};
|
||||
|
||||
use anyhow::Context;
|
||||
use cosmic::{
|
||||
Apply, Element, Task,
|
||||
app::ContextDrawer,
|
||||
iced::core::text::Wrapping,
|
||||
iced::{Alignment, Length, widget::operation::focus_next},
|
||||
task,
|
||||
widget::{self, column, icon, space::horizontal, text_input::focus},
|
||||
};
|
||||
use cosmic::app::ContextDrawer;
|
||||
use cosmic::iced::core::text::Wrapping;
|
||||
use cosmic::iced::widget::operation::focus_next;
|
||||
use cosmic::iced::{Alignment, Length};
|
||||
use cosmic::widget::space::horizontal;
|
||||
use cosmic::widget::text_input::focus;
|
||||
use cosmic::widget::{self, column, icon};
|
||||
use cosmic::{Apply, Element, Task, task};
|
||||
use cosmic_settings_network_manager_subscription::available_wifi::{AccessPoint, NetworkType};
|
||||
use cosmic_settings_network_manager_subscription::current_networks::ActiveConnectionInfo;
|
||||
use cosmic_settings_network_manager_subscription::{
|
||||
self as network_manager, NetworkManagerState,
|
||||
available_wifi::{AccessPoint, NetworkType},
|
||||
current_networks::ActiveConnectionInfo,
|
||||
nm_secret_agent,
|
||||
self as network_manager, NetworkManagerState, nm_secret_agent,
|
||||
};
|
||||
use cosmic_settings_page::{self as page, Section, section};
|
||||
use futures::{SinkExt, StreamExt};
|
||||
|
|
|
|||
|
|
@ -1,19 +1,18 @@
|
|||
// Copyright 2024 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use std::{collections::BTreeSet, sync::Arc};
|
||||
use std::collections::BTreeSet;
|
||||
use std::sync::Arc;
|
||||
|
||||
use anyhow::Context;
|
||||
use cosmic::{
|
||||
Apply, Element, Task,
|
||||
iced::core::text::Wrapping,
|
||||
iced::{Alignment, Length},
|
||||
widget::{self, icon, space::horizontal as horizontal_space},
|
||||
};
|
||||
use cosmic::iced::core::text::Wrapping;
|
||||
use cosmic::iced::{Alignment, Length};
|
||||
use cosmic::widget::space::horizontal as horizontal_space;
|
||||
use cosmic::widget::{self, icon};
|
||||
use cosmic::{Apply, Element, Task};
|
||||
use cosmic_dbus_networkmanager::interface::enums::DeviceState;
|
||||
use cosmic_settings_network_manager_subscription::{
|
||||
self as network_manager, NetworkManagerState, current_networks::ActiveConnectionInfo,
|
||||
};
|
||||
use cosmic_settings_network_manager_subscription::current_networks::ActiveConnectionInfo;
|
||||
use cosmic_settings_network_manager_subscription::{self as network_manager, NetworkManagerState};
|
||||
use cosmic_settings_page::{self as page, Section, section};
|
||||
use futures::{SinkExt, StreamExt};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
use futures::{FutureExt, Stream, StreamExt, future::join_all};
|
||||
use futures::future::join_all;
|
||||
use futures::{FutureExt, Stream, StreamExt};
|
||||
use jiff::{Span, SpanRelativeTo, SpanRound, ToSpan, Unit};
|
||||
use upower_dbus::{BatteryState, BatteryType, DeviceProxy};
|
||||
use zbus::{Connection, zvariant::ObjectPath};
|
||||
use zbus::Connection;
|
||||
use zbus::zvariant::ObjectPath;
|
||||
|
||||
mod ppdaemon;
|
||||
mod s76powerdaemon;
|
||||
|
|
|
|||
|
|
@ -3,12 +3,11 @@ mod backend;
|
|||
use self::backend::{GetCurrentPowerProfile, SetPowerProfile};
|
||||
use backend::{Battery, ConnectedDevice, PowerProfile};
|
||||
|
||||
use cosmic::Task;
|
||||
use cosmic::iced::core::text::{Ellipsize, EllipsizeHeightLimit};
|
||||
use cosmic::iced::widget::{column, row};
|
||||
use cosmic::iced::{self, Alignment, Length, stream};
|
||||
use cosmic::widget::{self, settings, space, text};
|
||||
use cosmic::{Apply, surface};
|
||||
use cosmic::{Apply, Task, surface};
|
||||
use cosmic_config::{Config, CosmicConfigEntry};
|
||||
use cosmic_idle_config::CosmicIdleConfig;
|
||||
use cosmic_settings_page::{self as page, Section, section};
|
||||
|
|
|
|||
|
|
@ -3,12 +3,10 @@
|
|||
|
||||
pub mod device_profiles;
|
||||
|
||||
use cosmic::{
|
||||
Apply, Element, Task,
|
||||
iced::{Alignment, Length, window},
|
||||
surface,
|
||||
widget::{self, settings, space::horizontal as horizontal_space},
|
||||
};
|
||||
use cosmic::iced::{Alignment, Length, window};
|
||||
use cosmic::widget::space::horizontal as horizontal_space;
|
||||
use cosmic::widget::{self, settings};
|
||||
use cosmic::{Apply, Element, Task, surface};
|
||||
use cosmic_config::{Config, ConfigGet, ConfigSet};
|
||||
use cosmic_settings_page::{self as page, Section, section};
|
||||
use cosmic_settings_sound_subscription as subscription;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,9 @@
|
|||
|
||||
#[cfg(feature = "wgpu")]
|
||||
use cosmic::iced::wgpu;
|
||||
use std::{collections::HashMap, collections::HashSet, ffi::OsStr, process::Command};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::ffi::OsStr;
|
||||
use std::process::Command;
|
||||
|
||||
#[must_use]
|
||||
#[derive(Clone, Debug, Default)]
|
||||
|
|
|
|||
|
|
@ -4,25 +4,22 @@
|
|||
mod getent;
|
||||
|
||||
use crate::pages;
|
||||
use cosmic::{
|
||||
Apply, Element,
|
||||
dialog::file_chooser,
|
||||
iced::{Alignment, Length},
|
||||
widget::{self, column, icon, list, row, settings, space::horizontal, text},
|
||||
};
|
||||
use cosmic::dialog::file_chooser;
|
||||
use cosmic::iced::{Alignment, Length};
|
||||
use cosmic::widget::space::horizontal;
|
||||
use cosmic::widget::{self, column, icon, list, row, settings, text};
|
||||
use cosmic::{Apply, Element};
|
||||
use cosmic_settings_page::{self as page, Section, section};
|
||||
use image::GenericImageView;
|
||||
use pwhash::{bcrypt, md5_crypt, sha256_crypt, sha512_crypt};
|
||||
use regex::Regex;
|
||||
use slotmap::SlotMap;
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
fs::File,
|
||||
future::Future,
|
||||
io::{BufRead, BufReader},
|
||||
path::{Path, PathBuf},
|
||||
sync::Arc,
|
||||
};
|
||||
use std::collections::HashMap;
|
||||
use std::fs::File;
|
||||
use std::future::Future;
|
||||
use std::io::{BufRead, BufReader};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::Arc;
|
||||
use url::Url;
|
||||
use zbus_polkit::policykit1::CheckAuthorizationFlags;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,24 +2,19 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use crate::widget::selection_context_item;
|
||||
use cosmic::{
|
||||
Apply, Element, Task,
|
||||
app::ContextDrawer,
|
||||
cosmic_config::{self, ConfigGet, ConfigSet},
|
||||
iced::core::text::Wrapping,
|
||||
surface,
|
||||
widget::{self, dropdown, settings},
|
||||
};
|
||||
use cosmic::app::ContextDrawer;
|
||||
use cosmic::cosmic_config::{self, ConfigGet, ConfigSet};
|
||||
use cosmic::iced::core::text::Wrapping;
|
||||
use cosmic::widget::{self, dropdown, settings};
|
||||
use cosmic::{Apply, Element, Task, surface};
|
||||
use cosmic_settings_page::{self as page, Section, section};
|
||||
use icu::{
|
||||
calendar::{Gregorian, types::Weekday, week},
|
||||
datetime::{
|
||||
DateTimeFormatter, DateTimeFormatterPreferences, fieldsets,
|
||||
input::{Date, DateTime, Time},
|
||||
options::TimePrecision,
|
||||
},
|
||||
locale::{Locale, preferences::extensions::unicode::keywords::HourCycle},
|
||||
};
|
||||
use icu::calendar::types::Weekday;
|
||||
use icu::calendar::{Gregorian, week};
|
||||
use icu::datetime::input::{Date, DateTime, Time};
|
||||
use icu::datetime::options::TimePrecision;
|
||||
use icu::datetime::{DateTimeFormatter, DateTimeFormatterPreferences, fieldsets};
|
||||
use icu::locale::Locale;
|
||||
use icu::locale::preferences::extensions::unicode::keywords::HourCycle;
|
||||
use slotmap::{Key, SlotMap};
|
||||
pub use timedate_zbus::TimeDateProxy;
|
||||
use tracing::error;
|
||||
|
|
|
|||
|
|
@ -10,18 +10,15 @@ use cosmic::iced::{Alignment, Length};
|
|||
use cosmic::widget::{self, button};
|
||||
use cosmic::{Apply, Element};
|
||||
use cosmic_config::{ConfigGet, ConfigSet};
|
||||
use cosmic_settings_page::Section;
|
||||
use cosmic_settings_page::{self as page, section};
|
||||
use cosmic_settings_page::{self as page, Section, section};
|
||||
use eyre::Context;
|
||||
use icu::{
|
||||
calendar::{types::Weekday, week},
|
||||
datetime::{
|
||||
DateTimeFormatter, DateTimeFormatterPreferences, fieldsets,
|
||||
input::{Date, DateTime, Time},
|
||||
},
|
||||
decimal::{DecimalFormatter, input::Decimal},
|
||||
locale::Locale,
|
||||
};
|
||||
use icu::calendar::types::Weekday;
|
||||
use icu::calendar::week;
|
||||
use icu::datetime::input::{Date, DateTime, Time};
|
||||
use icu::datetime::{DateTimeFormatter, DateTimeFormatterPreferences, fieldsets};
|
||||
use icu::decimal::DecimalFormatter;
|
||||
use icu::decimal::input::Decimal;
|
||||
use icu::locale::Locale;
|
||||
use locales_rs as locale;
|
||||
use regex::Regex;
|
||||
use slotmap::{DefaultKey, SlotMap};
|
||||
|
|
@ -497,11 +494,8 @@ mod preferred_languages {
|
|||
use crate::pages::time::region::localized_iso_codes;
|
||||
|
||||
use super::Message;
|
||||
use cosmic::{
|
||||
Apply,
|
||||
iced::{Alignment, Length},
|
||||
widget,
|
||||
};
|
||||
use cosmic::iced::{Alignment, Length};
|
||||
use cosmic::{Apply, widget};
|
||||
use cosmic_settings_page::Section;
|
||||
|
||||
pub fn section() -> Section<crate::pages::Message> {
|
||||
|
|
|
|||
|
|
@ -2,11 +2,9 @@ use std::any::TypeId;
|
|||
|
||||
use ashpd::desktop::location::{Location, LocationProxy};
|
||||
use chrono::NaiveDate;
|
||||
use cosmic::iced::{
|
||||
Subscription,
|
||||
futures::{SinkExt, StreamExt, channel::mpsc::Sender, future},
|
||||
stream,
|
||||
};
|
||||
use cosmic::iced::futures::channel::mpsc::Sender;
|
||||
use cosmic::iced::futures::{SinkExt, StreamExt, future};
|
||||
use cosmic::iced::{Subscription, stream};
|
||||
use sunrise::{Coordinates, SolarDay, SolarEvent};
|
||||
use tokio::select;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
use cosmic::iced::{
|
||||
Subscription,
|
||||
futures::{self, SinkExt},
|
||||
stream,
|
||||
};
|
||||
use cosmic::iced::futures::{self, SinkExt};
|
||||
use cosmic::iced::{Subscription, stream};
|
||||
use notify::{Config, EventKind, RecommendedWatcher, RecursiveMode, Watcher};
|
||||
use std::fmt::Debug;
|
||||
use std::hash::Hash;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
use std::path::PathBuf;
|
||||
|
||||
use cosmic::iced::{
|
||||
Subscription,
|
||||
futures::{SinkExt, StreamExt, channel::mpsc::Sender, future},
|
||||
stream,
|
||||
};
|
||||
use cosmic::iced::futures::channel::mpsc::Sender;
|
||||
use cosmic::iced::futures::{SinkExt, StreamExt, future};
|
||||
use cosmic::iced::{Subscription, stream};
|
||||
use image::{ImageBuffer, Rgba};
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
// Copyright 2023 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use cosmic::{iced::Border, theme};
|
||||
use cosmic::iced::Border;
|
||||
use cosmic::theme;
|
||||
|
||||
#[must_use]
|
||||
pub fn display_container_frame() -> cosmic::theme::Container<'static> {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
use std::{future::Future, io, process};
|
||||
use std::future::Future;
|
||||
use std::{io, process};
|
||||
|
||||
use futures::future::select;
|
||||
|
||||
|
|
|
|||
|
|
@ -8,10 +8,9 @@ use cosmic::cosmic_theme::Spacing;
|
|||
use cosmic::iced::core::text::Wrapping;
|
||||
use cosmic::iced::{Alignment, Length};
|
||||
use cosmic::widget::color_picker::ColorPickerUpdate;
|
||||
use cosmic::widget::space::{horizontal, vertical};
|
||||
use cosmic::widget::{
|
||||
self, ColorPickerModel, button, column, container, divider, icon, list, row, settings,
|
||||
space::{horizontal, vertical},
|
||||
text,
|
||||
self, ColorPickerModel, button, column, container, divider, icon, list, row, settings, text,
|
||||
};
|
||||
use cosmic::{Apply, Element, theme};
|
||||
use cosmic_settings_page as page;
|
||||
|
|
|
|||
|
|
@ -21,20 +21,19 @@ pub use route::{Route, RouteProps};
|
|||
mod spa_utils;
|
||||
pub use spa_utils::Channel;
|
||||
|
||||
use libspa::{
|
||||
param::{ParamType, format::FormatProperties},
|
||||
pod::{self, Pod, serialize::PodSerializer},
|
||||
utils::SpaTypes,
|
||||
};
|
||||
use pipewire::{
|
||||
device::{DeviceChangeMask, DeviceListener},
|
||||
main_loop::MainLoopWeak,
|
||||
metadata::MetadataListener,
|
||||
node::NodeListener,
|
||||
proxy::{ProxyListener, ProxyT},
|
||||
types::ObjectType,
|
||||
};
|
||||
use std::{cell::RefCell, rc::Rc};
|
||||
use libspa::param::ParamType;
|
||||
use libspa::param::format::FormatProperties;
|
||||
use libspa::pod::serialize::PodSerializer;
|
||||
use libspa::pod::{self, Pod};
|
||||
use libspa::utils::SpaTypes;
|
||||
use pipewire::device::{DeviceChangeMask, DeviceListener};
|
||||
use pipewire::main_loop::MainLoopWeak;
|
||||
use pipewire::metadata::MetadataListener;
|
||||
use pipewire::node::NodeListener;
|
||||
use pipewire::proxy::{ProxyListener, ProxyT};
|
||||
use pipewire::types::ObjectType;
|
||||
use std::cell::RefCell;
|
||||
use std::rc::Rc;
|
||||
|
||||
pub type NodeId = u32;
|
||||
pub type RouteId = u32;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
// Copyright 2025 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use crate::{Channel, spa_utils::array_from_pod};
|
||||
use libspa::{pod::Pod, utils::Id};
|
||||
use crate::Channel;
|
||||
use crate::spa_utils::array_from_pod;
|
||||
use libspa::pod::Pod;
|
||||
use libspa::utils::Id;
|
||||
use pipewire::node::{NodeInfoRef, NodeState};
|
||||
use std::ffi::c_float;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
// Copyright 2025 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use crate::{Availability, spa_utils::string_from_pod};
|
||||
use crate::Availability;
|
||||
use crate::spa_utils::string_from_pod;
|
||||
use libspa::pod::Pod;
|
||||
|
||||
#[derive(Clone, Debug, Default)]
|
||||
|
|
|
|||
|
|
@ -3,11 +3,10 @@
|
|||
|
||||
use std::ffi::{c_float, c_int};
|
||||
|
||||
use crate::{
|
||||
Availability, Channel, Direction,
|
||||
spa_utils::{array_from_pod, string_from_pod},
|
||||
};
|
||||
use libspa::{pod::Pod, utils::Id};
|
||||
use crate::spa_utils::{array_from_pod, string_from_pod};
|
||||
use crate::{Availability, Channel, Direction};
|
||||
use libspa::pod::Pod;
|
||||
use libspa::utils::Id;
|
||||
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct Route {
|
||||
|
|
|
|||
|
|
@ -3,15 +3,12 @@
|
|||
|
||||
use crate::section::{self, Section};
|
||||
use crate::{Content, Info, Page};
|
||||
use cosmic::Element;
|
||||
use cosmic::Task;
|
||||
use cosmic::app::ContextDrawer;
|
||||
use cosmic::{Element, Task};
|
||||
use regex::Regex;
|
||||
use slotmap::{SecondaryMap, SlotMap, SparseSecondaryMap};
|
||||
use std::{
|
||||
any::{Any, TypeId},
|
||||
collections::HashMap,
|
||||
};
|
||||
use std::any::{Any, TypeId};
|
||||
use std::collections::HashMap;
|
||||
|
||||
/// All settings pages are registered and managed by the [`Binder`].
|
||||
pub struct Binder<Message> {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,9 @@ mod binder;
|
|||
pub use binder::{AutoBind, Binder};
|
||||
|
||||
mod insert;
|
||||
use cosmic::{Element, Task, app::ContextDrawer, iced::Subscription};
|
||||
use cosmic::app::ContextDrawer;
|
||||
use cosmic::iced::Subscription;
|
||||
use cosmic::{Element, Task};
|
||||
use downcast_rs::{Downcast, impl_downcast};
|
||||
pub use insert::Insert;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,16 +6,15 @@ use futures_util::StreamExt;
|
|||
use image::imageops::FilterType;
|
||||
use image::{DynamicImage, ImageBuffer, Rgba, RgbaImage};
|
||||
use jxl_oxide::integration::JxlDecoder;
|
||||
use std::borrow::Cow;
|
||||
use std::collections::HashMap;
|
||||
use std::collections::hash_map::DefaultHasher;
|
||||
use std::fs::File;
|
||||
use std::hash::{Hash, Hasher};
|
||||
use std::io::Read;
|
||||
use std::os::unix::ffi::OsStrExt;
|
||||
use std::{
|
||||
borrow::Cow,
|
||||
collections::{HashMap, hash_map::DefaultHasher},
|
||||
hash::{Hash, Hasher},
|
||||
io::Read,
|
||||
path::{Path, PathBuf},
|
||||
pin::Pin,
|
||||
};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::pin::Pin;
|
||||
use walkdir::WalkDir;
|
||||
|
||||
pub const DEFAULT_COLORS: &[Color] = &[
|
||||
|
|
|
|||
1
rustfmt.toml
Normal file
1
rustfmt.toml
Normal file
|
|
@ -0,0 +1 @@
|
|||
imports_granularity = "Module"
|
||||
|
|
@ -1,17 +1,11 @@
|
|||
use cosmic_protocols::a11y::v1::client::cosmic_a11y_manager_v1::{self, ActiveState};
|
||||
use num_derive::{FromPrimitive, ToPrimitive};
|
||||
use sctk::{
|
||||
reexports::{
|
||||
calloop::{self, LoopSignal, channel},
|
||||
calloop_wayland_source::WaylandSource,
|
||||
client::{
|
||||
ConnectError, Connection, Dispatch, Proxy, WEnum,
|
||||
globals::{GlobalListContents, registry_queue_init},
|
||||
protocol::wl_registry,
|
||||
},
|
||||
},
|
||||
registry::RegistryState,
|
||||
};
|
||||
use sctk::reexports::calloop::{self, LoopSignal, channel};
|
||||
use sctk::reexports::calloop_wayland_source::WaylandSource;
|
||||
use sctk::reexports::client::globals::{GlobalListContents, registry_queue_init};
|
||||
use sctk::reexports::client::protocol::wl_registry;
|
||||
use sctk::reexports::client::{ConnectError, Connection, Dispatch, Proxy, WEnum};
|
||||
use sctk::registry::RegistryState;
|
||||
use tokio::sync::mpsc;
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
|
|
|
|||
|
|
@ -42,8 +42,9 @@ fn is_airplane_mode(rfkill_state: &HashMap<u32, rfkill::DeviceState>) -> bool {
|
|||
|
||||
mod rfkill {
|
||||
use futures::stream::Stream;
|
||||
use std::collections::HashMap;
|
||||
use std::os::unix::fs::OpenOptionsExt;
|
||||
use std::{collections::HashMap, fs, io, mem, slice};
|
||||
use std::{fs, io, mem, slice};
|
||||
use tokio::io::unix::AsyncFd;
|
||||
|
||||
// /usr/include/linux/rfkill.h
|
||||
|
|
|
|||
|
|
@ -2,13 +2,11 @@
|
|||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use crate::{Active, Event};
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
convert::Infallible,
|
||||
hash::{Hash, Hasher},
|
||||
path::PathBuf,
|
||||
time::Duration,
|
||||
};
|
||||
use std::collections::HashMap;
|
||||
use std::convert::Infallible;
|
||||
use std::hash::{Hash, Hasher};
|
||||
use std::path::PathBuf;
|
||||
use std::time::Duration;
|
||||
use zbus::zvariant::OwnedObjectPath;
|
||||
|
||||
#[derive(Default, Debug, Clone)]
|
||||
|
|
|
|||
|
|
@ -3,11 +3,9 @@
|
|||
|
||||
use crate::{Active, Event};
|
||||
use futures::join;
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
hash::{Hash, Hasher},
|
||||
time::Duration,
|
||||
};
|
||||
use std::collections::HashMap;
|
||||
use std::hash::{Hash, Hasher};
|
||||
use std::time::Duration;
|
||||
use zbus::zvariant::OwnedObjectPath;
|
||||
|
||||
const DEFAILT_DEVICE_ICON: &str = "bluetooth-symbolic";
|
||||
|
|
|
|||
|
|
@ -5,9 +5,11 @@ use crate::{AdapterUpdate, Device, DeviceUpdate, Event};
|
|||
use std::pin::Pin;
|
||||
|
||||
use bluez_zbus::BluetoothDevice;
|
||||
use futures::{channel::mpsc, stream::FusedStream};
|
||||
use futures::channel::mpsc;
|
||||
use futures::stream::FusedStream;
|
||||
use iced_futures::futures::{SinkExt, StreamExt};
|
||||
use zbus::{fdo, zvariant::OwnedObjectPath};
|
||||
use zbus::fdo;
|
||||
use zbus::zvariant::OwnedObjectPath;
|
||||
|
||||
enum DevicePropertyWatcherTask {
|
||||
Add(OwnedObjectPath),
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ use super::Event;
|
|||
use cosmic_dbus_networkmanager::nm::NetworkManager;
|
||||
use futures::{SinkExt, StreamExt};
|
||||
use iced_futures::{Subscription, stream};
|
||||
use std::{fmt::Debug, hash::Hash};
|
||||
use std::fmt::Debug;
|
||||
use std::hash::Hash;
|
||||
use zbus::Connection;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
|
|
|||
|
|
@ -1,14 +1,13 @@
|
|||
// Copyright 2024 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use cosmic_dbus_networkmanager::{
|
||||
device::wireless::WirelessDevice,
|
||||
interface::enums::{ApFlags, ApSecurityFlags, DeviceState},
|
||||
};
|
||||
use cosmic_dbus_networkmanager::device::wireless::WirelessDevice;
|
||||
use cosmic_dbus_networkmanager::interface::enums::{ApFlags, ApSecurityFlags, DeviceState};
|
||||
|
||||
use futures::StreamExt;
|
||||
use itertools::Itertools;
|
||||
use std::{collections::HashMap, sync::Arc};
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
use zbus::zvariant::ObjectPath;
|
||||
|
||||
use super::hw_address::HwAddress;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
// Copyright 2024 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use cosmic_dbus_networkmanager::{
|
||||
active_connection::ActiveConnection, device::SpecificDevice,
|
||||
interface::enums::ActiveConnectionState,
|
||||
};
|
||||
use cosmic_dbus_networkmanager::active_connection::ActiveConnection;
|
||||
use cosmic_dbus_networkmanager::device::SpecificDevice;
|
||||
use cosmic_dbus_networkmanager::interface::enums::ActiveConnectionState;
|
||||
use std::net::Ipv4Addr;
|
||||
|
||||
pub async fn active_connections(
|
||||
|
|
|
|||
|
|
@ -10,8 +10,11 @@ use core::hash;
|
|||
use cosmic_dbus_networkmanager::nm::NetworkManager;
|
||||
use futures::{SinkExt, StreamExt};
|
||||
use iced_futures::{self, Subscription, stream};
|
||||
use std::{fmt::Debug, hash::Hash, sync::Arc};
|
||||
use zbus::{Connection, zvariant::ObjectPath};
|
||||
use std::fmt::Debug;
|
||||
use std::hash::Hash;
|
||||
use std::sync::Arc;
|
||||
use zbus::Connection;
|
||||
use zbus::zvariant::ObjectPath;
|
||||
|
||||
#[derive(Debug, Clone, Eq, PartialEq)]
|
||||
pub struct DeviceInfo {
|
||||
|
|
|
|||
|
|
@ -9,34 +9,33 @@ pub mod hw_address;
|
|||
pub mod nm_secret_agent;
|
||||
pub mod wireless_enabled;
|
||||
|
||||
use std::{collections::HashMap, fmt::Debug, hash::Hash, sync::Arc, time::Duration};
|
||||
use std::collections::HashMap;
|
||||
use std::fmt::Debug;
|
||||
use std::hash::Hash;
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
|
||||
use available_wifi::NetworkType;
|
||||
pub use cosmic_dbus_networkmanager as dbus;
|
||||
pub use dbus::settings::connection::Settings;
|
||||
|
||||
use cosmic_dbus_networkmanager::{
|
||||
device::SpecificDevice,
|
||||
interface::{
|
||||
enums::{self, ActiveConnectionState, DeviceType, NmConnectivityState},
|
||||
settings::connection::ConnectionSettingsProxy,
|
||||
},
|
||||
nm::NetworkManager,
|
||||
settings::{NetworkManagerSettings, connection::Connection},
|
||||
};
|
||||
use futures::{
|
||||
FutureExt, SinkExt, StreamExt,
|
||||
channel::mpsc::{UnboundedReceiver, UnboundedSender, unbounded},
|
||||
use cosmic_dbus_networkmanager::device::SpecificDevice;
|
||||
use cosmic_dbus_networkmanager::interface::enums::{
|
||||
self, ActiveConnectionState, DeviceType, NmConnectivityState,
|
||||
};
|
||||
use cosmic_dbus_networkmanager::interface::settings::connection::ConnectionSettingsProxy;
|
||||
use cosmic_dbus_networkmanager::nm::NetworkManager;
|
||||
use cosmic_dbus_networkmanager::settings::NetworkManagerSettings;
|
||||
use cosmic_dbus_networkmanager::settings::connection::Connection;
|
||||
use futures::channel::mpsc::{UnboundedReceiver, UnboundedSender, unbounded};
|
||||
use futures::{FutureExt, SinkExt, StreamExt};
|
||||
use iced_futures::{Subscription, stream};
|
||||
use secure_string::SecureString;
|
||||
use tokio::process::Command;
|
||||
use zbus::zvariant::{self, ObjectPath, Value};
|
||||
|
||||
use self::{
|
||||
available_wifi::{AccessPoint, handle_wireless_device},
|
||||
current_networks::{ActiveConnectionInfo, active_connections},
|
||||
};
|
||||
use self::available_wifi::{AccessPoint, handle_wireless_device};
|
||||
use self::current_networks::{ActiveConnectionInfo, active_connections};
|
||||
|
||||
pub type SSID = Arc<str>;
|
||||
pub type UUID = Arc<str>;
|
||||
|
|
|
|||
|
|
@ -1,18 +1,14 @@
|
|||
use std::{
|
||||
collections::{HashMap, HashSet},
|
||||
fmt::Debug,
|
||||
sync::Arc,
|
||||
};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::fmt::Debug;
|
||||
use std::sync::Arc;
|
||||
|
||||
use bitflags::bitflags;
|
||||
use cosmic_dbus_networkmanager::interface::settings::connection::ConnectionSettingsProxy;
|
||||
use futures::{SinkExt, Stream};
|
||||
use secure_string::SecureString;
|
||||
use tokio::sync::oneshot;
|
||||
use zbus::{
|
||||
ObjectServer, fdo,
|
||||
zvariant::{OwnedValue, Str},
|
||||
};
|
||||
use zbus::zvariant::{OwnedValue, Str};
|
||||
use zbus::{ObjectServer, fdo};
|
||||
|
||||
pub type SecretSender = Arc<tokio::sync::Mutex<Option<tokio::sync::oneshot::Sender<SecureString>>>>;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ use super::Event;
|
|||
use cosmic_dbus_networkmanager::nm::NetworkManager;
|
||||
use futures::{SinkExt, StreamExt};
|
||||
use iced_futures::{Subscription, stream};
|
||||
use std::{fmt::Debug, hash::Hash};
|
||||
use std::fmt::Debug;
|
||||
use std::hash::Hash;
|
||||
use zbus::Connection;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
|
|
|||
|
|
@ -4,37 +4,30 @@
|
|||
// Make sure not to fail if pulse not found, and reconnect?
|
||||
// change to device shouldn't send osd?
|
||||
|
||||
use futures::{SinkExt, executor::block_on};
|
||||
use futures::SinkExt;
|
||||
use futures::executor::block_on;
|
||||
use iced_futures::{Subscription, stream};
|
||||
use libpulse_binding::{
|
||||
callbacks::ListResult,
|
||||
channelmap::Map,
|
||||
context::{
|
||||
Context, FlagSet, State,
|
||||
introspect::{CardInfo, CardProfileInfo, Introspector, ServerInfo, SinkInfo, SourceInfo},
|
||||
subscribe::{Facility, InterestMaskSet, Operation},
|
||||
},
|
||||
def::{PortAvailable, Retval},
|
||||
mainloop::{
|
||||
api::MainloopApi,
|
||||
events::io::IoEventInternal,
|
||||
standard::{IterateResult, Mainloop},
|
||||
},
|
||||
volume::{ChannelVolumes, Volume},
|
||||
};
|
||||
use std::{
|
||||
borrow::Cow,
|
||||
cell::{Cell, RefCell},
|
||||
convert::Infallible,
|
||||
io::{Read, Write},
|
||||
os::{
|
||||
fd::{FromRawFd, IntoRawFd, RawFd},
|
||||
raw::c_void,
|
||||
},
|
||||
rc::Rc,
|
||||
str::FromStr,
|
||||
sync::mpsc,
|
||||
use libpulse_binding::callbacks::ListResult;
|
||||
use libpulse_binding::channelmap::Map;
|
||||
use libpulse_binding::context::introspect::{
|
||||
CardInfo, CardProfileInfo, Introspector, ServerInfo, SinkInfo, SourceInfo,
|
||||
};
|
||||
use libpulse_binding::context::subscribe::{Facility, InterestMaskSet, Operation};
|
||||
use libpulse_binding::context::{Context, FlagSet, State};
|
||||
use libpulse_binding::def::{PortAvailable, Retval};
|
||||
use libpulse_binding::mainloop::api::MainloopApi;
|
||||
use libpulse_binding::mainloop::events::io::IoEventInternal;
|
||||
use libpulse_binding::mainloop::standard::{IterateResult, Mainloop};
|
||||
use libpulse_binding::volume::{ChannelVolumes, Volume};
|
||||
use std::borrow::Cow;
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::convert::Infallible;
|
||||
use std::io::{Read, Write};
|
||||
use std::os::fd::{FromRawFd, IntoRawFd, RawFd};
|
||||
use std::os::raw::c_void;
|
||||
use std::rc::Rc;
|
||||
use std::str::FromStr;
|
||||
use std::sync::mpsc;
|
||||
|
||||
pub fn subscription() -> iced_futures::Subscription<Event> {
|
||||
Subscription::run_with("pulse", |_| {
|
||||
|
|
|
|||
|
|
@ -7,11 +7,9 @@ use cosmic_pipewire as pipewire;
|
|||
use futures::{SinkExt, Stream};
|
||||
use intmap::IntMap;
|
||||
use pipewire::Availability;
|
||||
use std::{
|
||||
process::Stdio,
|
||||
sync::{Arc, Mutex},
|
||||
time::Duration,
|
||||
};
|
||||
use std::process::Stdio;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::time::Duration;
|
||||
|
||||
pub type DeviceId = u32;
|
||||
pub type NodeId = u32;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@
|
|||
pub mod device {
|
||||
use futures::{FutureExt, Stream, StreamExt};
|
||||
use iced_futures::Subscription;
|
||||
use std::{fmt::Debug, hash::Hash};
|
||||
use std::fmt::Debug;
|
||||
use std::hash::Hash;
|
||||
use upower_dbus::{BatteryType, DeviceProxy, UPowerProxy};
|
||||
|
||||
pub fn device_subscription<I: 'static + Hash + Copy + Send + Sync + Debug>(
|
||||
|
|
@ -97,7 +98,8 @@ pub mod kbdbacklight {
|
|||
|
||||
use futures::{FutureExt, Stream, StreamExt};
|
||||
use iced_futures::Subscription;
|
||||
use std::{fmt::Debug, hash::Hash};
|
||||
use std::fmt::Debug;
|
||||
use std::hash::Hash;
|
||||
use tokio::sync::mpsc::{UnboundedSender, unbounded_channel};
|
||||
use tokio_stream::wrappers::UnboundedReceiverStream;
|
||||
use upower_dbus::{BrightnessChanged, KbdBacklightProxy};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue