chore: merge imports
This commit is contained in:
parent
c6004b67e5
commit
0640e88412
25 changed files with 277 additions and 265 deletions
|
|
@ -1,8 +1,7 @@
|
|||
// Copyright 2023 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use cosmic::cosmic_config::cosmic_config_derive::CosmicConfigEntry;
|
||||
use cosmic::cosmic_config::{self, CosmicConfigEntry};
|
||||
use cosmic::cosmic_config::{self, cosmic_config_derive::CosmicConfigEntry, CosmicConfigEntry};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Default, Debug, Clone, Serialize, Deserialize, CosmicConfigEntry, PartialEq, Eq)]
|
||||
|
|
|
|||
|
|
@ -4,43 +4,36 @@
|
|||
mod localize;
|
||||
mod mouse_area;
|
||||
|
||||
use crate::localize::localize;
|
||||
use crate::pulse::DeviceInfo;
|
||||
use crate::{localize::localize, pulse::DeviceInfo};
|
||||
use config::AudioAppletConfig;
|
||||
use cosmic::app::Command;
|
||||
use cosmic::applet::cosmic_panel_config::PanelAnchor;
|
||||
use cosmic::applet::menu_button;
|
||||
use cosmic::applet::menu_control_padding;
|
||||
use cosmic::applet::padded_control;
|
||||
use cosmic::applet::token::subscription::{
|
||||
activation_token_subscription, TokenRequest, TokenUpdate,
|
||||
use cosmic::{
|
||||
app::Command,
|
||||
applet::{
|
||||
cosmic_panel_config::PanelAnchor,
|
||||
menu_button, menu_control_padding, padded_control,
|
||||
token::subscription::{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_time::{anim, chain, id, once_cell::sync::Lazy, Instant, Timeline};
|
||||
use iced::wayland::popup::{destroy_popup, get_popup};
|
||||
use iced::widget::container;
|
||||
use iced::{
|
||||
wayland::popup::{destroy_popup, get_popup},
|
||||
widget::container,
|
||||
};
|
||||
use libpulse_binding::volume::Volume;
|
||||
use mpris2_zbus::player::PlaybackStatus;
|
||||
use mpris_subscription::MprisRequest;
|
||||
use mpris_subscription::MprisUpdate;
|
||||
use mpris_subscription::{MprisRequest, MprisUpdate};
|
||||
|
||||
mod config;
|
||||
mod mpris_subscription;
|
||||
|
|
|
|||
|
|
@ -1,16 +1,13 @@
|
|||
//! A container for capturing mouse events.
|
||||
|
||||
use cosmic::iced_renderer::core::widget::OperationOutputWrapper;
|
||||
use cosmic::iced_renderer::core::Point;
|
||||
use cosmic::iced_renderer::core::{widget::OperationOutputWrapper, Point};
|
||||
|
||||
use cosmic::iced_core::event::{self, Event};
|
||||
use cosmic::iced_core::layout;
|
||||
use cosmic::iced_core::mouse;
|
||||
use cosmic::iced_core::overlay;
|
||||
use cosmic::iced_core::renderer;
|
||||
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};
|
||||
use cosmic::iced_core::{
|
||||
event::{self, Event},
|
||||
layout, mouse, overlay, renderer, touch,
|
||||
widget::{tree, Operation, Tree},
|
||||
Clipboard, Element, Layout, Length, Rectangle, Shell, Size, Widget,
|
||||
};
|
||||
|
||||
/// Emit messages on mouse events.
|
||||
#[allow(missing_debug_implementations)]
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
// Copyright 2023 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use std::cell::RefCell;
|
||||
use std::{rc::Rc, thread};
|
||||
use std::{cell::RefCell, rc::Rc, thread};
|
||||
|
||||
extern crate libpulse_binding as pulse;
|
||||
|
||||
use cosmic::iced::{self, subscription};
|
||||
use cosmic::iced_futures::futures::{self, SinkExt};
|
||||
use cosmic::{
|
||||
iced::{self, subscription},
|
||||
iced_futures::futures::{self, SinkExt},
|
||||
};
|
||||
use cosmic_time::once_cell::sync::Lazy;
|
||||
|
||||
use libpulse_binding::{
|
||||
|
|
|
|||
|
|
@ -1,30 +1,32 @@
|
|||
// Copyright 2023 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use crate::backend::{power_profile_subscription, Power, PowerProfileRequest, PowerProfileUpdate};
|
||||
use crate::config;
|
||||
use crate::dgpu::{dgpu_subscription, Entry, GpuUpdate};
|
||||
use crate::fl;
|
||||
use cosmic::applet::cosmic_panel_config::PanelAnchor;
|
||||
use cosmic::applet::token::subscription::{
|
||||
activation_token_subscription, TokenRequest, TokenUpdate,
|
||||
use crate::{
|
||||
backend::{power_profile_subscription, Power, PowerProfileRequest, PowerProfileUpdate},
|
||||
config,
|
||||
dgpu::{dgpu_subscription, Entry, GpuUpdate},
|
||||
fl,
|
||||
};
|
||||
use cosmic::applet::{menu_button, padded_control};
|
||||
use cosmic::cctk::sctk::reexports::calloop;
|
||||
use cosmic::iced::alignment::Horizontal;
|
||||
use cosmic::iced::wayland::popup::{destroy_popup, get_popup};
|
||||
use cosmic::iced::{
|
||||
widget::{column, container, row, slider, text},
|
||||
window, Alignment, Length, Subscription,
|
||||
use cosmic::{
|
||||
applet::{
|
||||
cosmic_panel_config::PanelAnchor,
|
||||
menu_button, padded_control,
|
||||
token::subscription::{activation_token_subscription, TokenRequest, TokenUpdate},
|
||||
},
|
||||
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::{
|
||||
settings_daemon,
|
||||
upower::{
|
||||
|
|
@ -36,9 +38,7 @@ use cosmic_settings_subscriptions::{
|
|||
};
|
||||
use cosmic_time::{anim, chain, id, once_cell::sync::Lazy, Instant, Timeline};
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::path::PathBuf;
|
||||
use std::time::Duration;
|
||||
use std::{collections::HashMap, path::PathBuf, time::Duration};
|
||||
use tokio::sync::mpsc::UnboundedSender;
|
||||
|
||||
// XXX improve
|
||||
|
|
|
|||
|
|
@ -2,15 +2,11 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use cosmic::iced::{self, futures::SinkExt, subscription};
|
||||
use std::fmt::Debug;
|
||||
use std::hash::Hash;
|
||||
use tokio::sync::mpsc::UnboundedReceiver;
|
||||
use tokio::sync::mpsc::UnboundedSender;
|
||||
use zbus::Connection;
|
||||
use zbus::Result;
|
||||
use std::{fmt::Debug, hash::Hash};
|
||||
use tokio::sync::mpsc::{UnboundedReceiver, UnboundedSender};
|
||||
use zbus::{Connection, Result};
|
||||
|
||||
use self::power_daemon::PowerDaemonProxy;
|
||||
use self::power_profiles::PowerProfilesProxy;
|
||||
use self::{power_daemon::PowerDaemonProxy, power_profiles::PowerProfilesProxy};
|
||||
|
||||
mod power_daemon;
|
||||
mod power_profiles;
|
||||
|
|
|
|||
|
|
@ -2,14 +2,13 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
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::{
|
||||
applet::token::subscription::{activation_token_subscription, TokenRequest, TokenUpdate},
|
||||
cctk::sctk::reexports::calloop,
|
||||
};
|
||||
|
||||
use cosmic::{
|
||||
applet::{menu_button, padded_control},
|
||||
iced::{
|
||||
self,
|
||||
wayland::popup::{destroy_popup, get_popup},
|
||||
|
|
@ -23,15 +22,16 @@ use cosmic::{
|
|||
},
|
||||
iced_style::application,
|
||||
widget::{button, divider, icon},
|
||||
Element, Theme,
|
||||
Command, Element, Theme,
|
||||
};
|
||||
use cosmic_time::{anim, chain, id, once_cell::sync::Lazy, Instant, Timeline};
|
||||
use std::collections::HashMap;
|
||||
use std::time::Duration;
|
||||
use std::{collections::HashMap, time::Duration};
|
||||
use tokio::sync::mpsc::Sender;
|
||||
|
||||
use crate::bluetooth::{bluetooth_subscription, BluerDevice, BluerEvent};
|
||||
use crate::{config, fl};
|
||||
use crate::{
|
||||
bluetooth::{bluetooth_subscription, BluerDevice, BluerEvent},
|
||||
config, fl,
|
||||
};
|
||||
|
||||
static BLUETOOTH_ENABLED: Lazy<id::Toggler> = Lazy::new(id::Toggler::unique);
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,7 @@
|
|||
|
||||
use crate::window::Window;
|
||||
use config::{Config, CONFIG_VERSION};
|
||||
use cosmic::cosmic_config;
|
||||
use cosmic::cosmic_config::CosmicConfigEntry;
|
||||
use cosmic::{cosmic_config, cosmic_config::CosmicConfigEntry};
|
||||
mod config;
|
||||
use cosmic_comp_config::CosmicCompConfig;
|
||||
use window::Flags;
|
||||
|
|
|
|||
|
|
@ -4,20 +4,24 @@
|
|||
use crate::config::{Config, CONFIG_VERSION};
|
||||
#[allow(unused_imports)]
|
||||
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)]
|
||||
use cosmic::iced::{alignment, Alignment, Length};
|
||||
use cosmic::iced::{Command, Limits};
|
||||
use cosmic::iced_futures::Subscription;
|
||||
use cosmic::iced_runtime::core::window;
|
||||
use cosmic::iced_style::application;
|
||||
use cosmic::prelude::*;
|
||||
use cosmic::widget::{self, horizontal_space, vertical_space};
|
||||
use cosmic::{
|
||||
app::Core,
|
||||
applet::{self},
|
||||
cosmic_config::{self, ConfigSet},
|
||||
iced::{
|
||||
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 xkb_data::KeyboardLayouts;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,19 +7,23 @@ pub(crate) mod wayland_subscription;
|
|||
pub(crate) mod window_image;
|
||||
|
||||
use crate::localize::localize;
|
||||
use cosmic::app::Command;
|
||||
use cosmic::applet::cosmic_panel_config::PanelAnchor;
|
||||
use cosmic::cctk::cosmic_protocols::toplevel_info::v1::client::zcosmic_toplevel_handle_v1::ZcosmicToplevelHandleV1;
|
||||
use cosmic::cctk::sctk::reexports::calloop;
|
||||
use cosmic::cctk::toplevel_info::ToplevelInfo;
|
||||
use cosmic::desktop::DesktopEntryData;
|
||||
use cosmic::iced::{widget::text, Length, Subscription};
|
||||
use cosmic::{
|
||||
app::Command,
|
||||
applet::cosmic_panel_config::PanelAnchor,
|
||||
cctk::{
|
||||
cosmic_protocols::toplevel_info::v1::client::zcosmic_toplevel_handle_v1::ZcosmicToplevelHandleV1,
|
||||
sctk::reexports::calloop, toplevel_info::ToplevelInfo,
|
||||
},
|
||||
desktop::DesktopEntryData,
|
||||
iced::{widget::text, Length, Subscription},
|
||||
};
|
||||
|
||||
use cosmic::iced_style::application;
|
||||
use cosmic::iced_widget::{Column, Row};
|
||||
use cosmic::{
|
||||
iced_style::application,
|
||||
iced_widget::{Column, Row},
|
||||
};
|
||||
|
||||
use cosmic::widget::tooltip;
|
||||
use cosmic::{Element, Theme};
|
||||
use cosmic::{widget::tooltip, Element, Theme};
|
||||
use wayland_subscription::{
|
||||
ToplevelRequest, ToplevelUpdate, WaylandImage, WaylandRequest, WaylandUpdate,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,12 +5,8 @@
|
|||
//!
|
||||
//! 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`.
|
||||
use cctk::sctk::reexports::calloop;
|
||||
use cctk::toplevel_info::ToplevelInfo;
|
||||
use cosmic::cctk::cosmic_protocols;
|
||||
use cosmic::iced::subscription;
|
||||
use cosmic::iced_futures::futures;
|
||||
use cosmic::{cctk, iced};
|
||||
use cctk::{sctk::reexports::calloop, toplevel_info::ToplevelInfo};
|
||||
use cosmic::{cctk, cctk::cosmic_protocols, iced, iced::subscription, iced_futures::futures};
|
||||
use cosmic_protocols::toplevel_info::v1::client::zcosmic_toplevel_handle_v1::ZcosmicToplevelHandleV1;
|
||||
use futures::{
|
||||
channel::mpsc::{unbounded, UnboundedReceiver},
|
||||
|
|
@ -18,8 +14,7 @@ use futures::{
|
|||
};
|
||||
use image::EncodableLayout;
|
||||
use once_cell::sync::Lazy;
|
||||
use std::fmt::Debug;
|
||||
use std::sync::Arc;
|
||||
use std::{fmt::Debug, sync::Arc};
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
use crate::wayland_handler::wayland_handler;
|
||||
|
|
|
|||
|
|
@ -1,14 +1,12 @@
|
|||
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::{
|
||||
app::Command,
|
||||
applet::{
|
||||
menu_button, menu_control_padding, padded_control,
|
||||
token::subscription::{activation_token_subscription, TokenRequest, TokenUpdate},
|
||||
},
|
||||
cctk::sctk::reexports::calloop,
|
||||
iced::{
|
||||
wayland::popup::{destroy_popup, get_popup},
|
||||
widget::{column, row},
|
||||
|
|
@ -20,7 +18,10 @@ use cosmic::{
|
|||
window,
|
||||
},
|
||||
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,
|
||||
};
|
||||
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 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::{
|
||||
config, fl,
|
||||
network_manager::{
|
||||
available_wifi::AccessPoint, current_networks::ActiveConnectionInfo,
|
||||
network_manager_subscription, NetworkManagerEvent, NetworkManagerRequest,
|
||||
active_conns::active_conns_subscription, available_wifi::AccessPoint,
|
||||
current_networks::ActiveConnectionInfo, devices::devices_subscription,
|
||||
network_manager_subscription, wireless_enabled::wireless_enabled_subscription,
|
||||
NetworkManagerEvent, NetworkManagerRequest, NetworkManagerState,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@ use super::{NetworkManagerEvent, NetworkManagerState};
|
|||
use cosmic::iced::{self, subscription};
|
||||
use cosmic_dbus_networkmanager::nm::NetworkManager;
|
||||
use futures::{SinkExt, StreamExt};
|
||||
use std::fmt::Debug;
|
||||
use std::hash::Hash;
|
||||
use std::{fmt::Debug, hash::Hash};
|
||||
use zbus::Connection;
|
||||
|
||||
pub fn active_conns_subscription<I: 'static + Hash + Copy + Send + Sync + Debug>(
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@ use super::{NetworkManagerEvent, NetworkManagerState};
|
|||
use cosmic::iced::{self, subscription};
|
||||
use cosmic_dbus_networkmanager::nm::NetworkManager;
|
||||
use futures::{SinkExt, StreamExt};
|
||||
use std::fmt::Debug;
|
||||
use std::hash::Hash;
|
||||
use std::{fmt::Debug, hash::Hash};
|
||||
use zbus::Connection;
|
||||
|
||||
pub fn devices_subscription<I: 'static + Hash + Copy + Send + Sync + Debug>(
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@ use super::{NetworkManagerEvent, NetworkManagerState};
|
|||
use cosmic::iced::{self, subscription};
|
||||
use cosmic_dbus_networkmanager::nm::NetworkManager;
|
||||
use futures::{SinkExt, StreamExt};
|
||||
use std::fmt::Debug;
|
||||
use std::hash::Hash;
|
||||
use std::{fmt::Debug, hash::Hash};
|
||||
use zbus::Connection;
|
||||
|
||||
pub fn wireless_enabled_subscription<I: 'static + Hash + Copy + Send + Sync + Debug>(
|
||||
|
|
|
|||
|
|
@ -3,33 +3,33 @@
|
|||
|
||||
mod localize;
|
||||
mod subscriptions;
|
||||
use cosmic::applet::token::subscription::{
|
||||
activation_token_subscription, TokenRequest, TokenUpdate,
|
||||
use cosmic::{
|
||||
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::cosmic_config::{Config, CosmicConfigEntry};
|
||||
use cosmic::iced::wayland::popup::{destroy_popup, get_popup};
|
||||
use cosmic::iced::Limits;
|
||||
use cosmic::iced::{
|
||||
widget::{column, row, text},
|
||||
window, Alignment, Length, Subscription,
|
||||
|
||||
use cosmic::{iced_futures::futures::executor::block_on, iced_style::application};
|
||||
|
||||
use cosmic::{
|
||||
iced_widget::{scrollable, Column},
|
||||
widget::{button, container, divider, icon},
|
||||
Element, Theme,
|
||||
};
|
||||
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_util::{Image, Notification};
|
||||
use cosmic_time::{anim, chain, id, once_cell::sync::Lazy, Instant, Timeline};
|
||||
use std::borrow::Cow;
|
||||
use std::collections::HashMap;
|
||||
use std::path::PathBuf;
|
||||
use std::{borrow::Cow, collections::HashMap, path::PathBuf};
|
||||
use subscriptions::notifications::NotificationsAppletProxy;
|
||||
use tokio::sync::mpsc::Sender;
|
||||
use tracing::info;
|
||||
|
|
|
|||
|
|
@ -1,37 +1,43 @@
|
|||
// Copyright 2023 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::process;
|
||||
use std::time::Duration;
|
||||
use std::{collections::HashMap, process, time::Duration};
|
||||
|
||||
use cosmic::applet::{menu_button, padded_control};
|
||||
use cosmic::iced;
|
||||
use cosmic::iced::alignment::{Horizontal, Vertical};
|
||||
use cosmic::iced::event::wayland::{self, LayerEvent};
|
||||
use cosmic::iced::event::{listen_with, PlatformSpecific};
|
||||
use cosmic::iced::time;
|
||||
use cosmic::iced::wayland::actions::layer_surface::SctkLayerSurfaceSettings;
|
||||
use cosmic::iced::wayland::popup::{destroy_popup, get_popup};
|
||||
use cosmic::iced_runtime::core::layout::Limits;
|
||||
use cosmic::iced_sctk::commands::layer_surface::{
|
||||
destroy_layer_surface, get_layer_surface, Anchor, KeyboardInteractivity,
|
||||
use cosmic::{
|
||||
app::Command,
|
||||
applet::{menu_button, padded_control},
|
||||
iced,
|
||||
iced::{
|
||||
alignment::{Horizontal, Vertical},
|
||||
event::{
|
||||
listen_with,
|
||||
wayland::{self, LayerEvent},
|
||||
PlatformSpecific,
|
||||
},
|
||||
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::{
|
||||
widget::{self, column, container, row, space::Space, text},
|
||||
window, Alignment, Length, Subscription,
|
||||
use logind_zbus::{
|
||||
manager::ManagerProxy,
|
||||
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 rustix::process::getuid;
|
||||
use zbus::Connection;
|
||||
|
|
@ -40,8 +46,7 @@ pub mod cosmic_session;
|
|||
mod localize;
|
||||
pub mod session_manager;
|
||||
|
||||
use crate::cosmic_session::CosmicSessionProxy;
|
||||
use crate::session_manager::SessionManagerProxy;
|
||||
use crate::{cosmic_session::CosmicSessionProxy, session_manager::SessionManagerProxy};
|
||||
|
||||
pub fn run() -> cosmic::iced::Result {
|
||||
localize::localize();
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
// Copyright 2023 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use cosmic::applet::menu_button;
|
||||
use cosmic::{iced, widget::icon};
|
||||
use cosmic::{applet::menu_button, iced, widget::icon};
|
||||
|
||||
use crate::subscriptions::status_notifier_item::{Layout, StatusNotifierItem};
|
||||
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ use tracing::error;
|
|||
use wayland_client::{
|
||||
globals::registry_queue_init,
|
||||
protocol::wl_output::{self, WlOutput},
|
||||
Connection, QueueHandle,
|
||||
};
|
||||
use wayland_client::{Connection, QueueHandle};
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum AppRequest {
|
||||
|
|
|
|||
|
|
@ -1,26 +1,32 @@
|
|||
// Copyright 2023 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use crate::wayland::AppRequest;
|
||||
use crate::wayland_subscription::WorkspacesUpdate;
|
||||
use crate::{fl, wayland_subscription};
|
||||
use crate::{
|
||||
fl, wayland::AppRequest, wayland_subscription, wayland_subscription::WorkspacesUpdate,
|
||||
};
|
||||
use cctk::sctk::reexports::calloop::channel::SyncSender;
|
||||
use cosmic::app::Core;
|
||||
use cosmic::applet::padded_control;
|
||||
use cosmic::cosmic_config::{Config, ConfigSet, CosmicConfigEntry};
|
||||
use cosmic::iced::wayland::popup::{destroy_popup, get_popup};
|
||||
use cosmic::iced::window::Id;
|
||||
use cosmic::iced::{Command, Length, Limits, Subscription};
|
||||
use cosmic::iced_style::application;
|
||||
use cosmic::iced_widget::{column, row};
|
||||
use cosmic::widget::segmented_button::{Entity, SingleSelectModel};
|
||||
use cosmic::widget::{container, divider, segmented_button, segmented_control, spin_button, text};
|
||||
use cosmic::{Element, Theme};
|
||||
use cosmic::{
|
||||
app::Core,
|
||||
applet::padded_control,
|
||||
cosmic_config::{Config, ConfigSet, CosmicConfigEntry},
|
||||
iced::{
|
||||
wayland::popup::{destroy_popup, get_popup},
|
||||
window::Id,
|
||||
Command, Length, Limits, Subscription,
|
||||
},
|
||||
iced_style::application,
|
||||
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_protocols::workspace::v1::client::zcosmic_workspace_handle_v1::TilingState;
|
||||
use cosmic_time::{anim, chain, id, Timeline};
|
||||
use std::thread;
|
||||
use std::time::Instant;
|
||||
use std::{thread, time::Instant};
|
||||
use tracing::error;
|
||||
|
||||
const ID: &str = "com.system76.CosmicAppletTiling";
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
// Copyright 2023 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use cosmic::cosmic_config::cosmic_config_derive::CosmicConfigEntry;
|
||||
use cosmic::cosmic_config::{self, CosmicConfigEntry};
|
||||
use cosmic::cosmic_config::{self, cosmic_config_derive::CosmicConfigEntry, CosmicConfigEntry};
|
||||
|
||||
#[derive(Debug, Clone, CosmicConfigEntry, PartialEq, Eq)]
|
||||
#[version = 1]
|
||||
|
|
|
|||
|
|
@ -1,37 +1,42 @@
|
|||
// Copyright 2023 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use std::borrow::Cow;
|
||||
use std::str::FromStr;
|
||||
use std::{borrow::Cow, str::FromStr};
|
||||
|
||||
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::{
|
||||
widget::{icon, rectangle_tracker::*},
|
||||
Element, Theme,
|
||||
app,
|
||||
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::datetime::options::components::{self, Bag};
|
||||
use icu::datetime::options::preferences;
|
||||
use icu::datetime::{DateTimeFormatter, DateTimeFormatterOptions};
|
||||
use icu::locid::Locale;
|
||||
use icu::{
|
||||
calendar::DateTime,
|
||||
datetime::{
|
||||
options::{
|
||||
components::{self, Bag},
|
||||
preferences,
|
||||
},
|
||||
DateTimeFormatter, DateTimeFormatterOptions,
|
||||
},
|
||||
locid::Locale,
|
||||
};
|
||||
|
||||
use crate::config::TimeAppletConfig;
|
||||
use crate::fl;
|
||||
use crate::time::get_calender_first;
|
||||
use crate::{config::TimeAppletConfig, fl, time::get_calender_first};
|
||||
use cosmic::applet::token::subscription::{
|
||||
activation_token_subscription, TokenRequest, TokenUpdate,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,23 +2,31 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use cctk::sctk::reexports::{calloop::channel::SyncSender, client::backend::ObjectId};
|
||||
use cosmic::iced::alignment::{Horizontal, Vertical};
|
||||
use cosmic::iced::event;
|
||||
use cosmic::iced::mouse::{self, ScrollDelta};
|
||||
use cosmic::iced::widget::{button, column, row};
|
||||
use cosmic::iced::{Event::Mouse, Length, Subscription};
|
||||
use cosmic::iced_core::{Background, Border};
|
||||
use cosmic::iced_style::application;
|
||||
use cosmic::widget::{container, horizontal_space, vertical_space};
|
||||
use cosmic::{applet::cosmic_panel_config::PanelAnchor, font::FONT_BOLD, Command};
|
||||
use cosmic::{Element, Theme};
|
||||
use cosmic::{
|
||||
applet::cosmic_panel_config::PanelAnchor,
|
||||
font::FONT_BOLD,
|
||||
iced::{
|
||||
alignment::{Horizontal, Vertical},
|
||||
event,
|
||||
mouse::{self, ScrollDelta},
|
||||
widget::{button, column, row},
|
||||
Event::Mouse,
|
||||
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 std::cmp::Ordering;
|
||||
|
||||
use crate::config;
|
||||
use crate::wayland::{WorkspaceEvent, WorkspaceList};
|
||||
use crate::wayland_subscription::{workspaces, WorkspacesUpdate};
|
||||
use crate::{
|
||||
config,
|
||||
wayland::{WorkspaceEvent, WorkspaceList},
|
||||
wayland_subscription::{workspaces, WorkspacesUpdate},
|
||||
};
|
||||
|
||||
use std::process::Command as ShellCommand;
|
||||
|
||||
|
|
|
|||
|
|
@ -24,13 +24,12 @@ use std::{
|
|||
},
|
||||
time::{Duration, Instant},
|
||||
};
|
||||
use wayland_client::backend::ObjectId;
|
||||
use wayland_client::{
|
||||
backend::ObjectId,
|
||||
globals::registry_queue_init,
|
||||
protocol::wl_output::{self, WlOutput},
|
||||
Proxy,
|
||||
Connection, Proxy, QueueHandle, WEnum,
|
||||
};
|
||||
use wayland_client::{Connection, QueueHandle, WEnum};
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum WorkspaceEvent {
|
||||
|
|
|
|||
|
|
@ -2,12 +2,19 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use config::{CosmicPanelButtonConfig, IndividualConfig, Override};
|
||||
use cosmic::applet::cosmic_panel_config::{PanelAnchor, PanelSize};
|
||||
use cosmic::applet::Size;
|
||||
use cosmic::iced::Length;
|
||||
use cosmic::iced_widget::row;
|
||||
use cosmic::widget::vertical_space;
|
||||
use cosmic::{app, iced, iced_style::application, theme::Theme};
|
||||
use cosmic::{
|
||||
app,
|
||||
applet::{
|
||||
cosmic_panel_config::{PanelAnchor, PanelSize},
|
||||
Size,
|
||||
},
|
||||
iced,
|
||||
iced::Length,
|
||||
iced_style::application,
|
||||
iced_widget::row,
|
||||
theme::Theme,
|
||||
widget::vertical_space,
|
||||
};
|
||||
use cosmic_config::{Config, CosmicConfigEntry};
|
||||
use freedesktop_desktop_entry::DesktopEntry;
|
||||
use std::{env, fs, process::Command};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue