chore: update to Rust 2024 edition

This commit is contained in:
Vukašin Vojinović 2025-08-12 21:38:51 +02:00 committed by Michael Murphy
parent c3fafd3910
commit 2b7b4cba56
71 changed files with 254 additions and 292 deletions

View file

@ -19,11 +19,11 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master - uses: dtolnay/rust-toolchain@master
with: with:
toolchain: 1.80.1 toolchain: 1.85.1
components: clippy components: clippy
- name: install dependencies - name: install dependencies
run: sudo apt update && sudo apt install -y libxkbcommon-dev libwayland-dev libdbus-1-dev libpulse-dev libinput-dev run: sudo apt update && sudo apt install -y libxkbcommon-dev libwayland-dev libdbus-1-dev libpulse-dev libinput-dev
- uses: actions-rs-plus/clippy-check@v2 - uses: actions-rs-plus/clippy-check@v2
with: with:
toolchain: 1.80.1 toolchain: 1.85.1
args: --all --all-targets --all-features args: --all --all-targets --all-features

View file

@ -1,7 +1,7 @@
[package] [package]
name = "cosmic-app-list" name = "cosmic-app-list"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2024"
license = "GPL-3.0-only" license = "GPL-3.0-only"
[dependencies] [dependencies]

View file

@ -1,7 +1,7 @@
[package] [package]
name = "cosmic-app-list-config" name = "cosmic-app-list-config"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2024"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View file

@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use cosmic::cosmic_config::{ use cosmic::cosmic_config::{
self, cosmic_config_derive::CosmicConfigEntry, Config, CosmicConfigEntry, self, Config, CosmicConfigEntry, cosmic_config_derive::CosmicConfigEntry,
}; };
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt::Debug; use std::fmt::Debug;

View file

