refactor: move projects into a workspace

This commit is contained in:
Ashley Wulber 2022-12-23 15:14:15 -05:00 committed by Ashley Wulber
parent 2a417a9156
commit a1aa87f5bd
29 changed files with 1105 additions and 28224 deletions

File diff suppressed because it is too large Load diff

16
Cargo.toml Normal file
View file

@ -0,0 +1,16 @@
[workspace]
members = [
"cosmic-app-list",
"cosmic-applet-audio",
"cosmic-applet-battery",
"cosmic-applet-graphics",
"cosmic-applet-network",
"cosmic-applet-notifications",
"cosmic-applet-power",
"cosmic-applet-time",
"cosmic-applet-workspaces",
]
[patch.crates-io]
zbus = {git = "https://gitlab.freedesktop.org/dbus/zbus", branch = "main"}

File diff suppressed because it is too large Load diff

View file

@ -11,23 +11,4 @@ libpulse-binding = "2.26.0"
libpulse-glib-binding = "2.25.0"
tokio = { version = "1.20.1", features=["full"] }
libcosmic = { git = "https://github.com/pop-os/libcosmic/", branch = "master", default-features = false, features = ["wayland", "applet"] }
iced_sctk = { git = "https://github.com/pop-os/iced-sctk" }
sctk = { package = "smithay-client-toolkit", git = "https://github.com/Smithay/client-toolkit", version = "0.16" }
[workspace]
resolved = "2"
[dependencies.iced]
git = "https://github.com/pop-os/iced.git"
branch = "sctk-cosmic"
# path = "../iced"
default-features = false
features = ["image", "svg", "tokio", "wayland"]
[dependencies.iced_native]
git = "https://github.com/pop-os/iced.git"
branch = "sctk-cosmic"
[dependencies.iced_futures]
git = "https://github.com/pop-os/iced.git"
branch = "sctk-cosmic"
sctk = { package = "smithay-client-toolkit", git = "https://github.com/Smithay/client-toolkit", rev = "73346019952f82ec7e4d4d15f5d66841b54e8b61" }

View file

