chore: merge imports

This commit is contained in:
Vukašin Vojinović 2024-07-09 15:17:44 +02:00 committed by Michael Murphy
parent c6004b67e5
commit 0640e88412
25 changed files with 277 additions and 265 deletions

View file

@ -1,8 +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::cosmic_config_derive::CosmicConfigEntry; use cosmic::cosmic_config::{self, cosmic_config_derive::CosmicConfigEntry, CosmicConfigEntry};
use cosmic::cosmic_config::{self, 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

@ -4,43 +4,36 @@
mod localize; mod localize;
mod mouse_area; mod mouse_area;
use crate::localize::localize; use crate::{localize::localize, pulse::DeviceInfo};
use crate::pulse::DeviceInfo;
use config::AudioAppletConfig; use config::AudioAppletConfig;
use cosmic::app::Command; use cosmic::{
use cosmic::applet::cosmic_panel_config::PanelAnchor; app::Command,
use cosmic::applet::menu_button; applet::{
use cosmic::applet::menu_control_padding; cosmic_panel_config::PanelAnchor,
use cosmic::applet::padded_control; menu_button, menu_control_padding, padded_control,
use cosmic::applet::token::subscription::{ token::subscription::{activation_token_subscription, TokenRequest, TokenUpdate},
activation_token_subscription, TokenRequest, TokenUpdate, },
cctk::sctk::reexports::calloop,
cosmic_config::CosmicConfigEntry,
iced::{
self, widget,
widget::{column, row, slider, text},
window, Alignment, Length, Limits, Subscription,
},
iced_runtime::core::alignment::Horizontal,
iced_style::application,
widget::{button, divider, horizontal_space, icon, Column, Row},
Element, Renderer, Theme,
}; };
use cosmic::cctk::sctk::reexports::calloop;
use cosmic::cosmic_config::CosmicConfigEntry;
use cosmic::iced::widget;
use cosmic::iced::Limits;
use cosmic::iced::{
self,
widget::{column, row, slider, text},
window, Alignment, Length, Subscription,
};
use cosmic::iced_runtime::core::alignment::Horizontal;
use cosmic::iced_style::application;
use cosmic::widget::button;
use cosmic::widget::horizontal_space;
use cosmic::widget::Column;
use cosmic::widget::Row;
use cosmic::widget::{divider, icon};
use cosmic::Renderer;
use cosmic::{Element, Theme};
use cosmic_settings_subscriptions::pulse as sub_pulse; use cosmic_settings_subscriptions::pulse as sub_pulse;
use cosmic_time::{anim, chain, id, once_cell::sync::Lazy, Instant, Timeline}; use cosmic_time::{anim, chain, id, once_cell::sync::Lazy, Instant, Timeline};
use iced::wayland::popup::{destroy_popup, get_popup}; use iced::{
use iced::widget::container; wayland::popup::{destroy_popup, get_popup},
widget::container,
};
use libpulse_binding::volume::Volume; use libpulse_binding::volume::Volume;
use mpris2_zbus::player::PlaybackStatus; use mpris2_zbus::player::PlaybackStatus;
use mpris_subscription::MprisRequest; use mpris_subscription::{MprisRequest, MprisUpdate};
use mpris_subscription::MprisUpdate;
mod config; mod config;
mod mpris_subscription; mod mpris_subscription;

View file

@ -1,16 +1,13 @@
//! A container for capturing mouse events. //! A container for capturing mouse events.
use cosmic::iced_renderer::core::widget::OperationOutputWrapper; use cosmic::iced_renderer::core::{widget::OperationOutputWrapper, Point};
use cosmic::iced_renderer::core::Point;
use cosmic::iced_core::event::{self, Event}; use cosmic::iced_core::{
use cosmic::iced_core::layout; event::{self, Event},
use cosmic::iced_core::mouse; layout, mouse, overlay, renderer, touch,
use cosmic::iced_core::overlay; widget::{tree, Operation, Tree},
use cosmic::iced_core::renderer; Clipboard, Element, Layout, Length, Rectangle, Shell, Size, Widget,
use cosmic::iced_core::touch; };
use cosmic::iced_core::widget::{tree, Operation, Tree};
use cosmic::iced_core::{Clipboard, Element, Layout, Length, Rectangle, Shell, Size, Widget};
/// Emit messages on mouse events. /// Emit messages on mouse events.
#[allow(missing_debug_implementations)] #[allow(missing_debug_implementations)]

View file

@ -1,13 +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 std::cell::RefCell; use std::{cell::RefCell, rc::Rc, thread};
use std::{rc::Rc, thread};
extern crate libpulse_binding as pulse; extern crate libpulse_binding as pulse;
use cosmic::iced::{self, subscription}; use cosmic::{
use cosmic::iced_futures::futures::{self, SinkExt}; iced::{self, subscription},
iced_futures::futures::{self, SinkExt},
};
use cosmic_time::once_cell::sync::Lazy; use cosmic_time::once_cell::sync::Lazy;
use libpulse_binding::{ use libpulse_binding::{

View file

@ -1,30 +1,32 @@
// 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::backend::{power_profile_subscription, Power, PowerProfileRequest, PowerProfileUpdate}; use crate::{
use crate::config; backend::{power_profile_subscription, Power, PowerProfileRequest, PowerProfileUpdate},
use crate::dgpu::{dgpu_subscription, Entry, GpuUpdate}; config,
use crate::fl; dgpu::{dgpu_subscription, Entry, GpuUpdate},
use cosmic::applet::cosmic_panel_config::PanelAnchor; fl,
use cosmic::applet::token::subscription::{
activation_token_subscription, TokenRequest, TokenUpdate,
}; };
use cosmic::applet::{menu_button, padded_control}; use cosmic::{
use cosmic::cctk::sctk::reexports::calloop; applet::{
use cosmic::iced::alignment::Horizontal; cosmic_panel_config::PanelAnchor,
use cosmic::iced::wayland::popup::{destroy_popup, get_popup}; menu_button, padded_control,
use cosmic::iced::{ token::subscription::{activation_token_subscription, TokenRequest, TokenUpdate},
widget::{column, container, row, slider, text}, },
window, Alignment, Length, Subscription, cctk::sctk::reexports::calloop,
iced::{
alignment::Horizontal,
wayland::popup::{destroy_popup, get_popup},
widget::{column, container, row, slider, text},
window, Alignment, Length, Subscription,
},
iced_core::{alignment::Vertical, Background, Border, Color, Shadow},
iced_runtime::core::layout::Limits,
iced_style::application,
iced_widget::{Column, Row},
widget::{divider, horizontal_space, icon, scrollable, vertical_space},
Command, Element, Theme,
}; };
use cosmic::iced_core::alignment::Vertical;
use cosmic::iced_core::{Background, Border, Color, Shadow};
use cosmic::iced_runtime::core::layout::Limits;
use cosmic::iced_style::application;
use cosmic::iced_widget::{Column, Row};
use cosmic::widget::{divider, horizontal_space, icon, scrollable, vertical_space};
use cosmic::Command;
use cosmic::{Element, Theme};
use cosmic_settings_subscriptions::{ use cosmic_settings_subscriptions::{
settings_daemon, settings_daemon,
upower::{ upower::{
@ -36,9 +38,7 @@ use cosmic_settings_subscriptions::{
}; };
use cosmic_time::{anim, chain, id, once_cell::sync::Lazy, Instant, Timeline}; use cosmic_time::{anim, chain, id, once_cell::sync::Lazy, Instant, Timeline};
use std::collections::HashMap; use std::{collections::HashMap, path::PathBuf, time::Duration};
use std::path::PathBuf;
use std::time::Duration;
use tokio::sync::mpsc::UnboundedSender; use tokio::sync::mpsc::UnboundedSender;
// XXX improve // XXX improve

View file

@ -2,15 +2,11 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use cosmic::iced::{self, futures::SinkExt, subscription}; use cosmic::iced::{self, futures::SinkExt, subscription};
use std::fmt::Debug; use std::{fmt::Debug, hash::Hash};
use std::hash::Hash; use tokio::sync::mpsc::{UnboundedReceiver, UnboundedSender};
use tokio::sync::mpsc::UnboundedReceiver; use zbus::{Connection, Result};
use tokio::sync::mpsc::UnboundedSender;
use zbus::Connection;
use zbus::Result;
use self::power_daemon::PowerDaemonProxy; use self::{power_daemon::PowerDaemonProxy, power_profiles::PowerProfilesProxy};
use self::power_profiles::PowerProfilesProxy;
mod power_daemon; mod power_daemon;
mod power_profiles; mod power_profiles;

View file

@ -2,14 +2,13 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use crate::bluetooth::{BluerDeviceStatus, BluerRequest, BluerState}; use crate::bluetooth::{BluerDeviceStatus, BluerRequest, BluerState};
use cosmic::applet::token::subscription::{
activation_token_subscription, TokenRequest, TokenUpdate,
};
use cosmic::cctk::sctk::reexports::calloop;
use cosmic::applet::{menu_button, padded_control};
use cosmic::Command;
use cosmic::{ use cosmic::{
applet::token::subscription::{activation_token_subscription, TokenRequest, TokenUpdate},
cctk::sctk::reexports::calloop,
};
use cosmic::{
applet::{menu_button, padded_control},
iced::{ iced::{
self, self,
wayland::popup::{destroy_popup, get_popup}, wayland::popup::{destroy_popup, get_popup},
@ -23,15 +22,16 @@ use cosmic::{
}, },
iced_style::application, iced_style::application,
widget::{button, divider, icon}, widget::{button, divider, icon},
Element, Theme, Command, Element, Theme,
}; };
use cosmic_time::{anim, chain, id, once_cell::sync::Lazy, Instant, Timeline}; use cosmic_time::{anim, chain, id, once_cell::sync::Lazy, Instant, Timeline};
use std::collections::HashMap; use std::{collections::HashMap, time::Duration};
use std::time::Duration;
use tokio::sync::mpsc::Sender; use tokio::sync::mpsc::Sender;
use crate::bluetooth::{bluetooth_subscription, BluerDevice, BluerEvent}; use crate::{
use crate::{config, fl}; bluetooth::{bluetooth_subscription, BluerDevice, BluerEvent},
config, fl,
};
static BLUETOOTH_ENABLED: Lazy<id::Toggler> = Lazy::new(id::Toggler::unique); static BLUETOOTH_ENABLED: Lazy<id::Toggler> = Lazy::new(id::Toggler::unique);

View file

@ -3,8 +3,7 @@
use crate::window::Window; use crate::window::Window;
use config::{Config, CONFIG_VERSION}; use config::{Config, CONFIG_VERSION};
use cosmic::cosmic_config; use cosmic::{cosmic_config, cosmic_config::CosmicConfigEntry};
use cosmic::cosmic_config::CosmicConfigEntry;
mod config; mod config;
use cosmic_comp_config::CosmicCompConfig; use cosmic_comp_config::CosmicCompConfig;
use window::Flags; use window::Flags;

View file

@ -4,20 +4,24 @@
use crate::config::{Config, CONFIG_VERSION}; use crate::config::{Config, CONFIG_VERSION};
#[allow(unused_imports)] #[allow(unused_imports)]
use crate::fl; use crate::fl;
use cosmic::app::Core;
use cosmic::applet::{self};
use cosmic::cosmic_config::{self, ConfigSet};
use cosmic::iced::wayland::popup::{destroy_popup, get_popup};
use cosmic::iced::widget::{column, row};
use cosmic::iced::window::Id;
#[allow(unused_imports)] #[allow(unused_imports)]
use cosmic::iced::{alignment, Alignment, Length}; use cosmic::iced::{alignment, Alignment, Length};
use cosmic::iced::{Command, Limits}; use cosmic::{
use cosmic::iced_futures::Subscription; app::Core,
use cosmic::iced_runtime::core::window; applet::{self},
use cosmic::iced_style::application; cosmic_config::{self, ConfigSet},
use cosmic::prelude::*; iced::{
use cosmic::widget::{self, horizontal_space, vertical_space}; wayland::popup::{destroy_popup, get_popup},
widget::{column, row},
window::Id,
Command, Limits,
},
iced_futures::Subscription,
iced_runtime::core::window,
iced_style::application,
prelude::*,
widget::{self, horizontal_space, vertical_space},
};
use cosmic_comp_config::CosmicCompConfig; use cosmic_comp_config::CosmicCompConfig;
use xkb_data::KeyboardLayouts; use xkb_data::KeyboardLayouts;

View file

@ -7,19 +7,23 @@ pub(crate) mod wayland_subscription;
pub(crate) mod window_image; pub(crate) mod window_image;
use crate::localize::localize; use crate::localize::localize;
use cosmic::app::Command; use cosmic::{
use cosmic::applet::cosmic_panel_config::PanelAnchor; app::Command,
use cosmic::cctk::cosmic_protocols::toplevel_info::v1::client::zcosmic_toplevel_handle_v1::ZcosmicToplevelHandleV1; applet::cosmic_panel_config::PanelAnchor,
use cosmic::cctk::sctk::reexports::calloop; cctk::{
use cosmic::cctk::toplevel_info::ToplevelInfo; cosmic_protocols::toplevel_info::v1::client::zcosmic_toplevel_handle_v1::ZcosmicToplevelHandleV1,
use cosmic::desktop::DesktopEntryData; sctk::reexports::calloop, toplevel_info::ToplevelInfo,
use cosmic::iced::{widget::text, Length, Subscription}; },
desktop::DesktopEntryData,
iced::{widget::text, Length, Subscription},
};
use cosmic::iced_style::application; use cosmic::{
use cosmic::iced_widget::{Column, Row}; iced_style::application,
iced_widget::{Column, Row},
};
use cosmic::widget::tooltip; use cosmic::{widget::tooltip, Element, Theme};
use cosmic::{Element, Theme};
use wayland_subscription::{ use wayland_subscription::{
ToplevelRequest, ToplevelUpdate, WaylandImage, WaylandRequest, WaylandUpdate, ToplevelRequest, ToplevelUpdate, WaylandImage, WaylandRequest, WaylandUpdate,
}; };

View file

@ -5,12 +5,8 @@
//! //!
//! This code was generated by `zbus-xmlgen` `2.0.1` from DBus introspection data. //! This code was generated by `zbus-xmlgen` `2.0.1` from DBus introspection data.
//! Source: `Interface '/org/freedesktop/UPower/KbdBacklight' from service 'org.freedesktop.UPower' on system bus`. //! Source: `Interface '/org/freedesktop/UPower/KbdBacklight' from service 'org.freedesktop.UPower' on system bus`.
use cctk::sctk::reexports::calloop; use cctk::{sctk::reexports::calloop, toplevel_info::ToplevelInfo};
use cctk::toplevel_info::ToplevelInfo; use cosmic::{cctk, cctk::cosmic_protocols, iced, iced::subscription, iced_futures::futures};
use cosmic::cctk::cosmic_protocols;
use cosmic::iced::subscription;
use cosmic::iced_futures::futures;
use cosmic::{cctk, iced};
use cosmic_protocols::toplevel_info::v1::client::zcosmic_toplevel_handle_v1::ZcosmicToplevelHandleV1; use cosmic_protocols::toplevel_info::v1::client::zcosmic_toplevel_handle_v1::ZcosmicToplevelHandleV1;
use futures::{ use futures::{
channel::mpsc::{unbounded, UnboundedReceiver}, channel::mpsc::{unbounded, UnboundedReceiver},
@ -18,8 +14,7 @@ use futures::{
}; };
use image::EncodableLayout; use image::EncodableLayout;
use once_cell::sync::Lazy; use once_cell::sync::Lazy;
use std::fmt::Debug; use std::{fmt::Debug, sync::Arc};
use std::sync::Arc;
use tokio::sync::Mutex; use tokio::sync::Mutex;
use crate::wayland_handler::wayland_handler; use crate::wayland_handler::wayland_handler;

View file

@ -1,14 +1,12 @@
use std::collections::HashSet; use std::collections::HashSet;
use cosmic::app::Command;
use cosmic::applet::token::subscription::{
activation_token_subscription, TokenRequest, TokenUpdate,
};
use cosmic::applet::{menu_button, menu_control_padding, padded_control};
use cosmic::cctk::sctk::reexports::calloop;
use cosmic::iced_widget::Row;
use cosmic::widget::icon::from_name;
use cosmic::{ use cosmic::{
app::Command,
applet::{
menu_button, menu_control_padding, padded_control,
token::subscription::{activation_token_subscription, TokenRequest, TokenUpdate},
},
cctk::sctk::reexports::calloop,
iced::{ iced::{
wayland::popup::{destroy_popup, get_popup}, wayland::popup::{destroy_popup, get_popup},
widget::{column, row}, widget::{column, row},
@ -20,7 +18,10 @@ use cosmic::{
window, window,
}, },
iced_style::application, iced_style::application,
widget::{button, container, divider, icon, scrollable, text, text_input, Column}, iced_widget::Row,
widget::{
button, container, divider, icon, icon::from_name, scrollable, text, text_input, Column,
},
Element, Theme, Element, Theme,
}; };
use cosmic_dbus_networkmanager::interface::enums::{ use cosmic_dbus_networkmanager::interface::enums::{
@ -31,15 +32,13 @@ use cosmic_time::{anim, chain, id, once_cell::sync::Lazy, Instant, Timeline};
use futures::channel::mpsc::UnboundedSender; use futures::channel::mpsc::UnboundedSender;
use zbus::Connection; use zbus::Connection;
use crate::network_manager::active_conns::active_conns_subscription;
use crate::network_manager::devices::devices_subscription;
use crate::network_manager::wireless_enabled::wireless_enabled_subscription;
use crate::network_manager::NetworkManagerState;
use crate::{ use crate::{
config, fl, config, fl,
network_manager::{ network_manager::{
available_wifi::AccessPoint, current_networks::ActiveConnectionInfo, active_conns::active_conns_subscription, available_wifi::AccessPoint,
network_manager_subscription, NetworkManagerEvent, NetworkManagerRequest, current_networks::ActiveConnectionInfo, devices::devices_subscription,
network_manager_subscription, wireless_enabled::wireless_enabled_subscription,
NetworkManagerEvent, NetworkManagerRequest, NetworkManagerState,
}, },
}; };

View file

@ -2,8 +2,7 @@ use super::{NetworkManagerEvent, NetworkManagerState};
use cosmic::iced::{self, subscription}; use cosmic::iced::{self, subscription};
use cosmic_dbus_networkmanager::nm::NetworkManager; use cosmic_dbus_networkmanager::nm::NetworkManager;
use futures::{SinkExt, StreamExt}; use futures::{SinkExt, StreamExt};
use std::fmt::Debug; use std::{fmt::Debug, hash::Hash};
use std::hash::Hash;
use zbus::Connection; use zbus::Connection;
pub fn active_conns_subscription<I: 'static + Hash + Copy + Send + Sync + Debug>( pub fn active_conns_subscription<I: 'static + Hash + Copy + Send + Sync + Debug>(

View file

@ -2,8 +2,7 @@ use super::{NetworkManagerEvent, NetworkManagerState};
use cosmic::iced::{self, subscription}; use cosmic::iced::{self, subscription};
use cosmic_dbus_networkmanager::nm::NetworkManager; use cosmic_dbus_networkmanager::nm::NetworkManager;
use futures::{SinkExt, StreamExt}; use futures::{SinkExt, StreamExt};
use std::fmt::Debug; use std::{fmt::Debug, hash::Hash};
use std::hash::Hash;
use zbus::Connection; use zbus::Connection;
pub fn devices_subscription<I: 'static + Hash + Copy + Send + Sync + Debug>( pub fn devices_subscription<I: 'static + Hash + Copy + Send + Sync + Debug>(

View file

@ -2,8 +2,7 @@ use super::{NetworkManagerEvent, NetworkManagerState};
use cosmic::iced::{self, subscription}; use cosmic::iced::{self, subscription};
use cosmic_dbus_networkmanager::nm::NetworkManager; use cosmic_dbus_networkmanager::nm::NetworkManager;
use futures::{SinkExt, StreamExt}; use futures::{SinkExt, StreamExt};
use std::fmt::Debug; use std::{fmt::Debug, hash::Hash};
use std::hash::Hash;
use zbus::Connection; use zbus::Connection;
pub fn wireless_enabled_subscription<I: 'static + Hash + Copy + Send + Sync + Debug>( pub fn wireless_enabled_subscription<I: 'static + Hash + Copy + Send + Sync + Debug>(

View file

@ -3,33 +3,33 @@
mod localize; mod localize;
mod subscriptions; mod subscriptions;
use cosmic::applet::token::subscription::{ use cosmic::{
activation_token_subscription, TokenRequest, TokenUpdate, applet::{
menu_control_padding, padded_control,
token::subscription::{activation_token_subscription, TokenRequest, TokenUpdate},
},
cctk::sctk::reexports::calloop,
cosmic_config::{Config, CosmicConfigEntry},
iced::{
wayland::popup::{destroy_popup, get_popup},
widget::{column, row, text},
window, Alignment, Length, Limits, Subscription,
},
iced_core::alignment::Horizontal,
Command,
}; };
use cosmic::applet::{menu_control_padding, padded_control};
use cosmic::cctk::sctk::reexports::calloop; use cosmic::{iced_futures::futures::executor::block_on, iced_style::application};
use cosmic::cosmic_config::{Config, CosmicConfigEntry};
use cosmic::iced::wayland::popup::{destroy_popup, get_popup}; use cosmic::{
use cosmic::iced::Limits; iced_widget::{scrollable, Column},
use cosmic::iced::{ widget::{button, container, divider, icon},
widget::{column, row, text}, Element, Theme,
window, Alignment, Length, Subscription,
}; };
use cosmic::iced_core::alignment::Horizontal;
use cosmic::Command;
use cosmic::iced_futures::futures::executor::block_on;
use cosmic::iced_style::application;
use cosmic::iced_widget::{scrollable, Column};
use cosmic::widget::{button, container, divider, icon};
use cosmic::{Element, Theme};
use cosmic_notifications_config::NotificationsConfig; use cosmic_notifications_config::NotificationsConfig;
use cosmic_notifications_util::{Image, Notification}; use cosmic_notifications_util::{Image, Notification};
use cosmic_time::{anim, chain, id, once_cell::sync::Lazy, Instant, Timeline}; use cosmic_time::{anim, chain, id, once_cell::sync::Lazy, Instant, Timeline};
use std::borrow::Cow; use std::{borrow::Cow, collections::HashMap, path::PathBuf};
use std::collections::HashMap;
use std::path::PathBuf;
use subscriptions::notifications::NotificationsAppletProxy; use subscriptions::notifications::NotificationsAppletProxy;
use tokio::sync::mpsc::Sender; use tokio::sync::mpsc::Sender;
use tracing::info; use tracing::info;

View file

@ -1,37 +1,43 @@
// 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::collections::HashMap; use std::{collections::HashMap, process, time::Duration};
use std::process;
use std::time::Duration;
use cosmic::applet::{menu_button, padded_control}; use cosmic::{
use cosmic::iced; app::Command,
use cosmic::iced::alignment::{Horizontal, Vertical}; applet::{menu_button, padded_control},
use cosmic::iced::event::wayland::{self, LayerEvent}; iced,
use cosmic::iced::event::{listen_with, PlatformSpecific}; iced::{
use cosmic::iced::time; alignment::{Horizontal, Vertical},
use cosmic::iced::wayland::actions::layer_surface::SctkLayerSurfaceSettings; event::{
use cosmic::iced::wayland::popup::{destroy_popup, get_popup}; listen_with,
use cosmic::iced_runtime::core::layout::Limits; wayland::{self, LayerEvent},
use cosmic::iced_sctk::commands::layer_surface::{ PlatformSpecific,
destroy_layer_surface, get_layer_surface, Anchor, KeyboardInteractivity, },
time,
wayland::{
actions::layer_surface::SctkLayerSurfaceSettings,
popup::{destroy_popup, get_popup},
},
widget::{self, column, container, row, space::Space, text},
window, Alignment, Length, Subscription,
},
iced_runtime::core::layout::Limits,
iced_sctk::commands::layer_surface::{
destroy_layer_surface, get_layer_surface, Anchor, KeyboardInteractivity,
},
iced_style::application,
iced_widget::mouse_area,
theme,
widget::{button, divider, horizontal_space, icon, vertical_space, Column},
Element, Renderer, Theme,
}; };
use cosmic::iced_widget::mouse_area;
use cosmic::widget::{button, divider, horizontal_space, icon, vertical_space, Column};
use cosmic::Renderer;
use cosmic::iced::{ use logind_zbus::{
widget::{self, column, container, row, space::Space, text}, manager::ManagerProxy,
window, Alignment, Length, Subscription, session::{SessionProxy, SessionType},
user::UserProxy,
}; };
use cosmic::iced_style::application;
use cosmic::theme;
use cosmic::{app::Command, Element, Theme};
use logind_zbus::manager::ManagerProxy;
use logind_zbus::session::{SessionProxy, SessionType};
use logind_zbus::user::UserProxy;
use once_cell::sync::Lazy; use once_cell::sync::Lazy;
use rustix::process::getuid; use rustix::process::getuid;
use zbus::Connection; use zbus::Connection;
@ -40,8 +46,7 @@ pub mod cosmic_session;
mod localize; mod localize;
pub mod session_manager; pub mod session_manager;
use crate::cosmic_session::CosmicSessionProxy; use crate::{cosmic_session::CosmicSessionProxy, session_manager::SessionManagerProxy};
use crate::session_manager::SessionManagerProxy;
pub fn run() -> cosmic::iced::Result { pub fn run() -> cosmic::iced::Result {
localize::localize(); localize::localize();

View file

@ -1,8 +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::applet::menu_button; use cosmic::{applet::menu_button, iced, widget::icon};
use cosmic::{iced, widget::icon};
use crate::subscriptions::status_notifier_item::{Layout, StatusNotifierItem}; use crate::subscriptions::status_notifier_item::{Layout, StatusNotifierItem};

View file

@ -30,8 +30,8 @@ use tracing::error;
use wayland_client::{ use wayland_client::{
globals::registry_queue_init, globals::registry_queue_init,
protocol::wl_output::{self, WlOutput}, protocol::wl_output::{self, WlOutput},
Connection, QueueHandle,
}; };
use wayland_client::{Connection, QueueHandle};
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub enum AppRequest { pub enum AppRequest {

View file

@ -1,26 +1,32 @@
// 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::wayland::AppRequest; use crate::{
use crate::wayland_subscription::WorkspacesUpdate; fl, wayland::AppRequest, wayland_subscription, wayland_subscription::WorkspacesUpdate,
use crate::{fl, wayland_subscription}; };
use cctk::sctk::reexports::calloop::channel::SyncSender; use cctk::sctk::reexports::calloop::channel::SyncSender;
use cosmic::app::Core; use cosmic::{
use cosmic::applet::padded_control; app::Core,
use cosmic::cosmic_config::{Config, ConfigSet, CosmicConfigEntry}; applet::padded_control,
use cosmic::iced::wayland::popup::{destroy_popup, get_popup}; cosmic_config::{Config, ConfigSet, CosmicConfigEntry},
use cosmic::iced::window::Id; iced::{
use cosmic::iced::{Command, Length, Limits, Subscription}; wayland::popup::{destroy_popup, get_popup},
use cosmic::iced_style::application; window::Id,
use cosmic::iced_widget::{column, row}; Command, Length, Limits, Subscription,
use cosmic::widget::segmented_button::{Entity, SingleSelectModel}; },
use cosmic::widget::{container, divider, segmented_button, segmented_control, spin_button, text}; iced_style::application,
use cosmic::{Element, Theme}; iced_widget::{column, row},
widget::{
container, divider, segmented_button,
segmented_button::{Entity, SingleSelectModel},
segmented_control, spin_button, text,
},
Element, Theme,
};
use cosmic_comp_config::{CosmicCompConfig, TileBehavior}; use cosmic_comp_config::{CosmicCompConfig, TileBehavior};
use cosmic_protocols::workspace::v1::client::zcosmic_workspace_handle_v1::TilingState; use cosmic_protocols::workspace::v1::client::zcosmic_workspace_handle_v1::TilingState;
use cosmic_time::{anim, chain, id, Timeline}; use cosmic_time::{anim, chain, id, Timeline};
use std::thread; use std::{thread, time::Instant};
use std::time::Instant;
use tracing::error; use tracing::error;
const ID: &str = "com.system76.CosmicAppletTiling"; const ID: &str = "com.system76.CosmicAppletTiling";

View file

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

View file

@ -1,37 +1,42 @@
// 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::borrow::Cow; use std::{borrow::Cow, str::FromStr};
use std::str::FromStr;
use chrono::{Datelike, DurationRound, Timelike}; use chrono::{Datelike, DurationRound, Timelike};
use cosmic::applet::{menu_button, padded_control};
use cosmic::cctk::sctk::reexports::calloop;
use cosmic::iced::subscription;
use cosmic::iced::wayland::popup::{destroy_popup, get_popup};
use cosmic::iced::{
widget::{column, row, text, vertical_space},
window, Alignment, Length, Rectangle, Subscription,
};
use cosmic::iced_core::alignment::{Horizontal, Vertical};
use cosmic::iced_style::application;
use cosmic::iced_widget::{horizontal_rule, Column};
use cosmic::widget::{button, container, divider, grid, horizontal_space, Button, Grid, Space};
use cosmic::{app, applet::cosmic_panel_config::PanelAnchor, Command};
use cosmic::{ use cosmic::{
widget::{icon, rectangle_tracker::*}, app,
Element, Theme, applet::{cosmic_panel_config::PanelAnchor, menu_button, padded_control},
cctk::sctk::reexports::calloop,
iced::{
subscription,
wayland::popup::{destroy_popup, get_popup},
widget::{column, row, text, vertical_space},
window, Alignment, Length, Rectangle, Subscription,
},
iced_core::alignment::{Horizontal, Vertical},
iced_style::application,
iced_widget::{horizontal_rule, Column},
widget::{
button, container, divider, grid, horizontal_space, icon, rectangle_tracker::*, Button,
Grid, Space,
},
Command, Element, Theme,
}; };
use icu::calendar::DateTime; use icu::{
use icu::datetime::options::components::{self, Bag}; calendar::DateTime,
use icu::datetime::options::preferences; datetime::{
use icu::datetime::{DateTimeFormatter, DateTimeFormatterOptions}; options::{
use icu::locid::Locale; components::{self, Bag},
preferences,
},
DateTimeFormatter, DateTimeFormatterOptions,
},
locid::Locale,
};
use crate::config::TimeAppletConfig; use crate::{config::TimeAppletConfig, fl, time::get_calender_first};
use crate::fl;
use crate::time::get_calender_first;
use cosmic::applet::token::subscription::{ use cosmic::applet::token::subscription::{
activation_token_subscription, TokenRequest, TokenUpdate, activation_token_subscription, TokenRequest, TokenUpdate,
}; };

View file

@ -2,23 +2,31 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use cctk::sctk::reexports::{calloop::channel::SyncSender, client::backend::ObjectId}; use cctk::sctk::reexports::{calloop::channel::SyncSender, client::backend::ObjectId};
use cosmic::iced::alignment::{Horizontal, Vertical}; use cosmic::{
use cosmic::iced::event; applet::cosmic_panel_config::PanelAnchor,
use cosmic::iced::mouse::{self, ScrollDelta}; font::FONT_BOLD,
use cosmic::iced::widget::{button, column, row}; iced::{
use cosmic::iced::{Event::Mouse, Length, Subscription}; alignment::{Horizontal, Vertical},
use cosmic::iced_core::{Background, Border}; event,
use cosmic::iced_style::application; mouse::{self, ScrollDelta},
use cosmic::widget::{container, horizontal_space, vertical_space}; widget::{button, column, row},
use cosmic::{applet::cosmic_panel_config::PanelAnchor, font::FONT_BOLD, Command}; Event::Mouse,
use cosmic::{Element, Theme}; Length, Subscription,
},
iced_core::{Background, Border},
iced_style::application,
widget::{container, horizontal_space, vertical_space},
Command, Element, Theme,
};
use cosmic_protocols::workspace::v1::client::zcosmic_workspace_handle_v1; use cosmic_protocols::workspace::v1::client::zcosmic_workspace_handle_v1;
use std::cmp::Ordering; use std::cmp::Ordering;
use crate::config; use crate::{
use crate::wayland::{WorkspaceEvent, WorkspaceList}; config,
use crate::wayland_subscription::{workspaces, WorkspacesUpdate}; wayland::{WorkspaceEvent, WorkspaceList},
wayland_subscription::{workspaces, WorkspacesUpdate},
};
use std::process::Command as ShellCommand; use std::process::Command as ShellCommand;

View file

@ -24,13 +24,12 @@ use std::{
}, },
time::{Duration, Instant}, time::{Duration, Instant},
}; };
use wayland_client::backend::ObjectId;
use wayland_client::{ use wayland_client::{
backend::ObjectId,
globals::registry_queue_init, globals::registry_queue_init,
protocol::wl_output::{self, WlOutput}, protocol::wl_output::{self, WlOutput},
Proxy, Connection, Proxy, QueueHandle, WEnum,
}; };
use wayland_client::{Connection, QueueHandle, WEnum};
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub enum WorkspaceEvent { pub enum WorkspaceEvent {

View file

@ -2,12 +2,19 @@
// 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::applet::cosmic_panel_config::{PanelAnchor, PanelSize}; use cosmic::{
use cosmic::applet::Size; app,
use cosmic::iced::Length; applet::{
use cosmic::iced_widget::row; cosmic_panel_config::{PanelAnchor, PanelSize},
use cosmic::widget::vertical_space; Size,
use cosmic::{app, iced, iced_style::application, theme::Theme}; },
iced,
iced::Length,
iced_style::application,
iced_widget::row,
theme::Theme,
widget::vertical_space,
};
use cosmic_config::{Config, CosmicConfigEntry}; use cosmic_config::{Config, CosmicConfigEntry};
use freedesktop_desktop_entry::DesktopEntry; use freedesktop_desktop_entry::DesktopEntry;
use std::{env, fs, process::Command}; use std::{env, fs, process::Command};