@ -4,8 +4,8 @@
use crate::{ use crate::{
fl, fl,
wayland_subscription::{ wayland_subscription::{
wayland_subscription, OutputUpdate, ToplevelRequest, ToplevelUpdate, WaylandImage, OutputUpdate, ToplevelRequest, ToplevelUpdate, WaylandImage, WaylandRequest, WaylandUpdate,
WaylandRequest, WaylandUpdate, wayland_subscription,
}, },
}; };
use cctk::{ use cctk::{
@ -20,43 +20,41 @@ use cctk::{
}, },
}; };
use cosmic::desktop::fde::unicase::Ascii; use cosmic::desktop::fde::unicase::Ascii;
use cosmic::desktop::fde::{get_languages_from_env, DesktopEntry}; use cosmic::desktop::fde::{self, DesktopEntry, get_languages_from_env};
use cosmic::{ use cosmic::{
app, Apply, Element, Task, app,
applet::{ applet::{
cosmic_panel_config::{PanelAnchor, PanelSize},
Context, Size, Context, Size,
cosmic_panel_config::{PanelAnchor, PanelSize},
}, },
cosmic_config::{Config, CosmicConfigEntry}, cosmic_config::{Config, CosmicConfigEntry},
desktop::IconSourceExt, desktop::IconSourceExt,
iced::{ iced::{
self, self, Color, Limits, Subscription,
clipboard::mime::{AllowedMimeTypes, AsMimeTypes}, clipboard::mime::{AllowedMimeTypes, AsMimeTypes},
event::listen_with, event::listen_with,
platform_specific::shell::commands::popup::{destroy_popup, get_popup}, platform_specific::shell::commands::popup::{destroy_popup, get_popup},
widget::{column, mouse_area, row, vertical_rule, vertical_space, Column, Row}, widget::{Column, Row, column, mouse_area, row, vertical_rule, vertical_space},
window, Color, Limits, Subscription, window,
}, },
iced_core::{Border, Padding, Shadow}, iced_core::{Border, Padding, Shadow},
iced_runtime::{core::event, dnd::peek_dnd}, iced_runtime::{core::event, dnd::peek_dnd},
surface, surface,
theme::{self, Button, Container}, theme::{self, Button, Container},
widget::{ widget::{
button, divider, dnd_source, horizontal_space, DndDestination, Image, button, container, divider, dnd_source, horizontal_space,
icon::{self, from_name}, icon::{self, from_name},
image::Handle, image::Handle,
rectangle_tracker::{rectangle_tracker_subscription, RectangleTracker, RectangleUpdate}, rectangle_tracker::{RectangleTracker, RectangleUpdate, rectangle_tracker_subscription},
svg, text, DndDestination, Image, svg, text,
}, },
Apply, Element, Task,
}; };
use cosmic::{desktop::fde, widget}; use cosmic_app_list_config::{APP_ID, AppListConfig};
use cosmic_app_list_config::{AppListConfig, APP_ID};
use cosmic_protocols::toplevel_info::v1::client::zcosmic_toplevel_handle_v1::State; use cosmic_protocols::toplevel_info::v1::client::zcosmic_toplevel_handle_v1::State;
use futures::future::pending; use futures::future::pending;
use iced::{widget::container, Alignment, Background, Length}; use iced::{Alignment, Background, Length};
use itertools::Itertools; use itertools::Itertools;
use rand::{rng, Rng}; use rand::{Rng, rng};
use std::{borrow::Cow, collections::HashMap, path::PathBuf, rc::Rc, str::FromStr, time::Duration}; use std::{borrow::Cow, collections::HashMap, path::PathBuf, rc::Rc, str::FromStr, time::Duration};
use switcheroo_control::Gpu; use switcheroo_control::Gpu;
use tokio::time::sleep; use tokio::time::sleep;
@ -905,9 +903,7 @@ impl cosmic::Application for CosmicAppList {
Message::DragFinished => { Message::DragFinished => {
if let Some((_, mut toplevel_group, _, pinned_pos)) = self.dnd_source.take() { if let Some((_, mut toplevel_group, _, pinned_pos)) = self.dnd_source.take() {
if self.dnd_offer.take().is_some() { if self.dnd_offer.take().is_some() {
if let Some((_, ref toplevel_group, _, pinned_pos)) = if let Some((_, toplevel_group, _, pinned_pos)) = self.dnd_source.as_ref() {
self.dnd_source.as_ref()
{
let mut pos = 0; let mut pos = 0;
self.pinned_list.retain_mut(|pinned| { self.pinned_list.retain_mut(|pinned| {
let matched_id = let matched_id =
@ -978,7 +974,7 @@ impl cosmic::Application for CosmicAppList {
} }
Message::DndLeave => { Message::DndLeave => {
let mut cnt = 0; let mut cnt = 0;
if let Some((_, ref toplevel_group, _, pinned_pos)) = self.dnd_source.as_ref() { if let Some((_, toplevel_group, _, pinned_pos)) = self.dnd_source.as_ref() {
let mut pos = 0; let mut pos = 0;
self.pinned_list.retain_mut(|pinned| { self.pinned_list.retain_mut(|pinned| {
let matched_id = let matched_id =
@ -1069,7 +1065,7 @@ impl cosmic::Application for CosmicAppList {
.iter_mut() .iter_mut()
.chain(self.pinned_list.iter_mut()) .chain(self.pinned_list.iter_mut())
{ {
if let Some((_, ref mut handle_img)) = x if let Some((_, handle_img)) = x
.toplevels .toplevels
.iter_mut() .iter_mut()
.find(|(info, _)| info.foreign_toplevel == handle) .find(|(info, _)| info.foreign_toplevel == handle)
@ -1481,11 +1477,7 @@ impl cosmic::Application for CosmicAppList {
let small_size_threshold = PanelSize::S.get_applet_icon_size_with_padding(false); let small_size_threshold = PanelSize::S.get_applet_icon_size_with_padding(false);
if size <= small_size_threshold { if size <= small_size_threshold { 4 } else { 8 }
4
} else {
8
}
} }
}; };
let (favorite_popup_cutoff, active_popup_cutoff) = self.panel_overflow_lengths(); let (favorite_popup_cutoff, active_popup_cutoff) = self.panel_overflow_lengths();
@ -1588,7 +1580,7 @@ impl cosmic::Application for CosmicAppList {
// show star indicating pinned_list is drag target // show star indicating pinned_list is drag target
favorites.push( favorites.push(
container( container(
cosmic::widget::icon::from_name("starred-symbolic.symbolic") icon::from_name("starred-symbolic.symbolic")
.size(self.core.applet.suggested_size(false).0), .size(self.core.applet.suggested_size(false).0),
) )
.padding(self.core.applet.suggested_padding(false)) .padding(self.core.applet.suggested_padding(false))
@ -1728,7 +1720,7 @@ impl cosmic::Application for CosmicAppList {
vec![active] vec![active]
} else { } else {
vec![ vec![
cosmic::widget::icon::from_name("com.system76.CosmicAppList") icon::from_name("com.system76.CosmicAppList")
.size(self.core.applet.suggested_size(false).0) .size(self.core.applet.suggested_size(false).0)
.into(), .into(),
] ]

View file

@ -2,8 +2,8 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use i18n_embed::{ use i18n_embed::{
fluent::{fluent_language_loader, FluentLanguageLoader},
DefaultLocalizer, LanguageLoader, Localizer, 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

@ -29,6 +29,7 @@ use cctk::{
toplevel_info::{ToplevelInfoHandler, ToplevelInfoState}, toplevel_info::{ToplevelInfoHandler, ToplevelInfoState},
toplevel_management::{ToplevelManagerHandler, ToplevelManagerState}, toplevel_management::{ToplevelManagerHandler, ToplevelManagerState},
wayland_client::{ wayland_client::{
Connection, Dispatch, QueueHandle, WEnum,
globals::registry_queue_init, globals::registry_queue_init,
protocol::{ protocol::{
wl_buffer, wl_output, wl_buffer, wl_output,
@ -37,7 +38,6 @@ use cctk::{
wl_shm_pool, wl_shm_pool,
wl_surface::WlSurface, wl_surface::WlSurface,
}, },
Connection, Dispatch, QueueHandle, WEnum,
}, },
wayland_protocols::ext::{ wayland_protocols::ext::{
foreign_toplevel_list::v1::client::ext_foreign_toplevel_handle_v1::ExtForeignToplevelHandleV1, foreign_toplevel_list::v1::client::ext_foreign_toplevel_handle_v1::ExtForeignToplevelHandleV1,

View file

@ -12,14 +12,14 @@ use cctk::{
}, },
}; };
use cosmic::{ use cosmic::{
iced::{self, stream, Subscription}, iced::{self, Subscription, stream},
iced_core::image::Bytes, iced_core::image::Bytes,
}; };
use image::EncodableLayout; use image::EncodableLayout;
use futures::{ use futures::{
channel::mpsc::{unbounded, UnboundedReceiver},
SinkExt, StreamExt, SinkExt, StreamExt,
channel::mpsc::{UnboundedReceiver, unbounded},
}; };
use std::fmt::Debug; use std::fmt::Debug;
use std::sync::LazyLock; use std::sync::LazyLock;

View file

@ -1,12 +1,11 @@
[package] [package]
name = "cosmic-applet-a11y" name = "cosmic-applet-a11y"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2024"
[dependencies] [dependencies]
# cosmic-dbus-a11y = { git = "https://github.com/pop-os/dbus-settings-bindings" } # cosmic-dbus-a11y = { git = "https://github.com/pop-os/dbus-settings-bindings" }
cosmic-settings-subscriptions.workspace = true cosmic-settings-subscriptions.workspace = true
cosmic-settings-subscriptions.default_features = false
cosmic-settings-subscriptions.accessibility = true cosmic-settings-subscriptions.accessibility = true
cosmic-settings-subscriptions.cosmic_a11y_manager = true cosmic-settings-subscriptions.cosmic_a11y_manager = true
anyhow.workspace = true anyhow.workspace = true

View file

@ -7,28 +7,28 @@ use crate::{
}; };
use cctk::sctk::reexports::calloop; use cctk::sctk::reexports::calloop;
use cosmic::{ use cosmic::{
app, Element, Task, app,
applet::{ applet::{
menu_button, padded_control, menu_button, padded_control,
token::subscription::{activation_token_subscription, TokenRequest, TokenUpdate}, token::subscription::{TokenRequest, TokenUpdate, activation_token_subscription},
}, },
cctk::sctk::reexports::calloop::channel, cctk::sctk::reexports::calloop::channel,
cosmic_config::{self, CosmicConfigEntry}, cosmic_config::{self, CosmicConfigEntry},
cosmic_theme::{CosmicPalette, Spacing, ThemeBuilder}, cosmic_theme::{CosmicPalette, Spacing, ThemeBuilder},
iced::{ iced::{
Length, Subscription,
platform_specific::shell::wayland::commands::popup::{destroy_popup, get_popup}, platform_specific::shell::wayland::commands::popup::{destroy_popup, get_popup},
window, Length, Subscription, window,
}, },
surface, surface,
theme::{self, CosmicTheme}, theme::{self, CosmicTheme},
widget::{divider, text, Column}, widget::{Column, divider, text},
Element, Task,
}; };
use cosmic_settings_subscriptions::{ use cosmic_settings_subscriptions::{
accessibility::{self, DBusRequest, DBusUpdate}, accessibility::{self, DBusRequest, DBusUpdate},
cosmic_a11y_manager::{AccessibilityEvent, AccessibilityRequest, ColorFilter}, cosmic_a11y_manager::{AccessibilityEvent, AccessibilityRequest, ColorFilter},
}; };
use cosmic_time::{anim, chain, id, Instant, Timeline}; use cosmic_time::{Instant, Timeline, anim, chain, id};
use std::sync::LazyLock; use std::sync::LazyLock;
use tokio::sync::mpsc::UnboundedSender; use tokio::sync::mpsc::UnboundedSender;

View file

@ -4,9 +4,9 @@
use anyhow; use anyhow;
use cctk::sctk::reexports::calloop::{self, channel::SyncSender}; use cctk::sctk::reexports::calloop::{self, channel::SyncSender};
use cosmic::iced::{ use cosmic::iced::{
self, self, Subscription,
futures::{self, channel::mpsc, SinkExt, StreamExt}, futures::{self, SinkExt, StreamExt, channel::mpsc},
stream, Subscription, stream,
}; };
use cosmic_protocols::a11y::v1::client::cosmic_a11y_manager_v1::Filter; use cosmic_protocols::a11y::v1::client::cosmic_a11y_manager_v1::Filter;
use cosmic_settings_subscriptions::cosmic_a11y_manager::{ use cosmic_settings_subscriptions::cosmic_a11y_manager::{

View file

@ -2,8 +2,8 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use i18n_embed::{ use i18n_embed::{
fluent::{fluent_language_loader, FluentLanguageLoader},
DefaultLocalizer, LanguageLoader, Localizer, 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

@ -1,7 +1,7 @@
[package] [package]
name = "cosmic-applet-audio" name = "cosmic-applet-audio"
version = "0.1.1" version = "0.1.1"
edition = "2021" edition = "2024"
license = "GPL-3.0-only" license = "GPL-3.0-only"
[dependencies] [dependencies]

View file

@ -1,7 +1,7 @@
// 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::cosmic_config::{self, cosmic_config_derive::CosmicConfigEntry, CosmicConfigEntry}; use cosmic::cosmic_config::{self, CosmicConfigEntry, cosmic_config_derive::CosmicConfigEntry};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
#[derive(Default, Debug, Clone, Serialize, Deserialize, CosmicConfigEntry, PartialEq, Eq)] #[derive(Default, Debug, Clone, Serialize, Deserialize, CosmicConfigEntry, PartialEq, Eq)]

View file

@ -10,33 +10,29 @@ use std::time::Duration;
use crate::{localize::localize, pulse::DeviceInfo}; use crate::{localize::localize, pulse::DeviceInfo};
use config::AudioAppletConfig; use config::AudioAppletConfig;
use cosmic::{ use cosmic::{
app, Element, Renderer, Task, Theme, app,
applet::{ applet::{
cosmic_panel_config::PanelAnchor, cosmic_panel_config::PanelAnchor,
menu_button, menu_control_padding, padded_control, menu_button, menu_control_padding, padded_control,
token::subscription::{activation_token_subscription, TokenRequest, TokenUpdate}, token::subscription::{TokenRequest, TokenUpdate, activation_token_subscription},
}, },
cctk::sctk::reexports::calloop, cctk::sctk::reexports::calloop,
cosmic_config::CosmicConfigEntry, cosmic_config::CosmicConfigEntry,
cosmic_theme::Spacing, cosmic_theme::Spacing,
iced::{ iced::{
self, self, Alignment, Length, Subscription,
widget::{self, column, row, slider}, widget::{self, column, row, slider},
window, Alignment, Length, Limits, Subscription, window,
}, },
surface, theme, surface, theme,
widget::{button, divider, horizontal_space, icon, text, Column, Row}, widget::{Column, Row, button, container, divider, horizontal_space, icon, text},
Element, Renderer, Task, Theme,
}; };
use cosmic_settings_subscriptions::pulse as sub_pulse; use cosmic_settings_subscriptions::pulse as sub_pulse;
use cosmic_time::{anim, chain, id, Instant, Timeline}; use cosmic_time::{Instant, Timeline, anim, chain, id};
use iced::{ use iced::platform_specific::shell::wayland::commands::popup::{destroy_popup, get_popup};
platform_specific::shell::wayland::commands::popup::{destroy_popup, get_popup},
widget::container,
};
use libpulse_binding::volume::Volume; use libpulse_binding::volume::Volume;
use mpris2_zbus::player::PlaybackStatus;
use mpris_subscription::{MprisRequest, MprisUpdate}; use mpris_subscription::{MprisRequest, MprisUpdate};
use mpris2_zbus::player::PlaybackStatus;
mod config; mod config;
mod mpris_subscription; mod mpris_subscription;
@ -342,7 +338,7 @@ impl cosmic::Application for Audio {
self.popup.replace(new_id); self.popup.replace(new_id);
self.timeline = Timeline::new(); self.timeline = Timeline::new();
let mut popup_settings = self.core.applet.get_popup_settings( let popup_settings = self.core.applet.get_popup_settings(
self.core.main_window_id().unwrap(), self.core.main_window_id().unwrap(),
new_id, new_id,
None, None,

View file

@ -2,8 +2,8 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use i18n_embed::{ use i18n_embed::{
fluent::{fluent_language_loader, FluentLanguageLoader},
DefaultLocalizer, LanguageLoader, Localizer, 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

@ -4,10 +4,10 @@ use cosmic::iced::Vector;
use cosmic::iced_renderer::core::Point; use cosmic::iced_renderer::core::Point;
use cosmic::iced_core::{ use cosmic::iced_core::{
Clipboard, Element, Layout, Length, Rectangle, Shell, Size, Widget,
event::{self, Event}, event::{self, Event},
layout, mouse, overlay, renderer, touch, layout, mouse, overlay, renderer, touch,
widget::{tree, Operation, Tree}, widget::{Operation, Tree, tree},
Clipboard, Element, Layout, Length, Rectangle, Shell, Size, Widget,
}; };
/// Emit messages on mouse events. /// Emit messages on mouse events.

View file

@ -4,8 +4,8 @@
use std::{borrow::Cow, fmt::Debug, hash::Hash, path::PathBuf}; use std::{borrow::Cow, fmt::Debug, hash::Hash, path::PathBuf};
use cosmic::{ use cosmic::{
iced::{self, stream, Subscription}, iced::{self, Subscription, stream},
iced_futures::futures::{self, future::OptionFuture, SinkExt, StreamExt}, iced_futures::futures::{self, SinkExt, StreamExt, future::OptionFuture},
}; };
use mpris2_zbus::{ use mpris2_zbus::{
enumerator, enumerator,
@ -15,8 +15,8 @@ use mpris2_zbus::{
use tokio::join; use tokio::join;
use urlencoding::decode; use urlencoding::decode;
use zbus::{ use zbus::{
names::{BusName, OwnedBusName},
Connection, Connection,
names::{BusName, OwnedBusName},
}; };
#[derive(Clone, Debug)] #[derive(Clone, Debug)]

View file

@ -6,15 +6,15 @@ use std::{cell::RefCell, mem, rc::Rc, sync::LazyLock, thread, time::Duration};
extern crate libpulse_binding as pulse; extern crate libpulse_binding as pulse;
use cosmic::{ use cosmic::{
iced::{self, stream, Subscription}, iced::{self, Subscription, stream},
iced_futures::futures::{self, SinkExt}, iced_futures::futures::{self, SinkExt},
}; };
use libpulse_binding::{ use libpulse_binding::{
callbacks::ListResult, callbacks::ListResult,
context::{ context::{
introspect::{Introspector, SinkInfo, SourceInfo},
Context, Context,
introspect::{Introspector, SinkInfo, SourceInfo},
}, },
error::PAErr, error::PAErr,
mainloop::standard::{IterateResult, Mainloop}, mainloop::standard::{IterateResult, Mainloop},
@ -22,7 +22,7 @@ use libpulse_binding::{
volume::ChannelVolumes, volume::ChannelVolumes,
}; };
use tokio::sync::{mpsc, Mutex}; use tokio::sync::{Mutex, mpsc};
pub static FROM_PULSE: LazyLock<Mutex<Option<(mpsc::Receiver<Message>, mpsc::Sender<Message>)>>> = pub static FROM_PULSE: LazyLock<Mutex<Option<(mpsc::Receiver<Message>, mpsc::Sender<Message>)>>> =
LazyLock::new(|| Mutex::new(None)); LazyLock::new(|| Mutex::new(None));
@ -508,22 +508,22 @@ impl PulseServer {
match self.mainloop.borrow_mut().iterate(false) { match self.mainloop.borrow_mut().iterate(false) {
IterateResult::Success(_) => {} IterateResult::Success(_) => {}
IterateResult::Err(e) => { IterateResult::Err(e) => {
return Err(PulseServerError::IterateErr(IterateResult::Err(e))) return Err(PulseServerError::IterateErr(IterateResult::Err(e)));
} }
IterateResult::Quit(e) => { IterateResult::Quit(e) => {
return Err(PulseServerError::IterateErr(IterateResult::Quit(e))) return Err(PulseServerError::IterateErr(IterateResult::Quit(e)));
} }
} }
match self.context.borrow().get_state() { match self.context.borrow().get_state() {
pulse::context::State::Ready => break, pulse::context::State::Ready => break,
pulse::context::State::Failed => { pulse::context::State::Failed => {
return Err(PulseServerError::ContextErr(pulse::context::State::Failed)) return Err(PulseServerError::ContextErr(pulse::context::State::Failed));
} }
pulse::context::State::Terminated => { pulse::context::State::Terminated => {
return Err(PulseServerError::ContextErr( return Err(PulseServerError::ContextErr(
pulse::context::State::Terminated, pulse::context::State::Terminated,
)) ));
} }
_ => {} _ => {}
} }
@ -757,10 +757,10 @@ impl PulseServer {
loop { loop {
match self.mainloop.borrow_mut().iterate(false) { match self.mainloop.borrow_mut().iterate(false) {
IterateResult::Err(e) => { IterateResult::Err(e) => {
return Err(PulseServerError::IterateErr(IterateResult::Err(e))) return Err(PulseServerError::IterateErr(IterateResult::Err(e)));
} }
IterateResult::Quit(e) => { IterateResult::Quit(e) => {
return Err(PulseServerError::IterateErr(IterateResult::Quit(e))) return Err(PulseServerError::IterateErr(IterateResult::Quit(e)));
} }
IterateResult::Success(_) => {} IterateResult::Success(_) => {}
} }
@ -770,7 +770,7 @@ impl PulseServer {
pulse::operation::State::Cancelled => { pulse::operation::State::Cancelled => {
return Err(PulseServerError::OperationErr( return Err(PulseServerError::OperationErr(
pulse::operation::State::Cancelled, pulse::operation::State::Cancelled,
)) ));
} }
} }
} }

View file

@ -1,7 +1,7 @@
[package] [package]
name = "cosmic-applet-battery" name = "cosmic-applet-battery"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2024"
license = "GPL-3.0-only" license = "GPL-3.0-only"
[dependencies] [dependencies]

View file

@ -3,43 +3,42 @@
use crate::{ use crate::{
backend::{ backend::{
get_charging_limit, power_profile_subscription, set_charging_limit, Power, Power, PowerProfileRequest, PowerProfileUpdate, get_charging_limit,
PowerProfileRequest, PowerProfileUpdate, power_profile_subscription, set_charging_limit,
}, },
config, config,
dgpu::{dgpu_subscription, Entry, GpuUpdate}, dgpu::{Entry, GpuUpdate, dgpu_subscription},
fl, fl,
}; };
use cosmic::{ use cosmic::{
app, Element, Task, app,
applet::{ applet::{
cosmic_panel_config::PanelAnchor, cosmic_panel_config::PanelAnchor,
menu_button, padded_control, menu_button, padded_control,
token::subscription::{activation_token_subscription, TokenRequest, TokenUpdate}, token::subscription::{TokenRequest, TokenUpdate, activation_token_subscription},
}, },
cctk::sctk::reexports::calloop, cctk::sctk::reexports::calloop,
cosmic_theme::Spacing, cosmic_theme::Spacing,
iced::{ iced::{
Length, Subscription,
platform_specific::shell::wayland::commands::popup::{destroy_popup, get_popup}, platform_specific::shell::wayland::commands::popup::{destroy_popup, get_popup},
widget::{column, container, row, slider}, widget::{Column, Row, column, container, row},
window, Length, Subscription, window,
}, },
iced_core::{Alignment, Background, Border, Color, Shadow}, iced_core::{Alignment, Background, Border, Color, Shadow},
iced_widget::{Column, Row},
surface, theme, surface, theme,
widget::{divider, horizontal_space, icon, scrollable, text, vertical_space}, widget::{divider, horizontal_space, icon, scrollable, slider, text, vertical_space},
Element, Task,
}; };
use cosmic_settings_subscriptions::{ use cosmic_settings_subscriptions::{
settings_daemon, settings_daemon,
upower::{ upower::{
device::{device_subscription, DeviceDbusEvent}, device::{DeviceDbusEvent, device_subscription},
kbdbacklight::{ kbdbacklight::{
kbd_backlight_subscription, KeyboardBacklightRequest, KeyboardBacklightUpdate, KeyboardBacklightRequest, KeyboardBacklightUpdate, kbd_backlight_subscription,
}, },
}, },
}; };
use cosmic_time::{anim, chain, id, Instant, Timeline}; use cosmic_time::{Instant, Timeline, anim, chain, id};
use std::{collections::HashMap, path::PathBuf, sync::LazyLock, time::Duration}; use std::{collections::HashMap, path::PathBuf, sync::LazyLock, time::Duration};
use tokio::sync::mpsc::UnboundedSender; use tokio::sync::mpsc::UnboundedSender;

View file

@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use cosmic::{ use cosmic::{
iced::{self, futures::SinkExt, Subscription}, iced::{self, Subscription, futures::SinkExt},
iced_futures::stream, iced_futures::stream,
}; };
use std::{fmt::Debug, hash::Hash}; use std::{fmt::Debug, hash::Hash};

View file

@ -2,8 +2,8 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use i18n_embed::{ use i18n_embed::{
fluent::{fluent_language_loader, FluentLanguageLoader},
DefaultLocalizer, LanguageLoader, Localizer, 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

@ -1,7 +1,7 @@
[package] [package]
name = "cosmic-applet-bluetooth" name = "cosmic-applet-bluetooth"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2024"
license = "GPL-3.0-only" license = "GPL-3.0-only"
[dependencies] [dependencies]

View file

@ -1,35 +1,34 @@
// 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 crate::bluetooth::{set_tick, BluerDeviceStatus, BluerRequest, BluerState, DeviceProperty}; use crate::bluetooth::{BluerDeviceStatus, BluerRequest, BluerState, set_tick};
use cosmic::{ use cosmic::{
app, app,
applet::token::subscription::{activation_token_subscription, TokenRequest, TokenUpdate}, applet::token::subscription::{TokenRequest, TokenUpdate, activation_token_subscription},
cctk::sctk::reexports::calloop, cctk::sctk::reexports::calloop,
surface, surface,
}; };
use cosmic::{ use cosmic::{
Element, Task,
applet::{menu_button, padded_control}, applet::{menu_button, padded_control},
cosmic_theme::Spacing, cosmic_theme::Spacing,
iced::{ iced::{
self, self, Alignment, Length, Subscription,
platform_specific::shell::wayland::commands::popup::{destroy_popup, get_popup}, platform_specific::shell::wayland::commands::popup::{destroy_popup, get_popup},
widget::{column, container, row, scrollable, Column}, widget::{Column, column, container, row},
Alignment, Length, Subscription,
}, },
iced_runtime::core::{layout::Limits, window}, iced_runtime::core::window,
theme, theme,
widget::{button, divider, icon, text}, widget::{button, divider, icon, scrollable, text},
Element, Task,
}; };
use cosmic_time::{anim, chain, id, Instant, Timeline}; use cosmic_time::{Instant, Timeline, anim, chain, id};
use futures::FutureExt; use futures::FutureExt;
use std::{collections::HashMap, sync::LazyLock, time::Duration}; use std::{collections::HashMap, sync::LazyLock, time::Duration};
use tokio::sync::mpsc::Sender; use tokio::sync::mpsc::Sender;
use crate::{ use crate::{
bluetooth::{bluetooth_subscription, BluerDevice, BluerEvent}, bluetooth::{BluerDevice, BluerEvent, bluetooth_subscription},
config, fl, config, fl,
}; };

View file

@ -10,28 +10,26 @@ use std::{
time::Duration, time::Duration,
}; };
pub use bluer::DeviceProperty;
use bluer::{ use bluer::{
agent::{Agent, AgentHandle},
Adapter, Address, Session, Uuid, Adapter, Address, Session, Uuid,
agent::{Agent, AgentHandle},
}; };
use cosmic::{ use cosmic::{
iced::{ iced::{
self, self, Subscription,
futures::{SinkExt, StreamExt}, futures::{SinkExt, StreamExt},
Subscription,
}, },
iced_futures::stream, iced_futures::stream,
}; };
use futures::{stream::FuturesUnordered, FutureExt}; use futures::{FutureExt, stream::FuturesUnordered};
use rand::Rng; use rand::Rng;
use tokio::{ use tokio::{
spawn, spawn,
sync::{ sync::{
mpsc::{channel, Receiver, Sender},
Mutex, RwLock, Mutex, RwLock,
mpsc::{Receiver, Sender, channel},
}, },
task::JoinHandle, task::JoinHandle,
}; };

View file

@ -2,8 +2,8 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use i18n_embed::{ use i18n_embed::{
fluent::{fluent_language_loader, FluentLanguageLoader},
DefaultLocalizer, LanguageLoader, Localizer, 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

@ -1,7 +1,7 @@
[package] [package]
name = "cosmic-applet-input-sources" name = "cosmic-applet-input-sources"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2024"
license = "GPL-3.0-only" license = "GPL-3.0-only"
[dependencies] [dependencies]

View file

@ -11,13 +11,13 @@ use cosmic::{
cosmic_config::{self, ConfigSet, CosmicConfigEntry}, cosmic_config::{self, ConfigSet, CosmicConfigEntry},
cosmic_theme::Spacing, cosmic_theme::Spacing,
iced::{ iced::{
Task,
platform_specific::shell::commands::popup::{destroy_popup, get_popup}, platform_specific::shell::commands::popup::{destroy_popup, get_popup},
widget::{column, row}, widget::{column, row},
window::Id, window::Id,
Limits, Task,
}, },
iced_futures::Subscription, iced_futures::Subscription,
iced_runtime::{core::window, Appearance}, iced_runtime::{Appearance, core::window},
prelude::*, prelude::*,
surface, theme, surface, theme,
widget::{self, horizontal_space, vertical_space}, widget::{self, horizontal_space, vertical_space},
@ -135,7 +135,7 @@ impl cosmic::Application for Window {
} else { } else {
let new_id = Id::unique(); let new_id = Id::unique();
self.popup.replace(new_id); self.popup.replace(new_id);
let mut popup_settings = self.core.applet.get_popup_settings( let popup_settings = self.core.applet.get_popup_settings(
self.core.main_window_id().unwrap(), self.core.main_window_id().unwrap(),
new_id, new_id,
None, None,

View file

@ -2,8 +2,8 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use i18n_embed::{ use i18n_embed::{
fluent::{fluent_language_loader, FluentLanguageLoader},
DefaultLocalizer, LanguageLoader, Localizer, DefaultLocalizer, LanguageLoader, Localizer,
fluent::{FluentLanguageLoader, fluent_language_loader},
}; };
use rust_embed::RustEmbed; use rust_embed::RustEmbed;

View file

@ -1,7 +1,7 @@
[package] [package]
name = "cosmic-applet-minimize" name = "cosmic-applet-minimize"
version = "0.1.1" version = "0.1.1"
edition = "2021" edition = "2024"
license = "GPL-3.0-only" license = "GPL-3.0-only"
[dependencies] [dependencies]

View file

@ -10,7 +10,7 @@ use std::borrow::Cow;
use crate::localize::localize; use crate::localize::localize;
use cosmic::{ use cosmic::{
app, Task, app,
applet::cosmic_panel_config::PanelAnchor, applet::cosmic_panel_config::PanelAnchor,
cctk::{ cctk::{
sctk::reexports::calloop, toplevel_info::ToplevelInfo, sctk::reexports::calloop, toplevel_info::ToplevelInfo,
@ -18,21 +18,19 @@ use cosmic::{
}, },
desktop::fde, desktop::fde,
iced::{ iced::{
self, self, Length, Limits, Subscription,
id::Id as WidgetId, id::Id as WidgetId,
platform_specific::shell::wayland::commands::popup::{destroy_popup, get_popup}, platform_specific::shell::wayland::commands::popup::{destroy_popup, get_popup},
widget::text, widget::text,
window::{self}, window::{self},
Length, Limits, Subscription,
}, },
surface, surface,
widget::{autosize::autosize, mouse_area}, widget::{autosize::autosize, mouse_area},
Task,
}; };
use cosmic::iced_widget::{Column, Row}; use cosmic::iced_widget::{Column, Row};
use cosmic::{widget::tooltip, Element}; use cosmic::{Element, widget::tooltip};
use std::sync::LazyLock; use std::sync::LazyLock;
use wayland_subscription::{ use wayland_subscription::{
ToplevelRequest, ToplevelUpdate, WaylandImage, WaylandRequest, WaylandUpdate, ToplevelRequest, ToplevelUpdate, WaylandImage, WaylandRequest, WaylandUpdate,

View file

@ -2,8 +2,8 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use i18n_embed::{ use i18n_embed::{
fluent::{fluent_language_loader, FluentLanguageLoader},
DefaultLocalizer, LanguageLoader, Localizer, 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

@ -20,7 +20,7 @@ use cctk::{
}, },
toplevel_info::{ToplevelInfoHandler, ToplevelInfoState}, toplevel_info::{ToplevelInfoHandler, ToplevelInfoState},
toplevel_management::{ToplevelManagerHandler, ToplevelManagerState}, toplevel_management::{ToplevelManagerHandler, ToplevelManagerState},
wayland_client::{self, protocol::wl_seat::WlSeat, WEnum}, wayland_client::{self, WEnum, protocol::wl_seat::WlSeat},
}; };
use cosmic::{ use cosmic::{
cctk::{ cctk::{
@ -35,12 +35,12 @@ use cosmic::{
}, },
sctk::shm::{Shm, ShmHandler}, sctk::shm::{Shm, ShmHandler},
wayland_client::{ wayland_client::{
Dispatch,
protocol::{ protocol::{
wl_buffer, wl_buffer,
wl_shm::{self, WlShm}, wl_shm::{self, WlShm},
wl_shm_pool, wl_shm_pool,
}, },
Dispatch,
}, },
wayland_protocols::ext::foreign_toplevel_list::v1::client::ext_foreign_toplevel_handle_v1::ExtForeignToplevelHandleV1, wayland_protocols::ext::foreign_toplevel_list::v1::client::ext_foreign_toplevel_handle_v1::ExtForeignToplevelHandleV1,
}, },
@ -50,9 +50,9 @@ use cosmic_protocols::{
toplevel_info::v1::client::zcosmic_toplevel_handle_v1, toplevel_info::v1::client::zcosmic_toplevel_handle_v1,
toplevel_management::v1::client::zcosmic_toplevel_manager_v1, toplevel_management::v1::client::zcosmic_toplevel_manager_v1,
}; };
use futures::{channel::mpsc, SinkExt}; use futures::{SinkExt, channel::mpsc};
use sctk::registry::{ProvidesRegistryState, RegistryState}; use sctk::registry::{ProvidesRegistryState, RegistryState};
use wayland_client::{globals::registry_queue_init, Connection, QueueHandle}; use wayland_client::{Connection, QueueHandle, globals::registry_queue_init};
#[derive(Default)] #[derive(Default)]
struct SessionInner { struct SessionInner {

View file

@ -2,12 +2,12 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use cosmic::{ use cosmic::{
desktop::{fde, IconSourceExt},
iced::Limits,
iced_core::{layout, overlay, widget::Tree, Border, Layout, Length, Size, Vector},
theme::{Button, Container},
widget::{button, container, image::Handle, Image, Widget},
Element, Element,
desktop::{IconSourceExt, fde},
iced::Limits,
iced_core::{Border, Layout, Length, Size, Vector, layout, overlay, widget::Tree},
theme::{Button, Container},
widget::{Image, Widget, button, container, image::Handle},
}; };
use crate::wayland_subscription::WaylandImage; use crate::wayland_subscription::WaylandImage;

View file

@ -1,7 +1,7 @@
[package] [package]
name = "cosmic-applet-network" name = "cosmic-applet-network"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2024"
license = "GPL-3.0-or-later" license = "GPL-3.0-or-later"
[dependencies] [dependencies]

View file

@ -2,32 +2,30 @@ use std::collections::HashSet;
use std::sync::LazyLock; use std::sync::LazyLock;
use cosmic::{ use cosmic::{
app, Element, Task, app,
applet::{ applet::{
menu_button, menu_control_padding, padded_control, menu_button, menu_control_padding, padded_control,
token::subscription::{activation_token_subscription, TokenRequest, TokenUpdate}, token::subscription::{TokenRequest, TokenUpdate, activation_token_subscription},
}, },
cctk::sctk::reexports::calloop, cctk::sctk::reexports::calloop,
cosmic_theme::Spacing, cosmic_theme::Spacing,
iced::{ iced::{
Alignment, Length, Subscription,
platform_specific::shell::wayland::commands::popup::{destroy_popup, get_popup}, platform_specific::shell::wayland::commands::popup::{destroy_popup, get_popup},
widget::{column, row}, widget::{column, row},
Alignment, Length, Subscription,
}, },
iced_runtime::core::{layout::Limits, window}, iced_runtime::core::window,
iced_widget::Row,
surface, theme, surface, theme,
widget::{ widget::{
button, container, divider, Column, Row, button, container, divider,
icon::{self, from_name}, icon::{self, from_name},
scrollable, text, text_input, Column, scrollable, text, text_input,
}, },
Element, Task,
}; };
use cosmic_dbus_networkmanager::interface::enums::{ use cosmic_dbus_networkmanager::interface::enums::{
ActiveConnectionState, DeviceState, NmConnectivityState, ActiveConnectionState, DeviceState, NmConnectivityState,
}; };
use cosmic_time::{anim, chain, id, Instant, Timeline}; use cosmic_time::{Instant, Timeline, anim, chain, id};
use futures::channel::mpsc::UnboundedSender; use futures::channel::mpsc::UnboundedSender;
use zbus::Connection; use zbus::Connection;
@ -35,6 +33,7 @@ use zbus::Connection;
use crate::{ use crate::{
config, fl, config, fl,
network_manager::{ network_manager::{
NetworkManagerEvent, NetworkManagerRequest, NetworkManagerState,
active_conns::active_conns_subscription, active_conns::active_conns_subscription,
available_wifi::{AccessPoint, NetworkType}, available_wifi::{AccessPoint, NetworkType},
current_networks::ActiveConnectionInfo, current_networks::ActiveConnectionInfo,
@ -42,7 +41,6 @@ use crate::{
hw_address::HwAddress, hw_address::HwAddress,
network_manager_subscription, network_manager_subscription,
wireless_enabled::wireless_enabled_subscription, wireless_enabled::wireless_enabled_subscription,
NetworkManagerEvent, NetworkManagerRequest, NetworkManagerState,
}, },
}; };
@ -290,7 +288,7 @@ impl cosmic::Application for CosmicNetworkApplet {
self.popup.replace(new_id); self.popup.replace(new_id);
self.timeline = Timeline::new(); self.timeline = Timeline::new();
let mut popup_settings = self.core.applet.get_popup_settings( let popup_settings = self.core.applet.get_popup_settings(
self.core.main_window_id().unwrap(), self.core.main_window_id().unwrap(),
new_id, new_id,
None, None,
@ -759,12 +757,14 @@ impl cosmic::Application for CosmicNetworkApplet {
} }
known_wifi.push(Element::from( known_wifi.push(Element::from(
column![menu_button( column![
Row::with_children(btn_content) menu_button(
.align_y(Alignment::Center) Row::with_children(btn_content)
.spacing(8) .align_y(Alignment::Center)
) .spacing(8)
.on_press(Message::Disconnect(name.clone(), *hw_address))] )
.on_press(Message::Disconnect(name.clone(), *hw_address))
]
.align_x(Alignment::Center), .align_x(Alignment::Center),
)); ));
} }
@ -871,12 +871,14 @@ impl cosmic::Application for CosmicNetworkApplet {
.active_conns .active_conns
.iter() .iter()
.any(|conn| conn.hw_address() == hw_device); .any(|conn| conn.hw_address() == hw_device);
let mut btn_content = vec![column![ let mut btn_content = vec![
text::body(display_name), column![
Column::with_children(vec![text("Adapter").size(10).into()]) text::body(display_name),
] Column::with_children(vec![text("Adapter").size(10).into()])
.width(Length::Fill) ]
.into()]; .width(Length::Fill)
.into(),
];
if is_connected { if is_connected {
btn_content.push( btn_content.push(
text::body(fl!("connected")) text::body(fl!("connected"))

View file

@ -1,8 +1,8 @@
// SPDX-License-Identifier: MPL-2.0-only // SPDX-License-Identifier: MPL-2.0-only
use i18n_embed::{ use i18n_embed::{
fluent::{fluent_language_loader, FluentLanguageLoader},
DefaultLocalizer, LanguageLoader, Localizer, 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

@ -1,5 +1,5 @@
use super::{NetworkManagerEvent, NetworkManagerState}; use super::{NetworkManagerEvent, NetworkManagerState};
use cosmic::iced::{self, stream, Subscription}; use cosmic::iced::{self, Subscription, stream};
use cosmic_dbus_networkmanager::nm::NetworkManager; use cosmic_dbus_networkmanager::nm::NetworkManager;
use futures::{SinkExt, StreamExt}; use futures::{SinkExt, StreamExt};
use std::{fmt::Debug, hash::Hash}; use std::{fmt::Debug, hash::Hash};

View file

@ -20,22 +20,22 @@ use cosmic_dbus_networkmanager::{
enums::{self, ActiveConnectionState, DeviceType, NmConnectivityState}, enums::{self, ActiveConnectionState, DeviceType, NmConnectivityState},
}, },
nm::NetworkManager, nm::NetworkManager,
settings::{connection::Settings, NetworkManagerSettings}, settings::{NetworkManagerSettings, connection::Settings},
}; };
use futures::{ use futures::{
channel::mpsc::{unbounded, UnboundedReceiver, UnboundedSender},
SinkExt, StreamExt, SinkExt, StreamExt,
channel::mpsc::{UnboundedReceiver, UnboundedSender, unbounded},
}; };
use hw_address::HwAddress; use hw_address::HwAddress;
use tokio::process::Command; use tokio::process::Command;
use zbus::{ use zbus::{
zvariant::{self, Value},
Connection, Connection,
zvariant::{self, Value},
}; };
use self::{ use self::{
available_wifi::{handle_wireless_device, AccessPoint}, available_wifi::{AccessPoint, handle_wireless_device},
current_networks::{active_connections, ActiveConnectionInfo}, current_networks::{ActiveConnectionInfo, active_connections},
}; };
// In some distros, rfkill is only in sbin, which isn't normally in PATH // In some distros, rfkill is only in sbin, which isn't normally in PATH

View file

@ -1,7 +1,7 @@
[package] [package]
name = "cosmic-applet-notifications" name = "cosmic-applet-notifications"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2024"
license = "GPL-3.0-only" license = "GPL-3.0-only"
[dependencies] [dependencies]
@ -13,7 +13,7 @@ cosmic-notifications-util = { git = "https://github.com/pop-os/cosmic-notificati
cosmic-notifications-config = { git = "https://github.com/pop-os/cosmic-notifications" } cosmic-notifications-config = { git = "https://github.com/pop-os/cosmic-notifications" }
# cosmic-notifications-util = { path = "../../cosmic-notifications-daemon/cosmic-notifications-util" } # cosmic-notifications-util = { path = "../../cosmic-notifications-daemon/cosmic-notifications-util" }
# cosmic-notifications-config = { path = "../../cosmic-notifications-daemon/cosmic-notifications-config" } # cosmic-notifications-config = { path = "../../cosmic-notifications-daemon/cosmic-notifications-config" }
futures-util = { version = "0.3", feature = ["sink", "stream"] } futures-util = { version = "0.3", features = ["sink"] }
tracing = "0.1" tracing = "0.1"
ron = "0.8" ron = "0.8"
sendfd = { version = "0.4", features = ["tokio"] } sendfd = { version = "0.4", features = ["tokio"] }

View file

@ -4,30 +4,29 @@
mod localize; mod localize;
mod subscriptions; mod subscriptions;
use cosmic::{ use cosmic::{
app, Element, Task, app,
applet::{ applet::{
menu_control_padding, padded_control, menu_control_padding, padded_control,
token::subscription::{activation_token_subscription, TokenRequest, TokenUpdate}, token::subscription::{TokenRequest, TokenUpdate, activation_token_subscription},
}, },
cctk::sctk::reexports::calloop, cctk::sctk::reexports::calloop,
cosmic_config::{Config, CosmicConfigEntry}, cosmic_config::{Config, CosmicConfigEntry},
cosmic_theme::Spacing, cosmic_theme::Spacing,
iced::{ iced::{
Alignment, Length, Subscription,
platform_specific::shell::wayland::commands::popup::{destroy_popup, get_popup}, platform_specific::shell::wayland::commands::popup::{destroy_popup, get_popup},
widget::{column, row}, widget::{column, row},
window, Alignment, Length, Limits, Subscription, window,
}, },
iced_widget::{scrollable, Column},
surface, theme, surface, theme,
widget::{button, container, divider, icon, text}, widget::{Column, button, container, divider, icon, scrollable, text},
Element, Task,
}; };
use cosmic::iced_futures::futures::executor::block_on; use cosmic::iced_futures::futures::executor::block_on;
use cosmic_notifications_config::NotificationsConfig; use cosmic_notifications_config::NotificationsConfig;
use cosmic_notifications_util::{ActionId, Image, Notification}; use cosmic_notifications_util::{ActionId, Image, Notification};
use cosmic_time::{anim, chain, id, Instant, Timeline}; use cosmic_time::{Instant, Timeline, anim, chain, id};
use std::{borrow::Cow, collections::HashMap, path::PathBuf, sync::LazyLock}; use std::{borrow::Cow, collections::HashMap, path::PathBuf, sync::LazyLock};
use subscriptions::notifications::{self, NotificationsAppletProxy}; use subscriptions::notifications::{self, NotificationsAppletProxy};
use tokio::sync::mpsc::Sender; use tokio::sync::mpsc::Sender;
@ -185,7 +184,7 @@ impl cosmic::Application for Notifications {
self.popup.replace(new_id); self.popup.replace(new_id);
self.timeline = Timeline::new(); self.timeline = Timeline::new();
let mut popup_settings = self.core.applet.get_popup_settings( let popup_settings = self.core.applet.get_popup_settings(
self.core.main_window_id().unwrap(), self.core.main_window_id().unwrap(),
new_id, new_id,
None, None,
@ -411,26 +410,30 @@ impl cosmic::Application for Notifications {
space_xxs, space_s, .. space_xxs, space_s, ..
} = theme::active().cosmic().spacing; } = theme::active().cosmic().spacing;
let do_not_disturb = padded_control(row![anim!( let do_not_disturb = padded_control(row![
DO_NOT_DISTURB, anim!(
&self.timeline, DO_NOT_DISTURB,
fl!("do-not-disturb"), &self.timeline,
self.config.do_not_disturb, fl!("do-not-disturb"),
Message::DoNotDisturb self.config.do_not_disturb,
) Message::DoNotDisturb
.text_size(14) )
.width(Length::Fill)]); .text_size(14)
.width(Length::Fill)
]);
let notifications = if self.cards.is_empty() { let notifications = if self.cards.is_empty() {
let no_notifications = String::from(fl!("no-notifications")); let no_notifications = String::from(fl!("no-notifications"));
row![container( row![
column![ container(
text_icon("cosmic-applet-notification-symbolic", 40), column![
text::body(no_notifications) text_icon("cosmic-applet-notification-symbolic", 40),
] text::body(no_notifications)
.align_x(Alignment::Center) ]
) .align_x(Alignment::Center)
.center_x(Length::Fill)] )
.center_x(Length::Fill)
]
.padding([8, 0]) .padding([8, 0])
.spacing(12) .spacing(12)
} else { } else {
@ -581,12 +584,14 @@ impl cosmic::Application for Notifications {
notifs.push(card_list.into()); notifs.push(card_list.into());
} }
row!(scrollable( row!(
Column::with_children(notifs) scrollable(
.spacing(8) Column::with_children(notifs)
.height(Length::Shrink), .spacing(8)
.height(Length::Shrink),
)
.height(Length::Shrink)
) )
.height(Length::Shrink))
.padding(menu_control_padding()) .padding(menu_control_padding())
}; };

View file

@ -2,8 +2,8 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use i18n_embed::{ use i18n_embed::{
fluent::{fluent_language_loader, FluentLanguageLoader},
DefaultLocalizer, LanguageLoader, Localizer, 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

@ -4,10 +4,10 @@
use crate::subscriptions::freedesktop_proxy::NotificationsProxy; use crate::subscriptions::freedesktop_proxy::NotificationsProxy;
use cosmic::{ use cosmic::{
iced::futures::{self, SinkExt}, iced::futures::{self, SinkExt},
iced_futures::{stream, Subscription}, iced_futures::{Subscription, stream},
}; };
use futures_util::StreamExt; use futures_util::StreamExt;
use tokio::sync::mpsc::{channel, Receiver, Sender}; use tokio::sync::mpsc::{Receiver, Sender, channel};
use tracing::{error, warn}; use tracing::{error, warn};
use zbus::Connection; use zbus::Connection;

View file

@ -12,7 +12,6 @@ use cosmic_notifications_util::Notification;
use futures_util::{SinkExt, StreamExt}; use futures_util::{SinkExt, StreamExt};
use std::{ use std::{
collections::HashMap, collections::HashMap,
future::pending,
os::unix::io::{FromRawFd, RawFd}, os::unix::io::{FromRawFd, RawFd},
pin::pin, pin::pin,
}; };

View file

@ -1,7 +1,7 @@
[package] [package]
name = "cosmic-applet-power" name = "cosmic-applet-power"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2024"
license = "GPL-3.0-only" license = "GPL-3.0-only"
[dependencies] [dependencies]

View file

@ -1,26 +1,18 @@
// 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::cell::LazyCell;
use cosmic::{ use cosmic::{
app, Element, Task, app,
applet::{menu_button, padded_control}, applet::{menu_button, padded_control},
cctk::wayland_protocols::xdg::shell::client::xdg_positioner::Gravity,
cosmic_theme::Spacing, cosmic_theme::Spacing,
iced::{ iced::{
self, self, Alignment, Length,
platform_specific::{ platform_specific::shell::commands::popup::{destroy_popup, get_popup},
runtime::wayland::subsurface,
shell::commands::popup::{destroy_popup, get_popup},
},
widget::{self, column, row}, widget::{self, column, row},
window, Alignment, Length, window,
}, },
iced_runtime::core::layout::Limits,
surface, theme, surface, theme,
widget::{autosize, button, divider, icon, layer_container::layer_container, text, Space}, widget::{Space, button, divider, icon, text},
Element, Task,
}; };
use std::sync::LazyLock; use std::sync::LazyLock;
@ -126,7 +118,7 @@ impl cosmic::Application for Power {
let new_id = window::Id::unique(); let new_id = window::Id::unique();
self.popup.replace(new_id); self.popup.replace(new_id);
let mut popup_settings = self.core.applet.get_popup_settings( let popup_settings = self.core.applet.get_popup_settings(
self.core.main_window_id().unwrap(), self.core.main_window_id().unwrap(),
new_id, new_id,
None, None,

View file

@ -2,8 +2,8 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use i18n_embed::{ use i18n_embed::{
fluent::{fluent_language_loader, FluentLanguageLoader},
DefaultLocalizer, LanguageLoader, Localizer, 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

@ -1,7 +1,7 @@
[package] [package]
name = "cosmic-applet-status-area" name = "cosmic-applet-status-area"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2024"
license = "GPL-3.0-only" license = "GPL-3.0-only"
[dependencies] [dependencies]

View file

@ -2,22 +2,19 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use cosmic::{ use cosmic::{
app, Element, Task, app,
applet::cosmic_panel_config::PanelAnchor, applet::cosmic_panel_config::PanelAnchor,
applet::token::subscription::{activation_token_subscription, TokenRequest, TokenUpdate}, applet::token::subscription::{TokenRequest, TokenUpdate, activation_token_subscription},
cctk::sctk::reexports::calloop, cctk::sctk::reexports::calloop,
iced::{ iced::{
self, self, Subscription,
overlay::menu,
platform_specific::shell::commands::popup::{destroy_popup, get_popup}, platform_specific::shell::commands::popup::{destroy_popup, get_popup},
window, Limits, Padding, Subscription, window,
}, },
surface, surface,
widget::{container, mouse_area}, widget::{container, mouse_area},
Element, Task,
}; };
use std::collections::BTreeMap; use std::collections::BTreeMap;
use zbus::connection::socket::channel;
use crate::{components::status_menu, subscriptions::status_notifier_watcher}; use crate::{components::status_menu, subscriptions::status_notifier_watcher};

View file

@ -2,14 +2,11 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use cosmic::{ use cosmic::{
applet::{ Application,
menu_button, applet::{menu_button, token::subscription::TokenRequest},
token::{self, subscription::TokenRequest},
},
cctk::sctk::reexports::calloop, cctk::sctk::reexports::calloop,
iced, iced,
widget::icon, widget::icon,
Application,
}; };
use crate::subscriptions::status_notifier_item::{IconUpdate, Layout, StatusNotifierItem}; use crate::subscriptions::status_notifier_item::{IconUpdate, Layout, StatusNotifierItem};

View file

@ -1,10 +1,7 @@
// 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::{self, Subscription};
iced::{self, Subscription},
widget::icon,
};
use futures::{FutureExt, StreamExt}; use futures::{FutureExt, StreamExt};
use std::collections::HashMap; use std::collections::HashMap;
use zbus::zvariant::{self, OwnedValue}; use zbus::zvariant::{self, OwnedValue};
@ -255,7 +252,7 @@ pub trait DBusMenu {
) -> zbus::Result<(u32, Layout)>; ) -> zbus::Result<(u32, Layout)>;
fn event(&self, id: i32, event_id: &str, data: &OwnedValue, timestamp: u32) fn event(&self, id: i32, event_id: &str, data: &OwnedValue, timestamp: u32)
-> zbus::Result<()>; -> zbus::Result<()>;
fn about_to_show(&self, id: i32) -> zbus::Result<bool>; fn about_to_show(&self, id: i32) -> zbus::Result<bool>;

View file

@ -4,7 +4,7 @@
// TODO: Both this and server proxy could emit same events, have way to generate stream from either? // TODO: Both this and server proxy could emit same events, have way to generate stream from either?
use cosmic::iced::{self, Subscription}; use cosmic::iced::{self, Subscription};
use futures::{stream, StreamExt}; use futures::{StreamExt, stream};
use crate::subscriptions::status_notifier_item::StatusNotifierItem; use crate::subscriptions::status_notifier_item::StatusNotifierItem;

View file

@ -7,11 +7,11 @@
use futures::prelude::*; use futures::prelude::*;
use zbus::{ use zbus::{
Result,
fdo::{DBusProxy, RequestNameFlags, RequestNameReply}, fdo::{DBusProxy, RequestNameFlags, RequestNameReply},
message::Header, message::Header,
names::{BusName, UniqueName, WellKnownName}, names::{BusName, UniqueName, WellKnownName},
object_server::SignalEmitter, object_server::SignalEmitter,
Result,
}; };
const NAME: WellKnownName = const NAME: WellKnownName =
@ -65,7 +65,7 @@ impl StatusNotifierWatcher {
#[zbus(signal)] #[zbus(signal)]
async fn status_notifier_item_registered(ctxt: &SignalEmitter<'_>, service: &str) async fn status_notifier_item_registered(ctxt: &SignalEmitter<'_>, service: &str)
-> Result<()>; -> Result<()>;
#[zbus(signal)] #[zbus(signal)]
async fn status_notifier_item_unregistered( async fn status_notifier_item_unregistered(

View file

@ -1,7 +1,7 @@
[package] [package]
name = "cosmic-applet-tiling" name = "cosmic-applet-tiling"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2024"
license = "GPL-3.0-only" license = "GPL-3.0-only"
[dependencies] [dependencies]

View file

@ -2,8 +2,8 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use i18n_embed::{ use i18n_embed::{
fluent::{fluent_language_loader, FluentLanguageLoader},
DefaultLocalizer, LanguageLoader, Localizer, 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

@ -19,7 +19,7 @@ use cctk::{
}; };
use cosmic::iced::futures; use cosmic::iced::futures;
use cosmic_protocols::workspace::v2::client::zcosmic_workspace_handle_v2::TilingState; use cosmic_protocols::workspace::v2::client::zcosmic_workspace_handle_v2::TilingState;
use futures::{channel::mpsc, executor::block_on, SinkExt}; use futures::{SinkExt, channel::mpsc, executor::block_on};
use std::{ use std::{
collections::HashSet, collections::HashSet,
os::{ os::{
@ -29,9 +29,9 @@ use std::{
}; };
use tracing::error; use tracing::error;
use wayland_client::{ use wayland_client::{
Connection, QueueHandle,
globals::registry_queue_init, globals::registry_queue_init,
protocol::wl_output::{self, WlOutput}, protocol::wl_output::{self, WlOutput},
Connection, QueueHandle,
}; };
#[derive(Debug, Clone)] #[derive(Debug, Clone)]

View file

@ -4,9 +4,9 @@
use crate::wayland::{self, AppRequest}; use crate::wayland::{self, AppRequest};
use cctk::sctk::reexports::calloop::channel::SyncSender; use cctk::sctk::reexports::calloop::channel::SyncSender;
use cosmic::iced::{ use cosmic::iced::{
self, self, Subscription,
futures::{self, channel::mpsc, SinkExt, StreamExt}, futures::{self, SinkExt, StreamExt, channel::mpsc},
stream, Subscription, stream,
}; };
use cosmic_protocols::workspace::v2::client::zcosmic_workspace_handle_v2::TilingState; use cosmic_protocols::workspace::v2::client::zcosmic_workspace_handle_v2::TilingState;
use std::sync::LazyLock; use std::sync::LazyLock;

View file

@ -6,15 +6,15 @@ use crate::{
}; };
use cctk::sctk::reexports::calloop::channel::SyncSender; use cctk::sctk::reexports::calloop::channel::SyncSender;
use cosmic::{ use cosmic::{
app, Element, Task, app,
app::Core, app::Core,
applet::{menu_button, padded_control}, applet::{menu_button, padded_control},
cosmic_config::{Config, ConfigSet, CosmicConfigEntry}, cosmic_config::{Config, ConfigSet, CosmicConfigEntry},
cosmic_theme::Spacing, cosmic_theme::Spacing,
iced::{ iced::{
Length, Subscription,
platform_specific::shell::wayland::commands::popup::{destroy_popup, get_popup}, platform_specific::shell::wayland::commands::popup::{destroy_popup, get_popup},
window::Id, window::Id,
Length, Limits, Subscription,
}, },
iced_widget::{column, row}, iced_widget::{column, row},
surface, theme, surface, theme,
@ -23,11 +23,10 @@ use cosmic::{
segmented_button::{self, Entity, SingleSelectModel}, segmented_button::{self, Entity, SingleSelectModel},
segmented_control, text, segmented_control, text,
}, },
Element, Task,
}; };
use cosmic_comp_config::{CosmicCompConfig, TileBehavior}; use cosmic_comp_config::{CosmicCompConfig, TileBehavior};
use cosmic_protocols::workspace::v2::client::zcosmic_workspace_handle_v2::TilingState; use cosmic_protocols::workspace::v2::client::zcosmic_workspace_handle_v2::TilingState;
use cosmic_time::{anim, chain, id, Timeline}; use cosmic_time::{Timeline, anim, chain, id};
use std::{thread, time::Instant}; use std::{thread, time::Instant};
use tracing::error; use tracing::error;
@ -173,7 +172,7 @@ impl cosmic::Application for Window {
self.active_hint = id::Toggler::unique(); self.active_hint = id::Toggler::unique();
let new_id = Id::unique(); let new_id = Id::unique();
self.popup = Some(new_id); self.popup = Some(new_id);
let mut popup_settings = self.core.applet.get_popup_settings( let popup_settings = self.core.applet.get_popup_settings(
self.core.main_window_id().unwrap(), self.core.main_window_id().unwrap(),
new_id, new_id,
Some((1, 1)), Some((1, 1)),
@ -182,7 +181,7 @@ impl cosmic::Application for Window {
); );
get_popup(popup_settings) get_popup(popup_settings)
} };
} }
Message::PopupClosed(id) => { Message::PopupClosed(id) => {
if self.popup.as_ref() == Some(&id) { if self.popup.as_ref() == Some(&id) {

View file

@ -1,7 +1,7 @@
[package] [package]
name = "cosmic-applet-time" name = "cosmic-applet-time"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2024"
license = "GPL-3.0-only" license = "GPL-3.0-only"
[dependencies] [dependencies]

View file

@ -2,8 +2,8 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use i18n_embed::{ use i18n_embed::{
fluent::{fluent_language_loader, FluentLanguageLoader},
DefaultLocalizer, LanguageLoader, Localizer, 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

@ -7,23 +7,23 @@ use chrono::{Datelike, Timelike};
use cosmic::iced_futures::stream; use cosmic::iced_futures::stream;
use cosmic::widget::Id; use cosmic::widget::Id;
use cosmic::{ use cosmic::{
app, Element, Task, app,
applet::{cosmic_panel_config::PanelAnchor, menu_button, padded_control}, applet::{cosmic_panel_config::PanelAnchor, menu_button, padded_control},
cctk::sctk::reexports::calloop, cctk::sctk::reexports::calloop,
cosmic_theme::Spacing, cosmic_theme::Spacing,
iced::{ iced::{
futures::{channel::mpsc, SinkExt, StreamExt, TryFutureExt}, Alignment, Length, Rectangle, Subscription,
futures::{SinkExt, StreamExt, TryFutureExt, channel::mpsc},
platform_specific::shell::wayland::commands::popup::{destroy_popup, get_popup}, platform_specific::shell::wayland::commands::popup::{destroy_popup, get_popup},
widget::{column, row, vertical_space}, widget::{column, row, vertical_space},
window, Alignment, Length, Rectangle, Subscription, window,
}, },
iced_widget::{horizontal_rule, Column}, iced_widget::{Column, horizontal_rule},
surface, theme, surface, theme,
widget::{ widget::{
autosize, button, container, divider, grid, horizontal_space, icon, rectangle_tracker::*, Button, Grid, Space, autosize, button, container, divider, grid, horizontal_space, icon,
text, Button, Grid, Space, rectangle_tracker::*, text,
}, },
Element, Task,
}; };
use logind_zbus::manager::ManagerProxy; use logind_zbus::manager::ManagerProxy;
use std::sync::LazyLock; use std::sync::LazyLock;
@ -33,18 +33,18 @@ use tokio::{sync::watch, time};
use icu::{ use icu::{
calendar::DateTime, calendar::DateTime,
datetime::{ datetime::{
DateTimeFormatter, DateTimeFormatterOptions,
options::{ options::{
components::{self, Bag}, components::{self, Bag},
preferences, preferences,
}, },
DateTimeFormatter, DateTimeFormatterOptions,
}, },
locid::Locale, locid::Locale,
}; };
use crate::{config::TimeAppletConfig, fl, time::get_calender_first}; use crate::{config::TimeAppletConfig, fl, time::get_calender_first};
use cosmic::applet::token::subscription::{ use cosmic::applet::token::subscription::{
activation_token_subscription, TokenRequest, TokenUpdate, TokenRequest, TokenUpdate, activation_token_subscription,
}; };
static AUTOSIZE_MAIN_ID: LazyLock<Id> = LazyLock::new(|| Id::new("autosize-main")); static AUTOSIZE_MAIN_ID: LazyLock<Id> = LazyLock::new(|| Id::new("autosize-main"));

View file

@ -2,7 +2,7 @@
name = "cosmic-applet-workspaces" name = "cosmic-applet-workspaces"
version = "0.1.1" version = "0.1.1"
authors = ["Ashley Wulber <ashley@system76.com>"] authors = ["Ashley Wulber <ashley@system76.com>"]
edition = "2021" edition = "2024"
license = "GPL-3.0-only" license = "GPL-3.0-only"
[dependencies] [dependencies]

View file

@ -11,26 +11,24 @@ use cctk::{
workspace::Workspace, workspace::Workspace,
}; };
use cosmic::{ use cosmic::{
app, Element, Task, Theme, app,
applet::cosmic_panel_config::PanelAnchor, applet::cosmic_panel_config::PanelAnchor,
iced::{ iced::{
event,
mouse::{self, ScrollDelta},
widget::{button, column, row},
Alignment, Alignment,
Event::Mouse, Event::Mouse,
Length, Limits, Subscription, Length, Limits, Subscription, event,
mouse::{self, ScrollDelta},
widget::{button, column, row},
}, },
iced_core::{Background, Border}, iced_core::{Background, Border},
surface, surface,
widget::{autosize, container, horizontal_space, vertical_space, Id}, widget::{Id, autosize, container, horizontal_space, vertical_space},
Element, Task, Theme,
}; };
use crate::{ use crate::{
config, config,
wayland::WorkspaceEvent, wayland::WorkspaceEvent,
wayland_subscription::{workspaces, WorkspacesUpdate}, wayland_subscription::{WorkspacesUpdate, workspaces},
}; };
use std::{ use std::{
@ -187,11 +185,7 @@ impl cosmic::Application for IcedWorkspacesApplet {
{ {
let max_w = self.workspaces.len().wrapping_sub(1); let max_w = self.workspaces.len().wrapping_sub(1);
let d_i = if self.scroll > 0.0 { let d_i = if self.scroll > 0.0 {
if w_i == 0 { if w_i == 0 { max_w } else { w_i.wrapping_sub(1) }
max_w
} else {
w_i.wrapping_sub(1)
}
} else if w_i == max_w { } else if w_i == max_w {
0 0
} else { } else {

View file

@ -2,8 +2,8 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use i18n_embed::{ use i18n_embed::{
fluent::{fluent_language_loader, FluentLanguageLoader},
DefaultLocalizer, LanguageLoader, Localizer, 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

@ -16,15 +16,15 @@ use cctk::{
}, },
workspace::{Workspace, WorkspaceHandler, WorkspaceState}, workspace::{Workspace, WorkspaceHandler, WorkspaceState},
}; };
use futures::{channel::mpsc, executor::block_on, SinkExt}; use futures::{SinkExt, channel::mpsc, executor::block_on};
use std::os::{ use std::os::{
fd::{FromRawFd, RawFd}, fd::{FromRawFd, RawFd},
unix::net::UnixStream, unix::net::UnixStream,
}; };
use wayland_client::{ use wayland_client::{
Connection, QueueHandle,
globals::registry_queue_init, globals::registry_queue_init,
protocol::wl_output::{self, WlOutput}, protocol::wl_output::{self, WlOutput},
Connection, QueueHandle,
}; };
#[derive(Debug, Clone)] #[derive(Debug, Clone)]

View file

@ -4,9 +4,9 @@
use crate::wayland::{self, WorkspaceEvent}; use crate::wayland::{self, WorkspaceEvent};
use cctk::{sctk::reexports::calloop::channel::SyncSender, workspace::Workspace}; use cctk::{sctk::reexports::calloop::channel::SyncSender, workspace::Workspace};
use cosmic::iced::{ use cosmic::iced::{
self, self, Subscription,
futures::{channel::mpsc, SinkExt, StreamExt}, futures::{SinkExt, StreamExt, channel::mpsc},
stream, Subscription, stream,
}; };
use std::sync::LazyLock; use std::sync::LazyLock;
use tokio::sync::Mutex; use tokio::sync::Mutex;

View file

@ -1,7 +1,7 @@
[package] [package]
name = "cosmic-applets" name = "cosmic-applets"
version = "0.1.1" version = "0.1.1"
edition = "2021" edition = "2024"
license = "GPL-3.0-only" license = "GPL-3.0-only"
[dependencies] [dependencies]

View file

@ -1,7 +1,7 @@
[package] [package]
name = "cosmic-panel-button" name = "cosmic-panel-button"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2024"
license = "GPL-3.0-only" license = "GPL-3.0-only"
[dependencies] [dependencies]

View file

@ -1,6 +1,6 @@
use std::collections::HashMap; use std::collections::HashMap;
use cosmic_config::{cosmic_config_derive::CosmicConfigEntry, CosmicConfigEntry}; use cosmic_config::{CosmicConfigEntry, cosmic_config_derive::CosmicConfigEntry};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
#[derive(Debug, Deserialize, Serialize, PartialEq, Clone, CosmicConfigEntry)] #[derive(Debug, Deserialize, Serialize, PartialEq, Clone, CosmicConfigEntry)]

View file

@ -2,18 +2,17 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use config::{CosmicPanelButtonConfig, IndividualConfig, Override}; use config::{CosmicPanelButtonConfig, IndividualConfig, Override};
use cosmic::desktop::fde::{self, get_languages_from_env, DesktopEntry}; use cosmic::desktop::fde::{self, DesktopEntry, get_languages_from_env};
use cosmic::{ use cosmic::{
app, Task, app,
applet::{ applet::{
cosmic_panel_config::{PanelAnchor, PanelSize},
Size, Size,
cosmic_panel_config::{PanelAnchor, PanelSize},
}, },
iced::{self, Length}, iced::{self, Length},
iced_widget::row, iced_widget::row,
surface, surface,
widget::{autosize, vertical_space, Id}, widget::{Id, autosize, vertical_space},
Task,
}; };
use cosmic_config::{Config, CosmicConfigEntry}; use cosmic_config::{Config, CosmicConfigEntry};
use std::{env, fs, process::Command, sync::LazyLock}; use std::{env, fs, process::Command, sync::LazyLock};