@ -1,3 +1,5 @@
use cosmic::iced::wayland::SurfaceIdWrapper;
use cosmic::iced::widget;
use iced::widget::Space;
use cosmic::widget::{icon, toggler, horizontal_rule};
@ -10,17 +12,16 @@ use cosmic::iced_style::svg;
use cosmic::theme::{self, Svg};
use cosmic::{iced_style, settings, Element, Theme};
use cosmic::iced::{
self,
executor,
widget::{button, column, row, text, slider},
window, Alignment, Application, Command, Length, Subscription,
};
use iced_sctk::application::SurfaceIdWrapper;
use iced_sctk::command::platform_specific::wayland::window::SctkWindowSettings;
use iced_sctk::commands::popup::{destroy_popup, get_popup};
use iced_sctk::settings::InitialSurface;
use iced_sctk::Color;
use iced_sctk::widget::container;
use iced::wayland::popup::{destroy_popup, get_popup};
use iced::Color;
use iced::widget::container;
mod pulse;
use crate::pulse::DeviceInfo;
@ -96,7 +97,7 @@ impl Application for Audio {
self.theme
}
fn close_requested(&self, _id: iced_sctk::application::SurfaceIdWrapper) -> Self::Message {
fn close_requested(&self, _id: SurfaceIdWrapper) -> Self::Message {
Message::Ignore
}
@ -325,7 +326,7 @@ fn revealer<'a>(
options: Vec<String>,
toggle: Message,
_change: Message,
) -> iced_sctk::widget::Column<'a, Message, Renderer> {
) -> widget::Column<'a, Message, Renderer> {
if open {
options.iter().fold(
column![revealer_head(open, title, selected, toggle)].width(Length::Fill),
@ -341,7 +342,7 @@ fn revealer_head<'a>(
title: &'a str,
selected: String,
toggle: Message,
) -> iced_sctk::widget::Button<Message, Renderer> {
) -> widget::Button<Message, Renderer> {
button(row![row![title].width(Length::Fill), text(selected)])
.width(Length::Fill)
.on_press(toggle)

View file

@ -1,4 +1,4 @@
use iced_native::subscription::{self, Subscription};
use cosmic::iced_native::subscription::{self, Subscription};
use std::cell::RefCell;
use std::{rc::Rc, thread};

File diff suppressed because it is too large Load diff

View file

@ -6,9 +6,7 @@ edition = "2021"
[dependencies]
once_cell = "1.16.0"
libcosmic = { git = "https://github.com/pop-os/libcosmic/", branch = "master", default-features = false, features = ["wayland", "applet"] }
cosmic-panel-config = {git = "https://github.com/pop-os/cosmic-panel", default-features = false }
iced_sctk = { git = "https://github.com/pop-os/iced-sctk" }
sctk = { package = "smithay-client-toolkit", git = "https://github.com/Smithay/client-toolkit", version = "0.16" }
sctk = { package = "smithay-client-toolkit", git = "https://github.com/Smithay/client-toolkit", rev = "73346019952f82ec7e4d4d15f5d66841b54e8b61" }
futures = "0.3"
zbus = { version = "3.5", no-default-features = true }
log = "0.4"
@ -18,10 +16,3 @@ i18n-embed = { version = "0.13.4", features = ["fluent-system", "desktop-request
i18n-embed-fl = "0.6.4"
rust-embed = "6.3.0"
tokio = { version = "1.17.0", features = ["sync", "rt", "rt-multi-thread", "fs"] }
[dependencies.iced]
git = "https://github.com/pop-os/iced.git"
branch = "sctk-cosmic"
# path = "../iced"
default-features = false
features = ["image", "svg", "tokio", "wayland"]

View file

@ -9,23 +9,18 @@ use crate::upower_kbdbacklight::{
};
use cosmic::applet::CosmicAppletHelper;
use cosmic::iced::alignment::Horizontal;
use cosmic::iced::wayland::SurfaceIdWrapper;
use cosmic::iced::wayland::popup::{destroy_popup, get_popup};
use cosmic::iced::{
executor,
widget::{button, column, row, text, slider},
window, Alignment, Application, Command, Length, Subscription,
};
use cosmic::iced_native::window::Settings;
use cosmic::iced_style::application::{self, Appearance};
use cosmic::iced_style::svg;
use cosmic::iced_style::{svg, Color};
use cosmic::theme::{self, Svg};
use cosmic::widget::{icon, toggler, horizontal_rule};
use cosmic::{iced_style, settings, Element, Theme};
use cosmic_panel_config::{PanelAnchor, PanelSize};
use iced_sctk::application::SurfaceIdWrapper;
use iced_sctk::command::platform_specific::wayland::window::SctkWindowSettings;
use iced_sctk::commands::popup::{destroy_popup, get_popup};
use iced_sctk::settings::InitialSurface;
use iced_sctk::Color;
use std::time::Duration;
use tokio::sync::mpsc::UnboundedSender;
@ -206,10 +201,10 @@ impl Application for CosmicBatteryApplet {
self.applet_helper.popup_container(
column![
row![
icon(&self.icon_name, 24)
icon(&*self.icon_name, 24)
.style(Svg::Custom(|theme| {
svg::Appearance {
fill: Some(theme.palette().text),
color: Some(theme.palette().text),
}
}))
.width(Length::Units(24))
@ -228,7 +223,7 @@ impl Application for CosmicBatteryApplet {
icon("display-brightness-symbolic", 24)
.style(Svg::Custom(|theme| {
svg::Appearance {
fill: Some(theme.palette().text),
color: Some(theme.palette().text),
}
}))
.width(Length::Units(24))
@ -247,7 +242,7 @@ impl Application for CosmicBatteryApplet {
icon("keyboard-brightness-symbolic", 24)
.style(Svg::Custom(|theme| {
svg::Appearance {
fill: Some(theme.palette().text),
color: Some(theme.palette().text),
}
}))
.width(Length::Units(24))
@ -311,7 +306,7 @@ impl Application for CosmicBatteryApplet {
self.theme
}
fn close_requested(&self, _id: iced_sctk::application::SurfaceIdWrapper) -> Self::Message {
fn close_requested(&self, _id: SurfaceIdWrapper) -> Self::Message {
Message::Ignore
}

View file

@ -12,7 +12,7 @@ use std::{
};
use cosmic::iced;
use iced_sctk::subscription;
use iced::subscription;
use tokio::sync::mpsc::{UnboundedReceiver, UnboundedSender, unbounded_channel};
const BACKLIGHT_SYSDIR: &str = "/sys/class/backlight";

File diff suppressed because it is too large Load diff

View file

@ -8,7 +8,5 @@ edition = "2021"
[dependencies]
zbus = "3.4"
libcosmic = { git = "https://github.com/pop-os/libcosmic/", branch = "master", default-features = false, features = ["wayland", "applet"] }
cosmic-panel-config = {git = "https://github.com/pop-os/cosmic-panel", default-features = false }
iced_sctk = { git = "https://github.com/pop-os/iced-sctk" }
sctk = { package = "smithay-client-toolkit", git = "https://github.com/Smithay/client-toolkit" }
sctk = { package = "smithay-client-toolkit", git = "https://github.com/Smithay/client-toolkit", rev = "73346019952f82ec7e4d4d15f5d66841b54e8b61" }

View file

@ -3,12 +3,8 @@ mod graphics;
mod window;
use cosmic::{
iced::{sctk_settings::InitialSurface, Application},
iced_native::command::platform_specific::wayland::window::SctkWindowSettings,
iced_native::window::Settings,
settings, applet::CosmicAppletHelper,
iced::Application, applet::CosmicAppletHelper,
};
use cosmic_panel_config::PanelSize;
use window::*;
pub fn main() -> cosmic::iced::Result {

View file

@ -1,6 +1,10 @@
use crate::dbus::{self, PowerDaemonProxy};
use crate::graphics::{get_current_graphics, set_graphics, Graphics};
use cosmic::applet::{CosmicAppletHelper};
use cosmic::iced::wayland::SurfaceIdWrapper;
use cosmic::iced::wayland::popup::{destroy_popup, get_popup};
use cosmic::iced_native::alignment::Horizontal;
use cosmic::iced_style::Color;
use cosmic::iced_style::application::{self, Appearance};
use cosmic::theme::Button;
use cosmic::{
@ -10,12 +14,8 @@ use cosmic::{
theme::Theme,
widget::{horizontal_rule},
Element,
applet::cosmic_panel_config::{PanelAnchor, PanelSize}
};
use cosmic_panel_config::{PanelAnchor, PanelSize};
use iced_sctk::alignment::Horizontal;
use iced_sctk::application::SurfaceIdWrapper;
use iced_sctk::commands::popup::{destroy_popup, get_popup};
use iced_sctk::Color;
use zbus::Connection;
#[derive(Clone, Copy)]

File diff suppressed because it is too large Load diff

View file

@ -6,14 +6,12 @@ license = "GPL-3.0-or-later"
[dependencies]
once_cell = "1.16.0"
cosmic-dbus-networkmanager = { git = "https://github.com/pop-os/dbus-settings-bindings" }
cosmic-dbus-networkmanager = { git = "https://github.com/pop-os/dbus-settings-bindings", branch = "deps" }
futures-util = "0.3.21"
libcosmic = { git = "https://github.com/pop-os/libcosmic/", branch = "master", default-features = false, features = ["wayland", "applet"] }
cosmic-panel-config = {git = "https://github.com/pop-os/cosmic-panel", default-features = false }
iced_sctk = { git = "https://github.com/pop-os/iced-sctk" }
sctk = { package = "smithay-client-toolkit", git = "https://github.com/Smithay/client-toolkit", version = "0.16" }
sctk = { package = "smithay-client-toolkit", git = "https://github.com/Smithay/client-toolkit", rev = "73346019952f82ec7e4d4d15f5d66841b54e8b61" }
futures = "0.3"
zbus = { version = "3.5", no-default-features = true }
zbus = { version = "3.6.2", no-default-features = true }
log = "0.4"
pretty_env_logger = "0.4"
# Application i18n
@ -23,10 +21,3 @@ rust-embed = "6.3.0"
itertools = "0.10.3"
slotmap = "1.0.6"
tokio = { version = "1.15.0", features = ["full"] }
[dependencies.iced]
git = "https://github.com/pop-os/iced.git"
branch = "sctk-cosmic"
# path = "../iced"
default-features = false
features = ["image", "svg", "tokio"]

View file

@ -3,7 +3,7 @@ use cosmic::{
iced::{
executor,
widget::{column, container, row, scrollable, text},
Alignment, Application, Color, Command, Length, Subscription,
Alignment, Application, Color, Command, Length, Subscription, wayland::{popup::{destroy_popup, get_popup}, SurfaceIdWrapper},
},
iced_native::window,
iced_style::{application, svg},
@ -12,10 +12,6 @@ use cosmic::{
Element, Theme,
};
use futures::channel::mpsc::UnboundedSender;
use iced_sctk::{
application::SurfaceIdWrapper,
commands::popup::{destroy_popup, get_popup},
};
use crate::{
config, fl,
@ -187,9 +183,9 @@ impl Application for CosmicNetworkApplet {
.into(),
SurfaceIdWrapper::Popup(_) => {
let name = text(fl!("network")).size(18);
let icon = icon(&self.icon_name, 24)
let icon = icon(&*self.icon_name, 24)
.style(Svg::Custom(|theme| svg::Appearance {
fill: Some(theme.palette().text),
color: Some(theme.palette().text),
}))
.width(Length::Units(24))
.height(Length::Units(24));
@ -331,7 +327,7 @@ impl Application for CosmicNetworkApplet {
self.theme
}
fn close_requested(&self, _id: iced_sctk::application::SurfaceIdWrapper) -> Self::Message {
fn close_requested(&self, _id: SurfaceIdWrapper) -> Self::Message {
Message::Ignore
}

File diff suppressed because it is too large Load diff

View file

@ -96,7 +96,7 @@ impl Application for Notifications {
window::Id::new(0),
new_id,
(400, 300),
Some(60),
None,
None,
);
get_popup(popup_settings)

File diff suppressed because it is too large Load diff

View file

@ -10,28 +10,9 @@ libpulse-binding = "2.26.0"
libpulse-glib-binding = "2.25.0"
tokio = { version = "1.20.1", features=["full"] }
libcosmic = { git = "https://github.com/pop-os/libcosmic/", branch = "master", default-features = false, features = ["wayland", "applet"] }
iced_sctk = { git = "https://github.com/pop-os/iced-sctk" }
sctk = { package = "smithay-client-toolkit", git = "https://github.com/Smithay/client-toolkit", version = "0.16" }
sctk = { package = "smithay-client-toolkit", git = "https://github.com/Smithay/client-toolkit", rev = "73346019952f82ec7e4d4d15f5d66841b54e8b61" }
nix = "0.24.1"
[workspace]
resolved = "2"
[dependencies.iced]
git = "https://github.com/pop-os/iced.git"
branch = "sctk-cosmic"
# path = "../iced"
default-features = false
features = ["image", "svg", "tokio", "wayland"]
[dependencies.iced_native]
git = "https://github.com/pop-os/iced.git"
branch = "sctk-cosmic"
[dependencies.iced_futures]
git = "https://github.com/pop-os/iced.git"
branch = "sctk-cosmic"
# Until the 3.6.3 release, need the implementation of clone on zbus::Error
[dependencies.zbus]
git = "https://gitlab.freedesktop.org/dbus/zbus"

View file

@ -1,8 +1,11 @@
use std::process;
use iced::widget::Space;
use cosmic::applet::CosmicAppletHelper;
use cosmic::iced::wayland::SurfaceIdWrapper;
use cosmic::iced::wayland::popup::{get_popup, destroy_popup};
use cosmic::iced::widget::{self, Row};
use cosmic::iced_native::widget::Space;
use cosmic::widget::{horizontal_rule, icon};
use cosmic::Renderer;
@ -12,15 +15,10 @@ use cosmic::iced::{
window, Alignment, Application, Command, Length, Subscription,
};
use cosmic::iced_style::application::{self, Appearance};
use cosmic::iced_style::svg;
use cosmic::iced_style::{svg, Color};
use cosmic::theme::{self, Svg};
use cosmic::{Element, Theme};
use iced_sctk::application::SurfaceIdWrapper;
use iced_sctk::commands::popup::{destroy_popup, get_popup};
use iced_sctk::widget::Row;
use iced_sctk::Color;
use logind_zbus::manager::ManagerProxy;
use logind_zbus::session::{SessionProxy, SessionType};
use logind_zbus::user::UserProxy;
@ -84,7 +82,7 @@ impl Application for Power {
self.theme
}
fn close_requested(&self, _id: iced_sctk::application::SurfaceIdWrapper) -> Self::Message {
fn close_requested(&self, _id: SurfaceIdWrapper) -> Self::Message {
Message::Ignore
}
@ -196,7 +194,7 @@ impl Application for Power {
// ### UI Helplers
// todo put into libcosmic doing so will fix the row_button's boarder radius
fn row_button(mut content: Vec<Element<Message>>) -> iced_sctk::widget::Button<Message, Renderer> {
fn row_button(mut content: Vec<Element<Message>>) -> widget::Button<Message, Renderer> {
content.insert(0, Space::with_width(Length::Units(24)).into());
content.push(Space::with_width(Length::Units(24)).into());
@ -213,7 +211,7 @@ fn row_button(mut content: Vec<Element<Message>>) -> iced_sctk::widget::Button<M
fn power_buttons<'a>(
name: &'a str,
text: &'a str,
) -> iced_sctk::widget::Button<'a, Message, Renderer> {
) -> widget::Button<'a, Message, Renderer> {
button(
column![text_icon(name, 40), text]
.spacing(5)
@ -226,7 +224,7 @@ fn power_buttons<'a>(
fn text_icon(name: &str, size: u16) -> cosmic::widget::Icon {
icon(name, size).style(Svg::Custom(|theme| svg::Appearance {
fill: Some(theme.palette().text),
color: Some(theme.palette().text),
}))
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -6,12 +6,10 @@ edition = "2021"
[dependencies]
libcosmic = { git = "https://github.com/pop-os/libcosmic/", branch = "master", default-features = false, features = ["wayland", "applet"] }
cosmic-panel-config = {git = "https://github.com/pop-os/cosmic-panel", default-features = false }
iced_sctk = { git = "https://github.com/pop-os/iced-sctk" }
sctk = { package = "smithay-client-toolkit", git = "https://github.com/Smithay/client-toolkit", version = "0.16" }
sctk = { package = "smithay-client-toolkit", git = "https://github.com/Smithay/client-toolkit", rev = "73346019952f82ec7e4d4d15f5d66841b54e8b61" }
cosmic-protocols = { git = "https://github.com/pop-os/cosmic-protocols", default-features = false, features = ["client"] }
wayland-backend = {version = "0.1.0-beta.13", features = ["client_system"]}
wayland-client = {version = "0.30.0-beta.13"}
wayland-backend = {version = "0.1.0-beta.14", features = ["client_system"]}
wayland-client = {version = "0.30.0-beta.14"}
calloop = "0.10.1"
nix = "0.26.1"
log = "0.4"
@ -24,10 +22,3 @@ anyhow = "1.0"
i18n-embed = { version = "0.13.4", features = ["fluent-system", "desktop-requester"] }
i18n-embed-fl = "0.6.4"
rust-embed = "6.3.0"
[patch.crates-io]
wayland-protocols = { git = "https://github.com/smithay/wayland-rs", version = "0.30.0-beta.13"}
wayland-sys = { git = "https://github.com/smithay/wayland-rs", version = "0.30.0-beta.13"}
wayland-backend = { git = "https://github.com/smithay/wayland-rs", version = "0.1.0-beta.13"}
wayland-scanner = { git = "https://github.com/smithay/wayland-rs", version = "0.30.0-beta.13"}
wayland-client = { git = "https://github.com/smithay/wayland-rs", version = "0.30.0-beta.13"}

View file

@ -1,22 +1,21 @@
use std::cmp::Ordering;
use calloop::channel::SyncSender;
use cosmic::applet::CosmicAppletHelper;
use cosmic::applet::cosmic_panel_config::PanelAnchor;
use cosmic::iced::alignment::{Horizontal, Vertical};
use cosmic::iced::mouse::{self, ScrollDelta};
use cosmic::iced::wayland::actions::window::SctkWindowSettings;
use cosmic::iced::widget::{column, container, row, text};
use cosmic::iced::{
executor, subscription, widget::button, window, Application, Command, Event::Mouse, Length,
Settings, Subscription,
};
use cosmic::iced_style::Color;
use cosmic::iced_style::application::{self, Appearance};
use cosmic::theme::Button;
use cosmic::{Element, Theme};
use cosmic_panel_config::PanelAnchor;
use cosmic_protocols::workspace::v1::client::zcosmic_workspace_handle_v1;
use iced_sctk::application::SurfaceIdWrapper;
use iced_sctk::command::platform_specific::wayland::window::SctkWindowSettings;
use iced_sctk::settings::InitialSurface;
use iced_sctk::{commands, Color};
use cosmic::iced::wayland::{SurfaceIdWrapper, InitialSurface, window::resize_window};
use wayland_backend::client::ObjectId;
use crate::config;
@ -100,7 +99,7 @@ impl Application for IcedWorkspacesApplet {
Layout::Row => (unit * self.workspaces.len().max(1) as u32, unit),
Layout::Column => (unit, unit * self.workspaces.len().max(1) as u32),
};
return commands::window::resize_window(window::Id::new(0), w, h);
return resize_window(window::Id::new(0), w, h);
}
WorkspacesUpdate::Started(tx) => {
self.workspace_tx.replace(tx);
@ -197,7 +196,7 @@ impl Application for IcedWorkspacesApplet {
self.theme
}
fn close_requested(&self, _id: iced_sctk::application::SurfaceIdWrapper) -> Self::Message {
fn close_requested(&self, _id: SurfaceIdWrapper) -> Self::Message {
unimplemented!()
}

View file

@ -1,5 +1,5 @@
use calloop::channel::*;
use cosmic_panel_config::CosmicPanelOuput;
use cosmic::applet::cosmic_panel_config::CosmicPanelOuput;
use cosmic_protocols::workspace::v1::client::{
zcosmic_workspace_group_handle_v1::{self, ZcosmicWorkspaceGroupHandleV1},
zcosmic_workspace_handle_v1::{self, ZcosmicWorkspaceHandleV1},

65
debian/rules vendored
View file

@ -12,73 +12,10 @@ override_dh_shlibdeps:
override_dh_auto_clean:
if test "${CLEAN}" = "1"; then \
cd cosmic-applet-graphics; \
cargo clean --manifest-path Cargo.toml; \
cd ../cosmic-applet-workspaces; \
cargo clean --manifest-path Cargo.toml; \
cd ../cosmic-applet-notifications; \
cargo clean --manifest-path Cargo.toml; \
cd ..; \
cargo clean; \
fi
if ! ischroot && test "${VENDOR}" = "1"; then \
cd cosmic-applet-graphics/; \
mkdir -p .cargo; \
cargo vendor --sync Cargo.toml | head -n -1 > .cargo/config; \
echo 'directory = "vendor"' >> .cargo/config; \
tar pcf vendor.tar vendor; \
rm -rf vendor; \
cd ..; \
cd cosmic-applet-workspaces/; \
mkdir -p .cargo; \
cargo vendor --sync Cargo.toml | head -n -1 > .cargo/config; \
echo 'directory = "vendor"' >> .cargo/config; \
tar pcf vendor.tar vendor; \
rm -rf vendor; \
cd ..; \
cd cosmic-applet-battery/; \
mkdir -p .cargo; \
cargo vendor --sync Cargo.toml | head -n -1 > .cargo/config; \
echo 'directory = "vendor"' >> .cargo/config; \
tar pcf vendor.tar vendor; \
rm -rf vendor; \
cd ..; \
cd cosmic-applet-audio/; \
mkdir -p .cargo; \
cargo vendor --sync Cargo.toml | head -n -1 > .cargo/config; \
echo 'directory = "vendor"' >> .cargo/config; \
tar pcf vendor.tar vendor; \
rm -rf vendor; \
cd ..; \
cd cosmic-applet-time/; \
mkdir -p .cargo; \
cargo vendor --sync Cargo.toml | head -n -1 > .cargo/config; \
echo 'directory = "vendor"' >> .cargo/config; \
tar pcf vendor.tar vendor; \
rm -rf vendor; \
cd ..; \
cd cosmic-applet-power/; \
mkdir -p .cargo; \
cargo vendor --sync Cargo.toml | head -n -1 > .cargo/config; \
echo 'directory = "vendor"' >> .cargo/config; \
tar pcf vendor.tar vendor; \
rm -rf vendor; \
cd ..; \
cd cosmic-applet-notifications/; \
mkdir -p .cargo; \
cargo vendor --sync Cargo.toml | head -n -1 > .cargo/config; \
echo 'directory = "vendor"' >> .cargo/config; \
tar pcf vendor.tar vendor; \
rm -rf vendor; \
cd ..; \
cd cosmic-applet-network/; \
mkdir -p .cargo; \
cargo vendor --sync Cargo.toml | head -n -1 > .cargo/config; \
echo 'directory = "vendor"' >> .cargo/config; \
tar pcf vendor.tar vendor; \
rm -rf vendor; \
cd ..; \
cd cosmic-app-list/; \
mkdir -p .cargo; \
cargo vendor --sync Cargo.toml | head -n -1 > .cargo/config; \
echo 'directory = "vendor"' >> .cargo/config; \

View file

@ -28,67 +28,42 @@ workspaces_button_id := 'com.system76.CosmicPanelWorkspacesButton'
build: _extract_vendor
#!/usr/bin/env bash
pushd cosmic-app-list/
cargo build {{cargo_args}}
popd
pushd cosmic-applet-audio/
cargo build {{cargo_args}}
popd
pushd cosmic-applet-network/
cargo build {{cargo_args}}
popd
pushd cosmic-applet-graphics/
cargo build {{cargo_args}}
popd
pushd cosmic-applet-battery/
cargo build {{cargo_args}}
popd
pushd cosmic-applet-power/
cargo build {{cargo_args}}
popd
pushd cosmic-applet-notifications/
cargo build {{cargo_args}}
popd
pushd cosmic-applet-time/
cargo build {{cargo_args}}
popd
pushd cosmic-applet-workspaces/
cargo build {{cargo_args}}
popd
# Installs files into the system
install:
# audio
install -Dm0644 cosmic-applet-audio/data/icons/{{audio_id}}.svg {{iconsdir}}/{{audio_id}}.svg
install -Dm0644 cosmic-applet-audio/data/{{audio_id}}.desktop {{sharedir}}/applications/{{audio_id}}.desktop
install -Dm0755 cosmic-applet-audio/target/release/cosmic-applet-audio {{bindir}}/cosmic-applet-audio
install -Dm0755 target/release/cosmic-applet-audio {{bindir}}/cosmic-applet-audio
# app list
install -Dm0644 cosmic-app-list/data/icons/{{app_list_id}}-symbolic.svg {{iconsdir}}/{{app_list_id}}-symbolic.svg
install -Dm0644 cosmic-app-list/data/icons/{{app_list_id}}.Devel.svg {{iconsdir}}/{{app_list_id}}.Devel.svg
install -Dm0644 cosmic-app-list/data/icons/{{app_list_id}}.svg {{iconsdir}}/{{app_list_id}}.svg
install -Dm0644 cosmic-app-list/data/{{app_list_id}}.desktop {{sharedir}}/applications/{{app_list_id}}.desktop
install -Dm0755 cosmic-app-list/target/release/cosmic-app-list {{bindir}}/cosmic-app-list
install -Dm0755 target/release/cosmic-app-list {{bindir}}/cosmic-app-list
# network
install -Dm0644 cosmic-applet-network/data/icons/{{network_id}}.svg {{iconsdir}}/{{network_id}}.svg
install -Dm0644 cosmic-applet-network/data/{{network_id}}.desktop {{sharedir}}/applications/{{network_id}}.desktop
install -Dm0755 cosmic-applet-network/target/release/cosmic-applet-network {{bindir}}/cosmic-applet-network
install -Dm0755 target/release/cosmic-applet-network {{bindir}}/cosmic-applet-network
# notifications
install -Dm0644 cosmic-applet-notifications/data/icons/{{notifications_id}}.svg {{iconsdir}}/{{notifications_id}}.svg
install -Dm0644 cosmic-applet-notifications/data/{{notifications_id}}.desktop {{sharedir}}/applications/{{notifications_id}}.desktop
install -Dm0755 cosmic-applet-notifications/target/release/cosmic-applet-notifications {{bindir}}/cosmic-applet-notifications
install -Dm0755 target/release/cosmic-applet-notifications {{bindir}}/cosmic-applet-notifications
# power
install -Dm0644 cosmic-applet-power/data/icons/{{power_id}}.svg {{iconsdir}}/{{power_id}}.svg
install -Dm0644 cosmic-applet-power/data/{{power_id}}.desktop {{sharedir}}/applications/{{power_id}}.desktop
install -Dm0755 cosmic-applet-power/target/release/cosmic-applet-power {{bindir}}/cosmic-applet-power
install -Dm0755 target/release/cosmic-applet-power {{bindir}}/cosmic-applet-power
# time
install -Dm0644 cosmic-applet-time/data/icons/{{time_id}}.svg {{iconsdir}}/{{time_id}}.svg
install -Dm0644 cosmic-applet-time/data/{{time_id}}.desktop {{sharedir}}/applications/{{time_id}}.desktop
install -Dm0755 cosmic-applet-time/target/release/cosmic-applet-time {{bindir}}/cosmic-applet-time
install -Dm0755 target/release/cosmic-applet-time {{bindir}}/cosmic-applet-time
# app library button
install -Dm0644 cosmic-panel-app-button/data/icons/{{app_button_id}}.svg {{iconsdir}}/{{app_button_id}}.svg
@ -101,30 +76,21 @@ install:
# graphics
install -Dm0644 cosmic-applet-graphics/data/icons/{{graphics_id}}.svg {{iconsdir}}/{{graphics_id}}.svg
install -Dm0644 cosmic-applet-graphics/data/{{graphics_id}}.desktop {{sharedir}}/applications/{{graphics_id}}.desktop
install -Dm0755 cosmic-applet-graphics/target/release/cosmic-applet-graphics {{bindir}}/cosmic-applet-graphics
install -Dm0755 target/release/cosmic-applet-graphics {{bindir}}/cosmic-applet-graphics
# workspaces
install -Dm0644 cosmic-applet-workspaces/data/icons/{{workspaces_id}}.svg {{iconsdir}}/{{workspaces_id}}.svg
install -Dm0644 cosmic-applet-workspaces/data/{{workspaces_id}}.desktop {{sharedir}}/applications/{{workspaces_id}}.desktop
install -Dm0755 cosmic-applet-workspaces/target/release/cosmic-applet-workspaces {{bindir}}/cosmic-applet-workspaces
install -Dm0755 target/release/cosmic-applet-workspaces {{bindir}}/cosmic-applet-workspaces
# battery
install -Dm0644 cosmic-applet-battery/data/icons/{{battery_id}}.svg {{iconsdir}}/{{battery_id}}.svg
install -Dm0644 cosmic-applet-battery/data/{{battery_id}}.desktop {{sharedir}}/applications/{{battery_id}}.desktop
install -Dm0755 cosmic-applet-battery/target/release/cosmic-applet-battery {{bindir}}/cosmic-applet-battery
install -Dm0755 target/release/cosmic-applet-battery {{bindir}}/cosmic-applet-battery
# Extracts vendored dependencies if vendor=1
_extract_vendor:
#!/usr/bin/env sh
if test {{vendor}} = 1; then
rm -rf vendor; tar pxf vendor.tar
rm -rf cosmic-applet-graphics/vendor; tar xf cosmic-applet-graphics/vendor.tar --directory cosmic-applet-graphics
rm -rf cosmic-applet-workspaces/vendor; tar xf cosmic-applet-workspaces/vendor.tar --directory cosmic-applet-workspaces
rm -rf cosmic-applet-notifications/vendor; tar xf cosmic-applet-notifications/vendor.tar --directory cosmic-applet-notifications
rm -rf cosmic-applet-battery/vendor; tar xf cosmic-applet-battery/vendor.tar --directory cosmic-applet-battery
rm -rf cosmic-applet-audio/vendor; tar xf cosmic-applet-audio/vendor.tar --directory cosmic-applet-audio
rm -rf cosmic-applet-power/vendor; tar xf cosmic-applet-power/vendor.tar --directory cosmic-applet-power
rm -rf cosmic-applet-time/vendor; tar xf cosmic-applet-time/vendor.tar --directory cosmic-applet-time
rm -rf cosmic-applet-network/vendor; tar xf cosmic-applet-network/vendor.tar --directory cosmic-applet-network
rm -rf cosmic-app-list/vendor; tar xf cosmic-app-list/vendor.tar --directory cosmic-app-list
fi