chore: add rustfmt config

This commit is contained in:
Vukašin Vojinović 2026-05-04 18:02:46 +02:00 committed by Jacob Kauffmann
parent cb4a0d3a3a
commit 4b1f388a4f
78 changed files with 394 additions and 485 deletions

15
.zed/settings.json Normal file
View file

@ -0,0 +1,15 @@
{
"format_on_save": "on",
"lsp": {
"rust-analyzer": {
"initialization_options": {
"check": {
"command": "clippy",
},
"rustfmt": {
"extraArgs": ["+nightly"],
},
},
},
},
}

View file

@ -1,4 +1,5 @@
use std::{env, fs, path::PathBuf}; use std::path::PathBuf;
use std::{env, fs};
use xdgen::{App, Context, FluentString}; use xdgen::{App, Context, FluentString};
fn main() { fn main() {

View file

@ -5,7 +5,6 @@ use crate::PageCommands;
use crate::config::Config; use crate::config::Config;
#[cfg(feature = "page-accessibility")] #[cfg(feature = "page-accessibility")]
use crate::pages::accessibility; use crate::pages::accessibility;
use crate::pages::applications;
#[cfg(feature = "page-bluetooth")] #[cfg(feature = "page-bluetooth")]
use crate::pages::bluetooth; use crate::pages::bluetooth;
use crate::pages::desktop::{self, appearance}; use crate::pages::desktop::{self, appearance};
@ -19,26 +18,21 @@ use crate::pages::networking;
use crate::pages::power; use crate::pages::power;
#[cfg(feature = "page-sound")] #[cfg(feature = "page-sound")]
use crate::pages::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::subscription::desktop_files;
use crate::widget::{page_title, search_header}; use crate::widget::{page_title, search_header};
use cosmic::app::context_drawer::ContextDrawer;
use cosmic::app::{Core, Task};
#[cfg(feature = "wayland")] #[cfg(feature = "wayland")]
use cosmic::cctk::{sctk::output::OutputInfo, wayland_client::protocol::wl_output::WlOutput}; use cosmic::cctk::{sctk::output::OutputInfo, wayland_client::protocol::wl_output::WlOutput};
use cosmic::{ use cosmic::iced::event::{self, PlatformSpecific};
Element, use cosmic::iced::{self, Length, Subscription, keyboard, window};
app::{Core, Task, context_drawer::ContextDrawer}, use cosmic::prelude::*;
iced::{ use cosmic::widget::{
self, Length, Subscription, button, column, container, icon, id_container, nav_bar, row, scrollable, segmented_button,
event::{self, PlatformSpecific}, settings, text_input,
keyboard, window,
},
prelude::*,
surface,
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")] #[cfg(feature = "cosmic-comp-config")]
use cosmic_comp_config::CosmicCompConfig; use cosmic_comp_config::CosmicCompConfig;
#[cfg(feature = "wayland")] #[cfg(feature = "wayland")]
@ -52,8 +46,9 @@ use desktop::{
#[cfg(feature = "wayland")] #[cfg(feature = "wayland")]
use event::wayland; use event::wayland;
use page::Entity; use page::Entity;
use std::borrow::Cow;
use std::collections::BTreeSet; use std::collections::BTreeSet;
use std::{borrow::Cow, str::FromStr}; use std::str::FromStr;
#[allow(clippy::struct_excessive_bools)] #[allow(clippy::struct_excessive_bools)]
#[allow(clippy::module_name_repetitions)] #[allow(clippy::module_name_repetitions)]

View file

@ -1,10 +1,8 @@
// 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
use cosmic::{ use cosmic::cosmic_config::{self, ConfigGet, ConfigSet};
cosmic_config::{self, ConfigGet, ConfigSet}, use cosmic::cosmic_theme::palette::Srgba;
cosmic_theme::palette::Srgba,
};
const NAME: &str = "com.system76.CosmicSettings"; const NAME: &str = "com.system76.CosmicSettings";

View file

@ -1,10 +1,8 @@
// 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
use i18n_embed::{ use i18n_embed::fluent::{FluentLanguageLoader, fluent_language_loader};
DefaultLocalizer, LanguageLoader, Localizer, use i18n_embed::{DefaultLocalizer, LanguageLoader, Localizer};
fluent::{FluentLanguageLoader, fluent_language_loader},
};
use rust_embed::RustEmbed; use rust_embed::RustEmbed;
use std::sync::LazyLock; use std::sync::LazyLock;

View file

@ -24,7 +24,8 @@ pub mod widget;
use std::path::PathBuf; use std::path::PathBuf;
use clap::{Parser, Subcommand}; use clap::{Parser, Subcommand};
use cosmic::{app::CosmicFlags, iced::Limits}; use cosmic::app::CosmicFlags;
use cosmic::iced::Limits;
use i18n_embed::DesktopLanguageRequester; use i18n_embed::DesktopLanguageRequester;
use ron::error::SpannedError; use ron::error::SpannedError;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};

View file

@ -1,20 +1,15 @@
use std::collections::HashSet; use std::collections::HashSet;
use std::fmt::Write; use std::fmt::Write;
use cosmic::{ use cosmic::iced::core::text::Wrapping;
Apply, use cosmic::iced::{Element, Length, stream};
iced::core::text::Wrapping, use cosmic::widget::{self, icon, settings, svg, text};
iced::{Element, Length, stream}, use cosmic::{Apply, surface};
surface,
widget::{self, icon, settings, svg, text},
};
use cosmic_comp_config::{ZoomConfig, ZoomMovement}; use cosmic_comp_config::{ZoomConfig, ZoomMovement};
use cosmic_config::{ConfigGet, ConfigSet}; use cosmic_config::{ConfigGet, ConfigSet};
use cosmic_settings_config::{Action, Binding, shortcuts}; use cosmic_settings_config::{Action, Binding, shortcuts};
use cosmic_settings_page::{ use cosmic_settings_page::section::{self, Section};
self as page, Entity, use cosmic_settings_page::{self as page, Entity};
section::{self, Section},
};
use futures::SinkExt; use futures::SinkExt;
use slotmap::SlotMap; use slotmap::SlotMap;
use tracing::error; use tracing::error;

View file

@ -1,21 +1,16 @@
use cosmic::{ use cosmic::cosmic_theme::{CosmicPalette, ThemeBuilder};
Apply, Element, Task, use cosmic::iced::core::text::Wrapping;
cosmic_theme::{CosmicPalette, ThemeBuilder}, use cosmic::iced::stream;
iced::core::text::Wrapping, use cosmic::theme::CosmicTheme;
iced::stream, use cosmic::widget::{dropdown, settings, text};
surface, use cosmic::{Apply, Element, Task, surface};
theme::CosmicTheme,
widget::{dropdown, settings, text},
};
pub use cosmic_comp_config::ZoomMovement; pub use cosmic_comp_config::ZoomMovement;
use cosmic_config::CosmicConfigEntry; use cosmic_config::CosmicConfigEntry;
use cosmic_settings_a11y_manager_subscription as cosmic_a11y_manager; use cosmic_settings_a11y_manager_subscription as cosmic_a11y_manager;
use cosmic_settings_accessibility_subscription as a11y_bus; use cosmic_settings_accessibility_subscription as a11y_bus;
use cosmic_settings_daemon_config::CosmicSettingsDaemonConfig; use cosmic_settings_daemon_config::CosmicSettingsDaemonConfig;
use cosmic_settings_page::{ use cosmic_settings_page::section::{self, Section};
self as page, Insert, use cosmic_settings_page::{self as page, Insert};
section::{self, Section},
};
use futures::SinkExt; use futures::SinkExt;
use num_traits::FromPrimitive; use num_traits::FromPrimitive;
use slotmap::SlotMap; use slotmap::SlotMap;

View file

@ -2,19 +2,14 @@
// Copyright 2024 bbb651 <bar.ye651@gmail.com> // Copyright 2024 bbb651 <bar.ye651@gmail.com>
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use std::{ use std::borrow::Cow;
borrow::Cow, use std::collections::{BTreeMap, BTreeSet};
collections::{BTreeMap, BTreeSet}, use std::path::{Path, PathBuf};
path::{Path, PathBuf}, use std::sync::Arc;
sync::Arc,
};
use cosmic::{ use cosmic::iced::{Alignment, Length};
Apply, Element, Task, use cosmic::widget::{self, dropdown, icon, settings};
iced::{Alignment, Length}, use cosmic::{Apply, Element, Task, surface};
surface,
widget::{self, dropdown, icon, settings},
};
use cosmic_config::{ConfigGet, ConfigSet}; use cosmic_config::{ConfigGet, ConfigSet};
use cosmic_settings_config::shortcuts::SystemActions; use cosmic_settings_config::shortcuts::SystemActions;
use cosmic_settings_config::shortcuts::action::System; use cosmic_settings_config::shortcuts::action::System;

View file

@ -1,25 +1,17 @@
// 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
use std::{ use std::process::ExitStatus;
process::ExitStatus, use std::sync::Arc;
sync::{ use std::sync::atomic::{AtomicBool, Ordering};
Arc,
atomic::{AtomicBool, Ordering},
},
};
use cosmic::{ use cosmic::cosmic_config::{self, ConfigGet, ConfigSet};
Apply, Element, Task, use cosmic::iced::stream;
cosmic_config::{self, ConfigGet, ConfigSet}, use cosmic::widget::{self, dropdown, settings, text};
iced::stream, use cosmic::{Apply, Element, Task, surface};
surface,
widget::{self, dropdown, settings, text},
};
use cosmic_comp_config::{EavesdroppingKeyboardMode, XwaylandDescaling, XwaylandEavesdropping}; use cosmic_comp_config::{EavesdroppingKeyboardMode, XwaylandDescaling, XwaylandEavesdropping};
use cosmic_randr_shell::List; use cosmic_randr_shell::List;
use cosmic_settings_page::Section; use cosmic_settings_page::{self as page, Section, section};
use cosmic_settings_page::{self as page, section};
use futures::SinkExt; use futures::SinkExt;
use slotmap::SlotMap; use slotmap::SlotMap;
use tokio::sync::oneshot; use tokio::sync::oneshot;

View file

@ -3,7 +3,8 @@
use cosmic::iced::core::text::Wrapping; use cosmic::iced::core::text::Wrapping;
use cosmic::iced::{Alignment, Length, color}; 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::{Apply, Element, Task, theme};
use cosmic_settings_bluetooth_subscription::*; use cosmic_settings_bluetooth_subscription::*;
use cosmic_settings_page::{self as page, Section, section}; use cosmic_settings_page::{self as page, Section, section};

View file

@ -3,11 +3,9 @@ use cosmic::config::CosmicTk;
use cosmic::cosmic_config::{Config, ConfigSet}; use cosmic::cosmic_config::{Config, ConfigSet};
use cosmic::cosmic_theme::Spacing; use cosmic::cosmic_theme::Spacing;
use cosmic::iced::core::{Color, Length}; use cosmic::iced::core::{Color, Length};
use cosmic::widget::{ use cosmic::widget::color_picker::ColorPickerUpdate;
ColorPickerModel, color_picker::ColorPickerUpdate, container, flex_row, settings, text, use cosmic::widget::{ColorPickerModel, container, flex_row, settings, text};
}; use cosmic::{Apply, Element, Task, widget};
use cosmic::{Apply, Task};
use cosmic::{Element, widget};
use cosmic_config::ConfigGet; use cosmic_config::ConfigGet;
use std::sync::Arc; use std::sync::Arc;
use tracing::error; use tracing::error;
@ -15,11 +13,8 @@ use tracing::error;
use crate::app; use crate::app;
use crate::widget::color_picker_context_view; use crate::widget::color_picker_context_view;
use super::{ use super::icon_themes::{IconHandles, IconThemes};
ContextView, Message, font_config, icon_themes, use super::{ContextView, Message, font_config, icon_themes, theme_manager};
icon_themes::{IconHandles, IconThemes},
theme_manager,
};
pub struct Content { pub struct Content {
context_view: Option<ContextView>, context_view: Option<ContextView>,

View file

@ -3,11 +3,8 @@
use std::sync::Arc; use std::sync::Arc;
use cosmic::{ use cosmic::config::{CosmicTk, FontConfig};
Apply, Element, Task, use cosmic::{Apply, Element, Task, widget};
config::{CosmicTk, FontConfig},
widget,
};
use cosmic_config::ConfigSet; use cosmic_config::ConfigSet;
use crate::app; use crate::app;

View file

@ -1,14 +1,13 @@
// Copyright 2024 System76 <info@system76.com> // Copyright 2024 System76 <info@system76.com>
// SPDX-License-Identifier: GPL-3.0-only // 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 super::Message;
use cosmic::{ use cosmic::Element;
Element, use cosmic::iced::{Background, Length};
iced::{Background, Length}, use cosmic::widget::{button, icon, text};
widget::{button, icon, text},
};
use tokio::io::AsyncBufReadExt; use tokio::io::AsyncBufReadExt;
const ICON_PREV_N: usize = 6; const ICON_PREV_N: usize = 6;

View file

@ -21,14 +21,13 @@ use cosmic::cosmic_theme::{CornerRadii, Density, Roundness, ThemeBuilder, ThemeM
use cosmic::dialog::file_chooser::{self, FileFilter}; use cosmic::dialog::file_chooser::{self, FileFilter};
use cosmic::iced::Subscription; use cosmic::iced::Subscription;
use cosmic::iced::core::{Alignment, Length}; use cosmic::iced::core::{Alignment, Length};
use cosmic::widget::{ use cosmic::widget::color_picker::ColorPickerUpdate;
button, color_picker::ColorPickerUpdate, container, row, settings, space::horizontal, text, use cosmic::widget::space::horizontal;
}; use cosmic::widget::{button, container, row, settings, text};
use cosmic::{Apply, Element, Task, widget}; use cosmic::{Apply, Element, Task, widget};
#[cfg(feature = "wayland")] #[cfg(feature = "wayland")]
use cosmic_panel_config::CosmicPanelConfig; use cosmic_panel_config::CosmicPanelConfig;
use cosmic_settings_page::Section; use cosmic_settings_page::{self as page, Section, section};
use cosmic_settings_page::{self as page, section};
use ron::ser::PrettyConfig; use ron::ser::PrettyConfig;
use slotmap::{Key, SlotMap}; use slotmap::{Key, SlotMap};

View file

@ -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::icon::{from_name, icon};
use cosmic::widget::{button, container, settings, text}; use cosmic::widget::{button, container, settings, text};
use cosmic::{Apply, Element}; use cosmic::{Apply, Element};

View file

@ -1,22 +1,16 @@
use cosmic::{ use cosmic::app::ContextDrawer;
Apply, Element, Task, use cosmic::cosmic_config::CosmicConfigEntry;
app::ContextDrawer, use cosmic::iced::{Alignment, Length};
cosmic_config::CosmicConfigEntry, use cosmic::widget::{button, container, row};
iced::{Alignment, Length}, use cosmic::{Apply, Element, Task};
widget::{button, container, row},
};
use cosmic_panel_config::CosmicPanelConfig; use cosmic_panel_config::CosmicPanelConfig;
use cosmic_settings_page::{self as page, Section, section}; use cosmic_settings_page::{self as page, Section, section};
use slotmap::{Key, SlotMap}; use slotmap::{Key, SlotMap};
use std::borrow::Cow; use std::borrow::Cow;
use crate::{ use crate::app;
app, use crate::pages::desktop::panel::applets_inner::{self, AppletsPage, ContextDrawerVariant, lists};
pages::{ use crate::pages::{self};
self,
desktop::panel::applets_inner::{self, AppletsPage, ContextDrawerVariant, lists},
},
};
pub(crate) struct Page { pub(crate) struct Page {
inner: applets_inner::Page, inner: applets_inner::Page,

View file

@ -1,11 +1,8 @@
use std::collections::HashMap; use std::collections::HashMap;
use cosmic::Apply; use cosmic::cosmic_config::{ConfigSet, CosmicConfigEntry};
use cosmic::{ use cosmic::widget::{settings, text};
Element, Task, use cosmic::{Apply, Element, Task};
cosmic_config::{ConfigSet, CosmicConfigEntry},
widget::{settings, text},
};
use cosmic_panel_config::{CosmicPanelConfig, CosmicPanelContainerConfig}; use cosmic_panel_config::{CosmicPanelConfig, CosmicPanelContainerConfig};
use cosmic_settings_page::{self as page, Section, section}; use cosmic_settings_page::{self as page, Section, section};
use slotmap::SlotMap; use slotmap::SlotMap;

View file

@ -10,23 +10,21 @@ use cosmic::iced;
use cosmic::iced::core::clipboard::IconSurface; use cosmic::iced::core::clipboard::IconSurface;
use cosmic::widget::{Column, button, column, container, icon, list_column, row, text, text_input}; use cosmic::widget::{Column, button, column, container, icon, list_column, row, text, text_input};
use cosmic::{ use cosmic::cosmic_config::{Config, CosmicConfigEntry};
Apply, Element, use cosmic::iced::core::widget::{Operation, Tree, tree};
cosmic_config::{Config, CosmicConfigEntry}, use cosmic::iced::core::{Clipboard, Shell, Widget, layout, renderer, window};
iced::core::{ use cosmic::iced::runtime::Task;
Clipboard, Shell, Widget, layout, renderer, use cosmic::iced::runtime::core::id::Id;
widget::{Operation, Tree, tree}, use cosmic::iced::{
}, Alignment, Border, Color, Length, Point, Rectangle, Size, Vector, event, mouse, overlay, touch,
iced::runtime::{Task, core::id::Id},
iced::{
Alignment, Border, Color, Length, Point, Rectangle, Size, Vector, core::window, event,
mouse, overlay, touch,
},
theme,
}; };
use cosmic::{Apply, Element, theme};
use std::borrow::Cow;
use std::fmt::Debug;
use std::mem;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::{borrow::Cow, fmt::Debug, mem, sync::LazyLock}; use std::sync::LazyLock;
use crate::{app, pages}; use crate::{app, pages};
use cosmic_panel_config::CosmicPanelConfig; use cosmic_panel_config::CosmicPanelConfig;

View file

@ -1,12 +1,11 @@
use cosmic::{ use cosmic::cctk::sctk::reexports::client::Proxy;
Element, Task, use cosmic::cctk::sctk::reexports::client::backend::ObjectId;
cctk::sctk::reexports::client::{Proxy, backend::ObjectId, protocol::wl_output::WlOutput}, use cosmic::cctk::sctk::reexports::client::protocol::wl_output::WlOutput;
cosmic_config::{self, CosmicConfigEntry}, use cosmic::cosmic_config::{self, CosmicConfigEntry};
cosmic_theme::{Density, Roundness}, use cosmic::cosmic_theme::{Density, Roundness};
iced::{Alignment, Length}, use cosmic::iced::{Alignment, Length};
surface, use cosmic::widget::{button, container, dropdown, row, settings, slider, space, text};
widget::{button, container, dropdown, row, settings, slider, space, text}, use cosmic::{Element, Task, surface};
};
use cosmic::Apply; use cosmic::Apply;
use cosmic_config::ConfigSet; use cosmic_config::ConfigSet;
@ -15,7 +14,8 @@ use cosmic_panel_config::{
CosmicPanelOuput, PanelAnchor, PanelSize, CosmicPanelOuput, PanelAnchor, PanelSize,
}; };
use cosmic_settings_page::{self as page, Section}; 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 struct PageInner {
pub(crate) config_helper: Option<cosmic_config::Config>, pub(crate) config_helper: Option<cosmic_config::Config>,

View file

@ -1,6 +1,7 @@
use std::collections::HashMap; 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_panel_config::{CosmicPanelConfig, CosmicPanelContainerConfig};
use cosmic_settings_page::{self as page, Section, section}; use cosmic_settings_page::{self as page, Section, section};
use slotmap::SlotMap; use slotmap::SlotMap;

View file

@ -7,37 +7,25 @@ pub mod widgets;
pub use config::Config; pub use config::Config;
use url::Url; use url::Url;
use std::{ use std::collections::HashMap;
collections::HashMap, use std::path::{Path, PathBuf};
path::{Path, PathBuf}, use std::sync::Arc;
sync::Arc,
};
use cosmic::app::ContextDrawer;
#[cfg(feature = "xdg-portal")] #[cfg(feature = "xdg-portal")]
use cosmic::dialog::file_chooser; use cosmic::dialog::file_chooser;
use cosmic::{ use cosmic::iced::core::text::{Ellipsize, EllipsizeHeightLimit};
Apply, Element, Task, use cosmic::iced::runtime::core::image::Handle as ImageHandle;
iced::core::text::{Ellipsize, EllipsizeHeightLimit}, use cosmic::iced::{Alignment, Color, Length, Subscription, window};
widget::{ColorPickerModel, color_picker::ColorPickerUpdate, icon}, use cosmic::widget::color_picker::ColorPickerUpdate;
}; use cosmic::widget::segmented_button::{self, SingleSelectModel};
use cosmic::{app::ContextDrawer, iced::runtime::core::image::Handle as ImageHandle}; use cosmic::widget::space::horizontal as horizontal_space;
use cosmic::{ use cosmic::widget::{
iced::Subscription, ColorPickerModel, button, dropdown, icon, list_column, row, settings, tab_bar, text,
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::{Apply, Element, Task, surface};
use cosmic_bg_config::Source; use cosmic_bg_config::Source;
use cosmic_settings_page::Section; use cosmic_settings_page::{self as page, Section, section};
use cosmic_settings_page::{self as page, section};
use cosmic_settings_wallpaper::{self as wallpaper, Entry, ScalingMode}; use cosmic_settings_wallpaper::{self as wallpaper, Entry, ScalingMode};
use image::imageops::FilterType::Lanczos3; use image::imageops::FilterType::Lanczos3;
use image::{ImageBuffer, Rgba}; use image::{ImageBuffer, Rgba};

View file

@ -3,8 +3,8 @@
use super::Message; use super::Message;
use cosmic::iced::Radius; use cosmic::iced::Radius;
use cosmic::iced::core::Border; use cosmic::iced::core::gradient::Linear;
use cosmic::iced::core::{Background, Color, Degrees, Length, gradient::Linear}; use cosmic::iced::core::{Background, Border, Color, Degrees, Length};
use cosmic::iced::runtime::core::image::Handle as ImageHandle; use cosmic::iced::runtime::core::image::Handle as ImageHandle;
use cosmic::prelude::*; use cosmic::prelude::*;
use cosmic::widget::{Space, button, container}; use cosmic::widget::{Space, button, container};

View file

@ -1,18 +1,14 @@
// 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
use cosmic::{ use cosmic::iced::Length;
Apply, Element, use cosmic::widget::{self, settings};
iced::Length, use cosmic::{Apply, Element, surface};
surface,
widget::{self, settings},
};
use cosmic_comp_config::CosmicCompConfig; use cosmic_comp_config::CosmicCompConfig;
use cosmic_config::{ConfigGet, ConfigSet}; use cosmic_config::{ConfigGet, ConfigSet};
use cosmic_settings_config::{Action, Binding, Shortcuts, shortcuts}; use cosmic_settings_config::{Action, Binding, Shortcuts, shortcuts};
use cosmic_settings_page::Section; use cosmic_settings_page::{self as page, Section, section};
use cosmic_settings_page::{self as page, section};
use slotmap::SlotMap; use slotmap::SlotMap;
use tracing::error; use tracing::error;

View file

@ -3,15 +3,11 @@
// TODO make settings work // TODO make settings work
use cosmic::{ use cosmic::cosmic_config::{self, ConfigGet, ConfigSet};
Apply, Element, use cosmic::widget::{self, settings};
cosmic_config::{self, ConfigGet, ConfigSet}, use cosmic::{Apply, Element, surface};
surface,
widget::{self, settings},
};
use cosmic_comp_config::workspace::{Action, WorkspaceConfig, WorkspaceLayout, WorkspaceMode}; use cosmic_comp_config::workspace::{Action, WorkspaceConfig, WorkspaceLayout, WorkspaceMode};
use cosmic_settings_page::Section; use cosmic_settings_page::{self as page, Section, section};
use cosmic_settings_page::{self as page, section};
use slotmap::SlotMap; use slotmap::SlotMap;
use tracing::error; use tracing::error;

View file

@ -5,11 +5,9 @@ use cosmic::Renderer;
use cosmic::iced::core::renderer::Quad; use cosmic::iced::core::renderer::Quad;
use cosmic::iced::core::widget::{Tree, tree}; use cosmic::iced::core::widget::{Tree, tree};
use cosmic::iced::core::{ use cosmic::iced::core::{
self as core, Border, Clipboard, Element, Layout, Length, Rectangle, Renderer as IcedRenderer, self as core, Border, Clipboard, Element, Layout, Length, Point, Rectangle,
Shell, Size, Widget, 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::widget::segmented_button::{self, SingleSelectModel};
use cosmic_randr_shell::{self as randr, OutputKey}; use cosmic_randr_shell::{self as randr, OutputKey};
use randr::Transform; use randr::Transform;

View file

@ -20,9 +20,10 @@ use cosmic_settings_page::{self as page, Section, section};
use futures::SinkExt; use futures::SinkExt;
use indexmap::Equivalent; use indexmap::Equivalent;
use slotmap::{Key, SecondaryMap, SlotMap}; use slotmap::{Key, SecondaryMap, SlotMap};
use std::collections::BTreeMap;
use std::process::ExitStatus;
use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::{Arc, LazyLock}; use std::sync::{Arc, LazyLock};
use std::{collections::BTreeMap, process::ExitStatus};
use tokio::sync::oneshot; use tokio::sync::oneshot;
static DPI_SCALES: &[u32] = &[50, 75, 100, 125, 150, 175, 200, 225, 250, 275, 300]; static DPI_SCALES: &[u32] = &[50, 75, 100, 125, 150, 175, 200, 225, 250, 275, 300];

View file

@ -5,14 +5,11 @@ pub mod shortcuts;
use std::cmp; use std::cmp;
use cosmic::{ use cosmic::app::{ContextDrawer, context_drawer};
Apply, Element, Task, use cosmic::cosmic_config::{self, ConfigSet};
app::{ContextDrawer, context_drawer}, use cosmic::iced::{Alignment, Length};
cosmic_config::{self, ConfigSet}, use cosmic::widget::{self, ListColumn, button, container, icon, list, row, settings};
iced::{Alignment, Length}, use cosmic::{Apply, Element, Task, theme};
theme,
widget::{self, ListColumn, button, container, icon, list, row, settings},
};
use cosmic_comp_config::{KeyboardConfig, NumlockState, XkbConfig}; use cosmic_comp_config::{KeyboardConfig, NumlockState, XkbConfig};
use cosmic_settings_page::{self as page, Section, section}; use cosmic_settings_page::{self as page, Section, section};
use itertools::Itertools; use itertools::Itertools;

View file

@ -652,7 +652,8 @@ impl Model {
modifiers, modifiers,
.. ..
}) => { }) => {
use cosmic::iced::keyboard::{Key, key::Named}; use cosmic::iced::keyboard::Key;
use cosmic::iced::keyboard::key::Named;
if matches!( if matches!(
key, key,
@ -669,7 +670,8 @@ impl Model {
location, location,
.. ..
}) => { }) => {
use cosmic::iced::keyboard::{Key, key::Named}; use cosmic::iced::keyboard::Key;
use cosmic::iced::keyboard::key::Named;
if matches!( if matches!(
key, key,

View file

@ -590,7 +590,8 @@ impl page::Page<crate::pages::Message> for Page {
&self, &self,
core: &cosmic::Core, core: &cosmic::Core,
) -> cosmic::iced::Subscription<crate::pages::Message> { ) -> 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![ cosmic::iced::Subscription::batch(vec![
if self.add_shortcut.active if self.add_shortcut.active
@ -605,7 +606,8 @@ impl page::Page<crate::pages::Message> for Page {
modifiers, modifiers,
.. ..
}) => { }) => {
use cosmic::iced::keyboard::{Key, key::Named}; use cosmic::iced::keyboard::Key;
use cosmic::iced::keyboard::key::Named;
if matches!( if matches!(
key, key,
Key::Named(Named::Super | Named::Alt | Named::Control | Named::Shift) Key::Named(Named::Super | Named::Alt | Named::Control | Named::Shift)
@ -624,7 +626,8 @@ impl page::Page<crate::pages::Message> for Page {
location, location,
.. ..
}) => { }) => {
use cosmic::iced::keyboard::{Key, key::Named}; use cosmic::iced::keyboard::Key;
use cosmic::iced::keyboard::key::Named;
if matches!( if matches!(
key, key,
Key::Named(Named::Super | Named::Alt | Named::Control | Named::Shift) Key::Named(Named::Super | Named::Alt | Named::Control | Named::Shift)

View file

@ -2,8 +2,9 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use super::{ShortcutMessage, ShortcutModel}; use super::{ShortcutMessage, ShortcutModel};
use cosmic::app::ContextDrawer;
use cosmic::iced::platform_specific::shell::wayland::commands::keyboard_shortcuts_inhibit; 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;
use cosmic_settings_config::shortcuts::action::ResizeDirection; use cosmic_settings_config::shortcuts::action::ResizeDirection;
use cosmic_settings_page::{self as page, Section, section}; use cosmic_settings_page::{self as page, Section, section};

View file

@ -15,7 +15,8 @@ pub mod tiling;
use cosmic::app::ContextDrawer; use cosmic::app::ContextDrawer;
use cosmic::iced::Length; 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::{Apply, Element, Task};
use cosmic_config::ConfigGet; use cosmic_config::ConfigGet;
use cosmic_settings_config::Binding; use cosmic_settings_config::Binding;
@ -23,8 +24,7 @@ use cosmic_settings_config::shortcuts::action::{
Direction, FocusDirection, Orientation, ResizeDirection, Direction, FocusDirection, Orientation, ResizeDirection,
}; };
use cosmic_settings_config::shortcuts::{self, Action, Shortcuts}; use cosmic_settings_config::shortcuts::{self, Action, Shortcuts};
use cosmic_settings_page::Section; use cosmic_settings_page::{self as page, Section, section};
use cosmic_settings_page::{self as page, section};
use itertools::Itertools; use itertools::Itertools;
use shortcuts::action::System as SystemAction; use shortcuts::action::System as SystemAction;
use slab::Slab; use slab::Slab;

View file

@ -2,8 +2,9 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
// //
use super::{ShortcutMessage, ShortcutModel}; use super::{ShortcutMessage, ShortcutModel};
use cosmic::app::ContextDrawer;
use cosmic::iced::platform_specific::shell::wayland::commands::keyboard_shortcuts_inhibit; 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;
use cosmic_settings_config::shortcuts::action::Direction; use cosmic_settings_config::shortcuts::action::Direction;
use cosmic_settings_page::{self as page, Section, section}; use cosmic_settings_page::{self as page, Section, section};

View file

@ -2,8 +2,9 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use super::{ShortcutMessage, ShortcutModel}; use super::{ShortcutMessage, ShortcutModel};
use cosmic::app::ContextDrawer;
use cosmic::iced::platform_specific::shell::wayland::commands::keyboard_shortcuts_inhibit; 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;
use cosmic_settings_config::shortcuts::action::System as SystemAction; use cosmic_settings_config::shortcuts::action::System as SystemAction;
use cosmic_settings_page::{self as page, Section, section}; use cosmic_settings_page::{self as page, Section, section};

View file

@ -2,8 +2,9 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use super::{ShortcutMessage, ShortcutModel}; use super::{ShortcutMessage, ShortcutModel};
use cosmic::app::ContextDrawer;
use cosmic::iced::platform_specific::shell::wayland::commands::keyboard_shortcuts_inhibit; 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;
use cosmic_settings_config::shortcuts::action::Orientation; use cosmic_settings_config::shortcuts::action::Orientation;
use cosmic_settings_page::{self as page, Section, section}; use cosmic_settings_page::{self as page, Section, section};

View file

@ -2,10 +2,8 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use crate::app; use crate::app;
use cosmic::{ use cosmic::Task;
Task, use cosmic::cosmic_config::{self, ConfigGet, ConfigSet};
cosmic_config::{self, ConfigGet, ConfigSet},
};
use cosmic_comp_config::input::{ use cosmic_comp_config::input::{
AccelConfig, AccelProfile, ClickMethod, InputConfig, ScrollConfig, ScrollMethod, TapButtonMap, AccelConfig, AccelProfile, ClickMethod, InputConfig, ScrollConfig, ScrollMethod, TapButtonMap,
TapConfig, TapConfig,

View file

@ -5,8 +5,7 @@ use cosmic::iced::{Alignment, Length};
use cosmic::widget::{self, row, settings, text}; use cosmic::widget::{self, row, settings, text};
use cosmic::{Apply, Element}; use cosmic::{Apply, Element};
use cosmic_comp_config::input::AccelProfile; use cosmic_comp_config::input::AccelProfile;
use cosmic_settings_page::Section; use cosmic_settings_page::{self as page, Section, section};
use cosmic_settings_page::{self as page, section};
use slotmap::SlotMap; use slotmap::SlotMap;
use super::Message; use super::Message;

View file

@ -8,8 +8,7 @@ use cosmic::{Apply, Element};
use cosmic_comp_config::CosmicCompConfig; use cosmic_comp_config::CosmicCompConfig;
use cosmic_comp_config::input::{AccelProfile, ClickMethod, ScrollMethod}; use cosmic_comp_config::input::{AccelProfile, ClickMethod, ScrollMethod};
use cosmic_comp_config::workspace::{WorkspaceConfig, WorkspaceLayout}; use cosmic_comp_config::workspace::{WorkspaceConfig, WorkspaceLayout};
use cosmic_settings_page::Section; use cosmic_settings_page::{self as page, Section, section};
use cosmic_settings_page::{self as page, section};
use slotmap::SlotMap; use slotmap::SlotMap;
use tracing::error; use tracing::error;

View file

@ -5,14 +5,14 @@ pub mod vpn;
pub mod wifi; pub mod wifi;
pub mod wired; 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 anyhow::Context;
use cosmic::{Apply, Element, Task, widget}; use cosmic::{Apply, Element, Task, widget};
use cosmic_dbus_networkmanager::{ use cosmic_dbus_networkmanager::interface::enums::{DeviceState, DeviceType};
interface::enums::{DeviceState, DeviceType}, use cosmic_dbus_networkmanager::nm::NetworkManager;
nm::NetworkManager,
};
use cosmic_settings_network_manager_subscription as network_manager; use cosmic_settings_network_manager_subscription as network_manager;
use cosmic_settings_page::{self as page, Section, section}; use cosmic_settings_page::{self as page, Section, section};
use futures::{SinkExt, StreamExt}; use futures::{SinkExt, StreamExt};

View file

@ -8,16 +8,16 @@ use std::sync::{Arc, LazyLock};
use anyhow::Context; use anyhow::Context;
use cosmic::dialog::file_chooser::FileFilter; use cosmic::dialog::file_chooser::FileFilter;
use cosmic::task; use cosmic::iced::core::text::Wrapping;
use cosmic::{ use cosmic::iced::{Alignment, Length};
Apply, Element, Task, use cosmic::widget::space::horizontal as horizontal_space;
iced::core::text::Wrapping, use cosmic::widget::text_input::focus;
iced::{Alignment, Length}, use cosmic::widget::{self, icon};
widget::{self, icon, space::horizontal as horizontal_space, text_input::focus}, 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::nm_secret_agent::{self, PasswordFlag};
use cosmic_settings_network_manager_subscription::{ 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 cosmic_settings_page::{self as page, Section, section};
use futures::{FutureExt, SinkExt, StreamExt}; use futures::{FutureExt, SinkExt, StreamExt};

View file

@ -1,25 +1,22 @@
// Copyright 2024 System76 <info@system76.com> // Copyright 2024 System76 <info@system76.com>
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use std::{ use std::collections::{BTreeMap, BTreeSet};
collections::{BTreeMap, BTreeSet}, use std::sync::{Arc, LazyLock};
sync::{Arc, LazyLock},
};
use anyhow::Context; use anyhow::Context;
use cosmic::{ use cosmic::app::ContextDrawer;
Apply, Element, Task, use cosmic::iced::core::text::Wrapping;
app::ContextDrawer, use cosmic::iced::widget::operation::focus_next;
iced::core::text::Wrapping, use cosmic::iced::{Alignment, Length};
iced::{Alignment, Length, widget::operation::focus_next}, use cosmic::widget::space::horizontal;
task, use cosmic::widget::text_input::focus;
widget::{self, column, icon, space::horizontal, 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::{ use cosmic_settings_network_manager_subscription::{
self as network_manager, NetworkManagerState, self as network_manager, NetworkManagerState, nm_secret_agent,
available_wifi::{AccessPoint, NetworkType},
current_networks::ActiveConnectionInfo,
nm_secret_agent,
}; };
use cosmic_settings_page::{self as page, Section, section}; use cosmic_settings_page::{self as page, Section, section};
use futures::{SinkExt, StreamExt}; use futures::{SinkExt, StreamExt};

View file

@ -1,19 +1,18 @@
// Copyright 2024 System76 <info@system76.com> // Copyright 2024 System76 <info@system76.com>
// SPDX-License-Identifier: GPL-3.0-only // 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 anyhow::Context;
use cosmic::{ use cosmic::iced::core::text::Wrapping;
Apply, Element, Task, use cosmic::iced::{Alignment, Length};
iced::core::text::Wrapping, use cosmic::widget::space::horizontal as horizontal_space;
iced::{Alignment, Length}, use cosmic::widget::{self, icon};
widget::{self, icon, space::horizontal as horizontal_space}, use cosmic::{Apply, Element, Task};
};
use cosmic_dbus_networkmanager::interface::enums::DeviceState; use cosmic_dbus_networkmanager::interface::enums::DeviceState;
use cosmic_settings_network_manager_subscription::{ use cosmic_settings_network_manager_subscription::current_networks::ActiveConnectionInfo;
self as network_manager, NetworkManagerState, current_networks::ActiveConnectionInfo, use cosmic_settings_network_manager_subscription::{self as network_manager, NetworkManagerState};
};
use cosmic_settings_page::{self as page, Section, section}; use cosmic_settings_page::{self as page, Section, section};
use futures::{SinkExt, StreamExt}; use futures::{SinkExt, StreamExt};

View file

@ -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 jiff::{Span, SpanRelativeTo, SpanRound, ToSpan, Unit};
use upower_dbus::{BatteryState, BatteryType, DeviceProxy}; use upower_dbus::{BatteryState, BatteryType, DeviceProxy};
use zbus::{Connection, zvariant::ObjectPath}; use zbus::Connection;
use zbus::zvariant::ObjectPath;
mod ppdaemon; mod ppdaemon;
mod s76powerdaemon; mod s76powerdaemon;

View file

@ -3,12 +3,11 @@ mod backend;
use self::backend::{GetCurrentPowerProfile, SetPowerProfile}; use self::backend::{GetCurrentPowerProfile, SetPowerProfile};
use backend::{Battery, ConnectedDevice, PowerProfile}; use backend::{Battery, ConnectedDevice, PowerProfile};
use cosmic::Task;
use cosmic::iced::core::text::{Ellipsize, EllipsizeHeightLimit}; use cosmic::iced::core::text::{Ellipsize, EllipsizeHeightLimit};
use cosmic::iced::widget::{column, row}; use cosmic::iced::widget::{column, row};
use cosmic::iced::{self, Alignment, Length, stream}; use cosmic::iced::{self, Alignment, Length, stream};
use cosmic::widget::{self, settings, space, text}; use cosmic::widget::{self, settings, space, text};
use cosmic::{Apply, surface}; use cosmic::{Apply, Task, surface};
use cosmic_config::{Config, CosmicConfigEntry}; use cosmic_config::{Config, CosmicConfigEntry};
use cosmic_idle_config::CosmicIdleConfig; use cosmic_idle_config::CosmicIdleConfig;
use cosmic_settings_page::{self as page, Section, section}; use cosmic_settings_page::{self as page, Section, section};

View file

@ -3,12 +3,10 @@
pub mod device_profiles; pub mod device_profiles;
use cosmic::{ use cosmic::iced::{Alignment, Length, window};
Apply, Element, Task, use cosmic::widget::space::horizontal as horizontal_space;
iced::{Alignment, Length, window}, use cosmic::widget::{self, settings};
surface, use cosmic::{Apply, Element, Task, surface};
widget::{self, settings, space::horizontal as horizontal_space},
};
use cosmic_config::{Config, ConfigGet, ConfigSet}; use cosmic_config::{Config, ConfigGet, ConfigSet};
use cosmic_settings_page::{self as page, Section, section}; use cosmic_settings_page::{self as page, Section, section};
use cosmic_settings_sound_subscription as subscription; use cosmic_settings_sound_subscription as subscription;

View file

@ -3,7 +3,9 @@
#[cfg(feature = "wgpu")] #[cfg(feature = "wgpu")]
use cosmic::iced::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] #[must_use]
#[derive(Clone, Debug, Default)] #[derive(Clone, Debug, Default)]

View file

@ -4,25 +4,22 @@
mod getent; mod getent;
use crate::pages; use crate::pages;
use cosmic::{ use cosmic::dialog::file_chooser;
Apply, Element, use cosmic::iced::{Alignment, Length};
dialog::file_chooser, use cosmic::widget::space::horizontal;
iced::{Alignment, Length}, use cosmic::widget::{self, column, icon, list, row, settings, text};
widget::{self, column, icon, list, row, settings, space::horizontal, text}, use cosmic::{Apply, Element};
};
use cosmic_settings_page::{self as page, Section, section}; use cosmic_settings_page::{self as page, Section, section};
use image::GenericImageView; use image::GenericImageView;
use pwhash::{bcrypt, md5_crypt, sha256_crypt, sha512_crypt}; use pwhash::{bcrypt, md5_crypt, sha256_crypt, sha512_crypt};
use regex::Regex; use regex::Regex;
use slotmap::SlotMap; use slotmap::SlotMap;
use std::{ use std::collections::HashMap;
collections::HashMap, use std::fs::File;
fs::File, use std::future::Future;
future::Future, use std::io::{BufRead, BufReader};
io::{BufRead, BufReader}, use std::path::{Path, PathBuf};
path::{Path, PathBuf}, use std::sync::Arc;
sync::Arc,
};
use url::Url; use url::Url;
use zbus_polkit::policykit1::CheckAuthorizationFlags; use zbus_polkit::policykit1::CheckAuthorizationFlags;

View file

@ -2,24 +2,19 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use crate::widget::selection_context_item; use crate::widget::selection_context_item;
use cosmic::{ use cosmic::app::ContextDrawer;
Apply, Element, Task, use cosmic::cosmic_config::{self, ConfigGet, ConfigSet};
app::ContextDrawer, use cosmic::iced::core::text::Wrapping;
cosmic_config::{self, ConfigGet, ConfigSet}, use cosmic::widget::{self, dropdown, settings};
iced::core::text::Wrapping, use cosmic::{Apply, Element, Task, surface};
surface,
widget::{self, dropdown, settings},
};
use cosmic_settings_page::{self as page, Section, section}; use cosmic_settings_page::{self as page, Section, section};
use icu::{ use icu::calendar::types::Weekday;
calendar::{Gregorian, types::Weekday, week}, use icu::calendar::{Gregorian, week};
datetime::{ use icu::datetime::input::{Date, DateTime, Time};
DateTimeFormatter, DateTimeFormatterPreferences, fieldsets, use icu::datetime::options::TimePrecision;
input::{Date, DateTime, Time}, use icu::datetime::{DateTimeFormatter, DateTimeFormatterPreferences, fieldsets};
options::TimePrecision, use icu::locale::Locale;
}, use icu::locale::preferences::extensions::unicode::keywords::HourCycle;
locale::{Locale, preferences::extensions::unicode::keywords::HourCycle},
};
use slotmap::{Key, SlotMap}; use slotmap::{Key, SlotMap};
pub use timedate_zbus::TimeDateProxy; pub use timedate_zbus::TimeDateProxy;
use tracing::error; use tracing::error;

View file

@ -10,18 +10,15 @@ use cosmic::iced::{Alignment, Length};
use cosmic::widget::{self, button}; use cosmic::widget::{self, button};
use cosmic::{Apply, Element}; use cosmic::{Apply, Element};
use cosmic_config::{ConfigGet, ConfigSet}; use cosmic_config::{ConfigGet, ConfigSet};
use cosmic_settings_page::Section; use cosmic_settings_page::{self as page, Section, section};
use cosmic_settings_page::{self as page, section};
use eyre::Context; use eyre::Context;
use icu::{ use icu::calendar::types::Weekday;
calendar::{types::Weekday, week}, use icu::calendar::week;
datetime::{ use icu::datetime::input::{Date, DateTime, Time};
DateTimeFormatter, DateTimeFormatterPreferences, fieldsets, use icu::datetime::{DateTimeFormatter, DateTimeFormatterPreferences, fieldsets};
input::{Date, DateTime, Time}, use icu::decimal::DecimalFormatter;
}, use icu::decimal::input::Decimal;
decimal::{DecimalFormatter, input::Decimal}, use icu::locale::Locale;
locale::Locale,
};
use locales_rs as locale; use locales_rs as locale;
use regex::Regex; use regex::Regex;
use slotmap::{DefaultKey, SlotMap}; use slotmap::{DefaultKey, SlotMap};
@ -497,11 +494,8 @@ mod preferred_languages {
use crate::pages::time::region::localized_iso_codes; use crate::pages::time::region::localized_iso_codes;
use super::Message; use super::Message;
use cosmic::{ use cosmic::iced::{Alignment, Length};
Apply, use cosmic::{Apply, widget};
iced::{Alignment, Length},
widget,
};
use cosmic_settings_page::Section; use cosmic_settings_page::Section;
pub fn section() -> Section<crate::pages::Message> { pub fn section() -> Section<crate::pages::Message> {

View file

@ -2,11 +2,9 @@ use std::any::TypeId;
use ashpd::desktop::location::{Location, LocationProxy}; use ashpd::desktop::location::{Location, LocationProxy};
use chrono::NaiveDate; use chrono::NaiveDate;
use cosmic::iced::{ use cosmic::iced::futures::channel::mpsc::Sender;
Subscription, use cosmic::iced::futures::{SinkExt, StreamExt, future};
futures::{SinkExt, StreamExt, channel::mpsc::Sender, future}, use cosmic::iced::{Subscription, stream};
stream,
};
use sunrise::{Coordinates, SolarDay, SolarEvent}; use sunrise::{Coordinates, SolarDay, SolarEvent};
use tokio::select; use tokio::select;

View file

@ -1,8 +1,5 @@
use cosmic::iced::{ use cosmic::iced::futures::{self, SinkExt};
Subscription, use cosmic::iced::{Subscription, stream};
futures::{self, SinkExt},
stream,
};
use notify::{Config, EventKind, RecommendedWatcher, RecursiveMode, Watcher}; use notify::{Config, EventKind, RecommendedWatcher, RecursiveMode, Watcher};
use std::fmt::Debug; use std::fmt::Debug;
use std::hash::Hash; use std::hash::Hash;

View file

@ -1,10 +1,8 @@
use std::path::PathBuf; use std::path::PathBuf;
use cosmic::iced::{ use cosmic::iced::futures::channel::mpsc::Sender;
Subscription, use cosmic::iced::futures::{SinkExt, StreamExt, future};
futures::{SinkExt, StreamExt, channel::mpsc::Sender, future}, use cosmic::iced::{Subscription, stream};
stream,
};
use image::{ImageBuffer, Rgba}; use image::{ImageBuffer, Rgba};
#[derive(Clone, Debug)] #[derive(Clone, Debug)]

View file

@ -1,7 +1,8 @@
// 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
use cosmic::{iced::Border, theme}; use cosmic::iced::Border;
use cosmic::theme;
#[must_use] #[must_use]
pub fn display_container_frame() -> cosmic::theme::Container<'static> { pub fn display_container_frame() -> cosmic::theme::Container<'static> {

View file

@ -1,4 +1,5 @@
use std::{future::Future, io, process}; use std::future::Future;
use std::{io, process};
use futures::future::select; use futures::future::select;

View file

@ -8,10 +8,9 @@ use cosmic::cosmic_theme::Spacing;
use cosmic::iced::core::text::Wrapping; use cosmic::iced::core::text::Wrapping;
use cosmic::iced::{Alignment, Length}; use cosmic::iced::{Alignment, Length};
use cosmic::widget::color_picker::ColorPickerUpdate; use cosmic::widget::color_picker::ColorPickerUpdate;
use cosmic::widget::space::{horizontal, vertical};
use cosmic::widget::{ use cosmic::widget::{
self, ColorPickerModel, button, column, container, divider, icon, list, row, settings, self, ColorPickerModel, button, column, container, divider, icon, list, row, settings, text,
space::{horizontal, vertical},
text,
}; };
use cosmic::{Apply, Element, theme}; use cosmic::{Apply, Element, theme};
use cosmic_settings_page as page; use cosmic_settings_page as page;

View file

@ -21,20 +21,19 @@ pub use route::{Route, RouteProps};
mod spa_utils; mod spa_utils;
pub use spa_utils::Channel; pub use spa_utils::Channel;
use libspa::{ use libspa::param::ParamType;
param::{ParamType, format::FormatProperties}, use libspa::param::format::FormatProperties;
pod::{self, Pod, serialize::PodSerializer}, use libspa::pod::serialize::PodSerializer;
utils::SpaTypes, use libspa::pod::{self, Pod};
}; use libspa::utils::SpaTypes;
use pipewire::{ use pipewire::device::{DeviceChangeMask, DeviceListener};
device::{DeviceChangeMask, DeviceListener}, use pipewire::main_loop::MainLoopWeak;
main_loop::MainLoopWeak, use pipewire::metadata::MetadataListener;
metadata::MetadataListener, use pipewire::node::NodeListener;
node::NodeListener, use pipewire::proxy::{ProxyListener, ProxyT};
proxy::{ProxyListener, ProxyT}, use pipewire::types::ObjectType;
types::ObjectType, use std::cell::RefCell;
}; use std::rc::Rc;
use std::{cell::RefCell, rc::Rc};
pub type NodeId = u32; pub type NodeId = u32;
pub type RouteId = u32; pub type RouteId = u32;

View file

@ -1,8 +1,10 @@
// Copyright 2025 System76 <info@system76.com> // Copyright 2025 System76 <info@system76.com>
// SPDX-License-Identifier: MPL-2.0 // SPDX-License-Identifier: MPL-2.0
use crate::{Channel, spa_utils::array_from_pod}; use crate::Channel;
use libspa::{pod::Pod, utils::Id}; use crate::spa_utils::array_from_pod;
use libspa::pod::Pod;
use libspa::utils::Id;
use pipewire::node::{NodeInfoRef, NodeState}; use pipewire::node::{NodeInfoRef, NodeState};
use std::ffi::c_float; use std::ffi::c_float;

View file

@ -1,7 +1,8 @@
// Copyright 2025 System76 <info@system76.com> // Copyright 2025 System76 <info@system76.com>
// SPDX-License-Identifier: MPL-2.0 // 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; use libspa::pod::Pod;
#[derive(Clone, Debug, Default)] #[derive(Clone, Debug, Default)]

View file

@ -3,11 +3,10 @@
use std::ffi::{c_float, c_int}; use std::ffi::{c_float, c_int};
use crate::{ use crate::spa_utils::{array_from_pod, string_from_pod};
Availability, Channel, Direction, use crate::{Availability, Channel, Direction};
spa_utils::{array_from_pod, string_from_pod}, use libspa::pod::Pod;
}; use libspa::utils::Id;
use libspa::{pod::Pod, utils::Id};
#[derive(Clone, Debug, Default)] #[derive(Clone, Debug, Default)]
pub struct Route { pub struct Route {

View file

@ -3,15 +3,12 @@
use crate::section::{self, Section}; use crate::section::{self, Section};
use crate::{Content, Info, Page}; use crate::{Content, Info, Page};
use cosmic::Element;
use cosmic::Task;
use cosmic::app::ContextDrawer; use cosmic::app::ContextDrawer;
use cosmic::{Element, Task};
use regex::Regex; use regex::Regex;
use slotmap::{SecondaryMap, SlotMap, SparseSecondaryMap}; use slotmap::{SecondaryMap, SlotMap, SparseSecondaryMap};
use std::{ use std::any::{Any, TypeId};
any::{Any, TypeId}, use std::collections::HashMap;
collections::HashMap,
};
/// All settings pages are registered and managed by the [`Binder`]. /// All settings pages are registered and managed by the [`Binder`].
pub struct Binder<Message> { pub struct Binder<Message> {

View file

@ -5,7 +5,9 @@ mod binder;
pub use binder::{AutoBind, Binder}; pub use binder::{AutoBind, Binder};
mod insert; 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}; use downcast_rs::{Downcast, impl_downcast};
pub use insert::Insert; pub use insert::Insert;

View file

@ -6,16 +6,15 @@ use futures_util::StreamExt;
use image::imageops::FilterType; use image::imageops::FilterType;
use image::{DynamicImage, ImageBuffer, Rgba, RgbaImage}; use image::{DynamicImage, ImageBuffer, Rgba, RgbaImage};
use jxl_oxide::integration::JxlDecoder; 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::fs::File;
use std::hash::{Hash, Hasher};
use std::io::Read;
use std::os::unix::ffi::OsStrExt; use std::os::unix::ffi::OsStrExt;
use std::{ use std::path::{Path, PathBuf};
borrow::Cow, use std::pin::Pin;
collections::{HashMap, hash_map::DefaultHasher},
hash::{Hash, Hasher},
io::Read,
path::{Path, PathBuf},
pin::Pin,
};
use walkdir::WalkDir; use walkdir::WalkDir;
pub const DEFAULT_COLORS: &[Color] = &[ pub const DEFAULT_COLORS: &[Color] = &[

1
rustfmt.toml Normal file
View file

@ -0,0 +1 @@
imports_granularity = "Module"

View file

@ -1,17 +1,11 @@
use cosmic_protocols::a11y::v1::client::cosmic_a11y_manager_v1::{self, ActiveState}; use cosmic_protocols::a11y::v1::client::cosmic_a11y_manager_v1::{self, ActiveState};
use num_derive::{FromPrimitive, ToPrimitive}; use num_derive::{FromPrimitive, ToPrimitive};
use sctk::{ use sctk::reexports::calloop::{self, LoopSignal, channel};
reexports::{ use sctk::reexports::calloop_wayland_source::WaylandSource;
calloop::{self, LoopSignal, channel}, use sctk::reexports::client::globals::{GlobalListContents, registry_queue_init};
calloop_wayland_source::WaylandSource, use sctk::reexports::client::protocol::wl_registry;
client::{ use sctk::reexports::client::{ConnectError, Connection, Dispatch, Proxy, WEnum};
ConnectError, Connection, Dispatch, Proxy, WEnum, use sctk::registry::RegistryState;
globals::{GlobalListContents, registry_queue_init},
protocol::wl_registry,
},
},
registry::RegistryState,
};
use tokio::sync::mpsc; use tokio::sync::mpsc;
#[derive(Debug, Clone, Copy)] #[derive(Debug, Clone, Copy)]

View file

@ -42,8 +42,9 @@ fn is_airplane_mode(rfkill_state: &HashMap<u32, rfkill::DeviceState>) -> bool {
mod rfkill { mod rfkill {
use futures::stream::Stream; use futures::stream::Stream;
use std::collections::HashMap;
use std::os::unix::fs::OpenOptionsExt; 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; use tokio::io::unix::AsyncFd;
// /usr/include/linux/rfkill.h // /usr/include/linux/rfkill.h

View file

@ -2,13 +2,11 @@
// SPDX-License-Identifier: MPL-2.0 // SPDX-License-Identifier: MPL-2.0
use crate::{Active, Event}; use crate::{Active, Event};
use std::{ use std::collections::HashMap;
collections::HashMap, use std::convert::Infallible;
convert::Infallible, use std::hash::{Hash, Hasher};
hash::{Hash, Hasher}, use std::path::PathBuf;
path::PathBuf, use std::time::Duration;
time::Duration,
};
use zbus::zvariant::OwnedObjectPath; use zbus::zvariant::OwnedObjectPath;
#[derive(Default, Debug, Clone)] #[derive(Default, Debug, Clone)]

View file

@ -3,11 +3,9 @@
use crate::{Active, Event}; use crate::{Active, Event};
use futures::join; use futures::join;
use std::{ use std::collections::HashMap;
collections::HashMap, use std::hash::{Hash, Hasher};
hash::{Hash, Hasher}, use std::time::Duration;
time::Duration,
};
use zbus::zvariant::OwnedObjectPath; use zbus::zvariant::OwnedObjectPath;
const DEFAILT_DEVICE_ICON: &str = "bluetooth-symbolic"; const DEFAILT_DEVICE_ICON: &str = "bluetooth-symbolic";

View file

@ -5,9 +5,11 @@ use crate::{AdapterUpdate, Device, DeviceUpdate, Event};
use std::pin::Pin; use std::pin::Pin;
use bluez_zbus::BluetoothDevice; 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 iced_futures::futures::{SinkExt, StreamExt};
use zbus::{fdo, zvariant::OwnedObjectPath}; use zbus::fdo;
use zbus::zvariant::OwnedObjectPath;
enum DevicePropertyWatcherTask { enum DevicePropertyWatcherTask {
Add(OwnedObjectPath), Add(OwnedObjectPath),

View file

@ -7,7 +7,8 @@ use super::Event;
use cosmic_dbus_networkmanager::nm::NetworkManager; use cosmic_dbus_networkmanager::nm::NetworkManager;
use futures::{SinkExt, StreamExt}; use futures::{SinkExt, StreamExt};
use iced_futures::{Subscription, stream}; use iced_futures::{Subscription, stream};
use std::{fmt::Debug, hash::Hash}; use std::fmt::Debug;
use std::hash::Hash;
use zbus::Connection; use zbus::Connection;
#[derive(Debug, Clone)] #[derive(Debug, Clone)]

View file

@ -1,14 +1,13 @@
// Copyright 2024 System76 <info@system76.com> // Copyright 2024 System76 <info@system76.com>
// SPDX-License-Identifier: MPL-2.0 // SPDX-License-Identifier: MPL-2.0
use cosmic_dbus_networkmanager::{ use cosmic_dbus_networkmanager::device::wireless::WirelessDevice;
device::wireless::WirelessDevice, use cosmic_dbus_networkmanager::interface::enums::{ApFlags, ApSecurityFlags, DeviceState};
interface::enums::{ApFlags, ApSecurityFlags, DeviceState},
};
use futures::StreamExt; use futures::StreamExt;
use itertools::Itertools; use itertools::Itertools;
use std::{collections::HashMap, sync::Arc}; use std::collections::HashMap;
use std::sync::Arc;
use zbus::zvariant::ObjectPath; use zbus::zvariant::ObjectPath;
use super::hw_address::HwAddress; use super::hw_address::HwAddress;

View file

@ -1,10 +1,9 @@
// Copyright 2024 System76 <info@system76.com> // Copyright 2024 System76 <info@system76.com>
// SPDX-License-Identifier: MPL-2.0 // SPDX-License-Identifier: MPL-2.0
use cosmic_dbus_networkmanager::{ use cosmic_dbus_networkmanager::active_connection::ActiveConnection;
active_connection::ActiveConnection, device::SpecificDevice, use cosmic_dbus_networkmanager::device::SpecificDevice;
interface::enums::ActiveConnectionState, use cosmic_dbus_networkmanager::interface::enums::ActiveConnectionState;
};
use std::net::Ipv4Addr; use std::net::Ipv4Addr;
pub async fn active_connections( pub async fn active_connections(

View file

@ -10,8 +10,11 @@ use core::hash;
use cosmic_dbus_networkmanager::nm::NetworkManager; use cosmic_dbus_networkmanager::nm::NetworkManager;
use futures::{SinkExt, StreamExt}; use futures::{SinkExt, StreamExt};
use iced_futures::{self, Subscription, stream}; use iced_futures::{self, Subscription, stream};
use std::{fmt::Debug, hash::Hash, sync::Arc}; use std::fmt::Debug;
use zbus::{Connection, zvariant::ObjectPath}; use std::hash::Hash;
use std::sync::Arc;
use zbus::Connection;
use zbus::zvariant::ObjectPath;
#[derive(Debug, Clone, Eq, PartialEq)] #[derive(Debug, Clone, Eq, PartialEq)]
pub struct DeviceInfo { pub struct DeviceInfo {

View file

@ -9,34 +9,33 @@ pub mod hw_address;
pub mod nm_secret_agent; pub mod nm_secret_agent;
pub mod wireless_enabled; 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; use available_wifi::NetworkType;
pub use cosmic_dbus_networkmanager as dbus; pub use cosmic_dbus_networkmanager as dbus;
pub use dbus::settings::connection::Settings; pub use dbus::settings::connection::Settings;
use cosmic_dbus_networkmanager::{ use cosmic_dbus_networkmanager::device::SpecificDevice;
device::SpecificDevice, use cosmic_dbus_networkmanager::interface::enums::{
interface::{ self, ActiveConnectionState, DeviceType, NmConnectivityState,
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::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 iced_futures::{Subscription, stream};
use secure_string::SecureString; use secure_string::SecureString;
use tokio::process::Command; use tokio::process::Command;
use zbus::zvariant::{self, ObjectPath, Value}; use zbus::zvariant::{self, ObjectPath, Value};
use self::{ use self::available_wifi::{AccessPoint, handle_wireless_device};
available_wifi::{AccessPoint, handle_wireless_device}, use self::current_networks::{ActiveConnectionInfo, active_connections};
current_networks::{ActiveConnectionInfo, active_connections},
};
pub type SSID = Arc<str>; pub type SSID = Arc<str>;
pub type UUID = Arc<str>; pub type UUID = Arc<str>;

View file

@ -1,18 +1,14 @@
use std::{ use std::collections::{HashMap, HashSet};
collections::{HashMap, HashSet}, use std::fmt::Debug;
fmt::Debug, use std::sync::Arc;
sync::Arc,
};
use bitflags::bitflags; use bitflags::bitflags;
use cosmic_dbus_networkmanager::interface::settings::connection::ConnectionSettingsProxy; use cosmic_dbus_networkmanager::interface::settings::connection::ConnectionSettingsProxy;
use futures::{SinkExt, Stream}; use futures::{SinkExt, Stream};
use secure_string::SecureString; use secure_string::SecureString;
use tokio::sync::oneshot; use tokio::sync::oneshot;
use zbus::{ use zbus::zvariant::{OwnedValue, Str};
ObjectServer, fdo, use zbus::{ObjectServer, fdo};
zvariant::{OwnedValue, Str},
};
pub type SecretSender = Arc<tokio::sync::Mutex<Option<tokio::sync::oneshot::Sender<SecureString>>>>; pub type SecretSender = Arc<tokio::sync::Mutex<Option<tokio::sync::oneshot::Sender<SecureString>>>>;

View file

@ -7,7 +7,8 @@ use super::Event;
use cosmic_dbus_networkmanager::nm::NetworkManager; use cosmic_dbus_networkmanager::nm::NetworkManager;
use futures::{SinkExt, StreamExt}; use futures::{SinkExt, StreamExt};
use iced_futures::{Subscription, stream}; use iced_futures::{Subscription, stream};
use std::{fmt::Debug, hash::Hash}; use std::fmt::Debug;
use std::hash::Hash;
use zbus::Connection; use zbus::Connection;
#[derive(Debug, Clone)] #[derive(Debug, Clone)]

View file

@ -4,37 +4,30 @@
// Make sure not to fail if pulse not found, and reconnect? // Make sure not to fail if pulse not found, and reconnect?
// change to device shouldn't send osd? // 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 iced_futures::{Subscription, stream};
use libpulse_binding::{ use libpulse_binding::callbacks::ListResult;
callbacks::ListResult, use libpulse_binding::channelmap::Map;
channelmap::Map, use libpulse_binding::context::introspect::{
context::{ CardInfo, CardProfileInfo, Introspector, ServerInfo, SinkInfo, SourceInfo,
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::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> { pub fn subscription() -> iced_futures::Subscription<Event> {
Subscription::run_with("pulse", |_| { Subscription::run_with("pulse", |_| {

View file

@ -7,11 +7,9 @@ use cosmic_pipewire as pipewire;
use futures::{SinkExt, Stream}; use futures::{SinkExt, Stream};
use intmap::IntMap; use intmap::IntMap;
use pipewire::Availability; use pipewire::Availability;
use std::{ use std::process::Stdio;
process::Stdio, use std::sync::{Arc, Mutex};
sync::{Arc, Mutex}, use std::time::Duration;
time::Duration,
};
pub type DeviceId = u32; pub type DeviceId = u32;
pub type NodeId = u32; pub type NodeId = u32;

View file

@ -4,7 +4,8 @@
pub mod device { pub mod device {
use futures::{FutureExt, Stream, StreamExt}; use futures::{FutureExt, Stream, StreamExt};
use iced_futures::Subscription; use iced_futures::Subscription;
use std::{fmt::Debug, hash::Hash}; use std::fmt::Debug;
use std::hash::Hash;
use upower_dbus::{BatteryType, DeviceProxy, UPowerProxy}; use upower_dbus::{BatteryType, DeviceProxy, UPowerProxy};
pub fn device_subscription<I: 'static + Hash + Copy + Send + Sync + Debug>( pub fn device_subscription<I: 'static + Hash + Copy + Send + Sync + Debug>(
@ -97,7 +98,8 @@ pub mod kbdbacklight {
use futures::{FutureExt, Stream, StreamExt}; use futures::{FutureExt, Stream, StreamExt};
use iced_futures::Subscription; 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::sync::mpsc::{UnboundedSender, unbounded_channel};
use tokio_stream::wrappers::UnboundedReceiverStream; use tokio_stream::wrappers::UnboundedReceiverStream;
use upower_dbus::{BrightnessChanged, KbdBacklightProxy}; use upower_dbus::{BrightnessChanged, KbdBacklightProxy};