From 247f8347e6eef12e34dc10ce918da6ad3e08a532 Mon Sep 17 00:00:00 2001 From: wiiznokes <78230769+wiiznokes@users.noreply.github.com> Date: Sat, 7 Sep 2024 02:51:42 +0200 Subject: [PATCH 1/4] feat: cosmic-panel-button in multicall --- Cargo.lock | 3 +-- cosmic-applets/Cargo.toml | 1 + cosmic-applets/src/main.rs | 1 + cosmic-panel-button/Cargo.toml | 2 -- cosmic-panel-button/src/{main.rs => lib.rs} | 6 +----- justfile | 2 +- 6 files changed, 5 insertions(+), 10 deletions(-) rename cosmic-panel-button/src/{main.rs => lib.rs} (96%) diff --git a/Cargo.lock b/Cargo.lock index 4e8b1dc1..9577cfc5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1214,6 +1214,7 @@ dependencies = [ "cosmic-applet-tiling", "cosmic-applet-time", "cosmic-applet-workspaces", + "cosmic-panel-button", "libcosmic", "tracing", "tracing-log", @@ -1317,8 +1318,6 @@ dependencies = [ "libcosmic", "serde", "tracing", - "tracing-log", - "tracing-subscriber", ] [[package]] diff --git a/cosmic-applets/Cargo.toml b/cosmic-applets/Cargo.toml index da171d59..ed7cfc89 100644 --- a/cosmic-applets/Cargo.toml +++ b/cosmic-applets/Cargo.toml @@ -18,6 +18,7 @@ cosmic-applet-tiling = { path = "../cosmic-applet-tiling" } cosmic-applet-time = { path = "../cosmic-applet-time" } cosmic-applet-workspaces = { path = "../cosmic-applet-workspaces" } cosmic-applet-input-sources = { path = "../cosmic-applet-input-sources"} +cosmic-panel-button = { path = "../cosmic-panel-button"} libcosmic.workspace = true tracing.workspace = true tracing-subscriber.workspace = true diff --git a/cosmic-applets/src/main.rs b/cosmic-applets/src/main.rs index d60bd508..42acd57d 100644 --- a/cosmic-applets/src/main.rs +++ b/cosmic-applets/src/main.rs @@ -30,6 +30,7 @@ fn main() -> cosmic::iced::Result { "cosmic-applet-time" => cosmic_applet_time::run(), "cosmic-applet-workspaces" => cosmic_applet_workspaces::run(), "cosmic-applet-input-sources" => cosmic_applet_input_sources::run(), + "cosmic-panel-button" => cosmic_panel_button::run(), _ => return Ok(()), } } diff --git a/cosmic-panel-button/Cargo.toml b/cosmic-panel-button/Cargo.toml index 8f49828d..42784117 100644 --- a/cosmic-panel-button/Cargo.toml +++ b/cosmic-panel-button/Cargo.toml @@ -7,8 +7,6 @@ license = "GPL-3.0" [dependencies] freedesktop-desktop-entry.workspace = true libcosmic.workspace = true -tracing-log.workspace = true -tracing-subscriber.workspace = true tracing.workspace = true cosmic-config.workspace = true serde.workspace = true diff --git a/cosmic-panel-button/src/main.rs b/cosmic-panel-button/src/lib.rs similarity index 96% rename from cosmic-panel-button/src/main.rs rename to cosmic-panel-button/src/lib.rs index 9ca43fa4..33dc5f46 100644 --- a/cosmic-panel-button/src/main.rs +++ b/cosmic-panel-button/src/lib.rs @@ -143,11 +143,7 @@ impl cosmic::Application for Button { } } -pub fn main() -> iced::Result { - tracing_subscriber::fmt::init(); - let _ = tracing_log::LogTracer::init(); - tracing::info!("Starting panel button applet with version {VERSION}"); - +pub fn run() -> iced::Result { let id = env::args() .nth(1) .expect("Requires desktop file id as argument."); diff --git a/justfile b/justfile index 3840ff72..c6c9ddac 100644 --- a/justfile +++ b/justfile @@ -51,7 +51,7 @@ _install_applet id name: (_install_icons name) \ _install_button id name: (_install_icons name) (_install_desktop name + '/data/' + id + '.desktop') # Installs files into the system -install: (_install_bin 'cosmic-applets') (_install_applet 'com.system76.CosmicAppList' 'cosmic-app-list') (_install_default_schema 'cosmic-app-list') (_install_applet 'com.system76.CosmicAppletAudio' 'cosmic-applet-audio') (_install_applet 'com.system76.CosmicAppletInputSources' 'cosmic-applet-input-sources') (_install_applet 'com.system76.CosmicAppletBattery' 'cosmic-applet-battery') (_install_applet 'com.system76.CosmicAppletBluetooth' 'cosmic-applet-bluetooth') (_install_applet 'com.system76.CosmicAppletMinimize' 'cosmic-applet-minimize') (_install_applet 'com.system76.CosmicAppletNetwork' 'cosmic-applet-network') (_install_applet 'com.system76.CosmicAppletNotifications' 'cosmic-applet-notifications') (_install_applet 'com.system76.CosmicAppletPower' 'cosmic-applet-power') (_install_applet 'com.system76.CosmicAppletStatusArea' 'cosmic-applet-status-area') (_install_applet 'com.system76.CosmicAppletTiling' 'cosmic-applet-tiling') (_install_applet 'com.system76.CosmicAppletTime' 'cosmic-applet-time') (_install_applet 'com.system76.CosmicAppletWorkspaces' 'cosmic-applet-workspaces') (_install_bin 'cosmic-panel-button') (_install_button 'com.system76.CosmicPanelAppButton' 'cosmic-panel-app-button') (_install_button 'com.system76.CosmicPanelLauncherButton' 'cosmic-panel-launcher-button') (_install_button 'com.system76.CosmicPanelWorkspacesButton' 'cosmic-panel-workspaces-button') +install: (_install_bin 'cosmic-applets') (_link_applet 'cosmic-panel-button') (_install_applet 'com.system76.CosmicAppList' 'cosmic-app-list') (_install_default_schema 'cosmic-app-list') (_install_applet 'com.system76.CosmicAppletAudio' 'cosmic-applet-audio') (_install_applet 'com.system76.CosmicAppletInputSources' 'cosmic-applet-input-sources') (_install_applet 'com.system76.CosmicAppletBattery' 'cosmic-applet-battery') (_install_applet 'com.system76.CosmicAppletBluetooth' 'cosmic-applet-bluetooth') (_install_applet 'com.system76.CosmicAppletMinimize' 'cosmic-applet-minimize') (_install_applet 'com.system76.CosmicAppletNetwork' 'cosmic-applet-network') (_install_applet 'com.system76.CosmicAppletNotifications' 'cosmic-applet-notifications') (_install_applet 'com.system76.CosmicAppletPower' 'cosmic-applet-power') (_install_applet 'com.system76.CosmicAppletStatusArea' 'cosmic-applet-status-area') (_install_applet 'com.system76.CosmicAppletTiling' 'cosmic-applet-tiling') (_install_applet 'com.system76.CosmicAppletTime' 'cosmic-applet-time') (_install_applet 'com.system76.CosmicAppletWorkspaces' 'cosmic-applet-workspaces') (_install_bin 'cosmic-panel-button') (_install_button 'com.system76.CosmicPanelAppButton' 'cosmic-panel-app-button') (_install_button 'com.system76.CosmicPanelLauncherButton' 'cosmic-panel-launcher-button') (_install_button 'com.system76.CosmicPanelWorkspacesButton' 'cosmic-panel-workspaces-button') # Vendor Cargo dependencies locally vendor: From a19ec2743282416d50637f41117eece548c22e8c Mon Sep 17 00:00:00 2001 From: wiiznokes <78230769+wiiznokes@users.noreply.github.com> Date: Sun, 8 Sep 2024 16:19:13 +0200 Subject: [PATCH 2/4] add main file --- Cargo.lock | 2 ++ cosmic-panel-button/Cargo.toml | 2 ++ cosmic-panel-button/src/lib.rs | 2 -- cosmic-panel-button/src/main.rs | 13 +++++++++++++ 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 cosmic-panel-button/src/main.rs diff --git a/Cargo.lock b/Cargo.lock index 9577cfc5..604f8859 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1318,6 +1318,8 @@ dependencies = [ "libcosmic", "serde", "tracing", + "tracing-log", + "tracing-subscriber", ] [[package]] diff --git a/cosmic-panel-button/Cargo.toml b/cosmic-panel-button/Cargo.toml index 42784117..f8cd16f2 100644 --- a/cosmic-panel-button/Cargo.toml +++ b/cosmic-panel-button/Cargo.toml @@ -8,5 +8,7 @@ license = "GPL-3.0" freedesktop-desktop-entry.workspace = true libcosmic.workspace = true tracing.workspace = true +tracing-subscriber.workspace = true +tracing-log.workspace = true cosmic-config.workspace = true serde.workspace = true diff --git a/cosmic-panel-button/src/lib.rs b/cosmic-panel-button/src/lib.rs index 33dc5f46..bfcf1fce 100644 --- a/cosmic-panel-button/src/lib.rs +++ b/cosmic-panel-button/src/lib.rs @@ -21,8 +21,6 @@ use std::{env, fs, process::Command}; mod config; -const VERSION: &str = env!("CARGO_PKG_VERSION"); - #[derive(Debug, Clone, Default)] struct Desktop { name: String, diff --git a/cosmic-panel-button/src/main.rs b/cosmic-panel-button/src/main.rs new file mode 100644 index 00000000..de9ce36d --- /dev/null +++ b/cosmic-panel-button/src/main.rs @@ -0,0 +1,13 @@ +// Copyright 2023 System76 +// SPDX-License-Identifier: GPL-3.0-only + +const VERSION: &str = env!("CARGO_PKG_VERSION"); + +fn main() -> cosmic::iced::Result { + tracing_subscriber::fmt::init(); + let _ = tracing_log::LogTracer::init(); + + tracing::info!("Starting workspaces applet with version {VERSION}"); + + cosmic_panel_button::run() +} From 95fea40f67b0e395ce53d32292966bee182d7374 Mon Sep 17 00:00:00 2001 From: wiiznokes <78230769+wiiznokes@users.noreply.github.com> Date: Mon, 9 Sep 2024 17:17:18 +0200 Subject: [PATCH 3/4] Update justfile Co-authored-by: Ashley Wulber <48420062+wash2@users.noreply.github.com> --- justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/justfile b/justfile index c6c9ddac..c798ba82 100644 --- a/justfile +++ b/justfile @@ -51,7 +51,7 @@ _install_applet id name: (_install_icons name) \ _install_button id name: (_install_icons name) (_install_desktop name + '/data/' + id + '.desktop') # Installs files into the system -install: (_install_bin 'cosmic-applets') (_link_applet 'cosmic-panel-button') (_install_applet 'com.system76.CosmicAppList' 'cosmic-app-list') (_install_default_schema 'cosmic-app-list') (_install_applet 'com.system76.CosmicAppletAudio' 'cosmic-applet-audio') (_install_applet 'com.system76.CosmicAppletInputSources' 'cosmic-applet-input-sources') (_install_applet 'com.system76.CosmicAppletBattery' 'cosmic-applet-battery') (_install_applet 'com.system76.CosmicAppletBluetooth' 'cosmic-applet-bluetooth') (_install_applet 'com.system76.CosmicAppletMinimize' 'cosmic-applet-minimize') (_install_applet 'com.system76.CosmicAppletNetwork' 'cosmic-applet-network') (_install_applet 'com.system76.CosmicAppletNotifications' 'cosmic-applet-notifications') (_install_applet 'com.system76.CosmicAppletPower' 'cosmic-applet-power') (_install_applet 'com.system76.CosmicAppletStatusArea' 'cosmic-applet-status-area') (_install_applet 'com.system76.CosmicAppletTiling' 'cosmic-applet-tiling') (_install_applet 'com.system76.CosmicAppletTime' 'cosmic-applet-time') (_install_applet 'com.system76.CosmicAppletWorkspaces' 'cosmic-applet-workspaces') (_install_bin 'cosmic-panel-button') (_install_button 'com.system76.CosmicPanelAppButton' 'cosmic-panel-app-button') (_install_button 'com.system76.CosmicPanelLauncherButton' 'cosmic-panel-launcher-button') (_install_button 'com.system76.CosmicPanelWorkspacesButton' 'cosmic-panel-workspaces-button') +install: (_install_bin 'cosmic-applets') (_link_applet 'cosmic-panel-button') (_install_applet 'com.system76.CosmicAppList' 'cosmic-app-list') (_install_default_schema 'cosmic-app-list') (_install_applet 'com.system76.CosmicAppletAudio' 'cosmic-applet-audio') (_install_applet 'com.system76.CosmicAppletInputSources' 'cosmic-applet-input-sources') (_install_applet 'com.system76.CosmicAppletBattery' 'cosmic-applet-battery') (_install_applet 'com.system76.CosmicAppletBluetooth' 'cosmic-applet-bluetooth') (_install_applet 'com.system76.CosmicAppletMinimize' 'cosmic-applet-minimize') (_install_applet 'com.system76.CosmicAppletNetwork' 'cosmic-applet-network') (_install_applet 'com.system76.CosmicAppletNotifications' 'cosmic-applet-notifications') (_install_applet 'com.system76.CosmicAppletPower' 'cosmic-applet-power') (_install_applet 'com.system76.CosmicAppletStatusArea' 'cosmic-applet-status-area') (_install_applet 'com.system76.CosmicAppletTiling' 'cosmic-applet-tiling') (_install_applet 'com.system76.CosmicAppletTime' 'cosmic-applet-time') (_install_applet 'com.system76.CosmicAppletWorkspaces' 'cosmic-applet-workspaces') (_install_button 'com.system76.CosmicPanelAppButton' 'cosmic-panel-app-button') (_install_button 'com.system76.CosmicPanelLauncherButton' 'cosmic-panel-launcher-button') (_install_button 'com.system76.CosmicPanelWorkspacesButton' 'cosmic-panel-workspaces-button') # Vendor Cargo dependencies locally vendor: From 6942c59b9f729c34c8544cc428bd2f701b71af3f Mon Sep 17 00:00:00 2001 From: wiiznokes <78230769+wiiznokes@users.noreply.github.com> Date: Mon, 9 Sep 2024 17:19:05 +0200 Subject: [PATCH 4/4] Update links --- debian/links | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/links b/debian/links index e7fcab0a..0521a5c8 100644 --- a/debian/links +++ b/debian/links @@ -11,3 +11,4 @@ /usr/bin/cosmic-applets /usr/bin/cosmic-applet-time /usr/bin/cosmic-applets /usr/bin/cosmic-applet-workspaces /usr/bin/cosmic-applets /usr/bin/cosmic-applet-input-sources +/usr/bin/cosmic-applets /usr/bin/cosmic-panel-button