Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the system-monitor applet #626

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
cosmic-ext-applet-clipboard-manager
cosmic-ext-applet-emoji-selector
cosmic-ext-applet-external-monitor-brightness
cosmic-ext-applet-system-monitor
cosmic-ext-calculator
cosmic-ext-ctl
examine
Expand Down
62 changes: 62 additions & 0 deletions pkgs/cosmic-ext-applet-system-monitor/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
lib,
fetchFromGitHub,
libcosmicAppHook,
rustPlatform,
just,
pkgs,
stdenv,
nix-update-script,
}:

rustPlatform.buildRustPackage {
pname = "cosmic-ext-applet-system-monitor";
version = "0-unstable-2025-02-03";

src = fetchFromGitHub {
owner = "D-Brox";
repo = "cosmic-ext-applet-system-monitor";
rev = "f29debf726551df521aa26070c8efc54d7c0a714";
hash = "sha256-JR1x84c7C0BNwt2QuFKLXiwGX5Pke6B1a8QotOFf68Y=";
};

useFetchCargoVendor = true;
cargoPatches = [ ./pin-sctk.patch ];
cargoHash = "sha256-yuV+U5FMNbGevXEp02ucsqyrqqvyJLXydYsyOOkj/00=";

buildInputs = with pkgs; [ fontconfig ];
nativeBuildInputs = with pkgs; [
libcosmicAppHook
just
pkg-config
];

dontUseJustBuild = true;
dontUseJustCheck = true;

justFlags = [
"--set"
"prefix"
(placeholder "out")
"--set"
"bin-src"
"target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/cosmic-ext-applet-system-monitor"
];

preCheck = ''
export XDG_RUNTIME_DIR="$TMP"
'';

passthru.updateScript = nix-update-script { };

meta = {
homepage = "https://github.com/D-Brox/cosmic-ext-applet-system-monitor";
description = "Highly configurable system resource monitor for the COSMIC Desktop Environment";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [
# lilyinstarlight
];
platforms = lib.platforms.linux;
mainProgram = "cosmic-ext-applet-system-monitor";
};
}
167 changes: 167 additions & 0 deletions pkgs/cosmic-ext-applet-system-monitor/pin-sctk.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
diff --git a/Cargo.lock b/Cargo.lock
index 791f5af..338657e 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -692,38 +692,13 @@ dependencies = [
"thiserror",
]

-[[package]]
-name = "calloop"
-version = "0.14.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "10929724661d1c43856fd87c7a127ae944ec55579134fb485e4136fb6a46fdcb"
-dependencies = [
- "bitflags 2.8.0",
- "polling 3.7.4",
- "rustix 0.38.44",
- "slab",
- "tracing",
-]
-
[[package]]
name = "calloop-wayland-source"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20"
dependencies = [
- "calloop 0.13.0",
- "rustix 0.38.44",
- "wayland-backend",
- "wayland-client",
-]
-
-[[package]]
-name = "calloop-wayland-source"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "876a7a1dbbe026a55ef47a500b123af5a9a0914520f061d467914cf21be95daf"
-dependencies = [
- "calloop 0.14.2",
+ "calloop",
"rustix 0.38.44",
"wayland-backend",
"wayland-client",
@@ -980,7 +955,7 @@ source = "git+https://github.com/pop-os/cosmic-protocols?rev=d218c76#d218c76b58c
dependencies = [
"cosmic-protocols",
"libc",
- "smithay-client-toolkit 0.19.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "smithay-client-toolkit",
"wayland-client",
"wayland-protocols",
]
@@ -1051,7 +1026,7 @@ dependencies = [
"cosmic-config",
"ron 0.8.1",
"serde",
- "smithay-client-toolkit 0.19.2 (git+https://github.com/Smithay/client-toolkit)",
+ "smithay-client-toolkit",
"tracing",
"wayland-protocols-wlr",
"xdg-shell-wrapper-config",
@@ -1360,7 +1335,7 @@ dependencies = [
"bitflags 2.8.0",
"mime",
"raw-window-handle",
- "smithay-client-toolkit 0.19.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "smithay-client-toolkit",
"smithay-clipboard",
]

@@ -4473,7 +4448,7 @@ dependencies = [
"ab_glyph",
"log",
"memmap2 0.9.5",
- "smithay-client-toolkit 0.19.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "smithay-client-toolkit",
"tiny-skia",
]

@@ -4642,35 +4617,8 @@ checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016"
dependencies = [
"bitflags 2.8.0",
"bytemuck",
- "calloop 0.13.0",
- "calloop-wayland-source 0.3.0",
- "cursor-icon",
- "libc",
- "log",
- "memmap2 0.9.5",
- "pkg-config",
- "rustix 0.38.44",
- "thiserror",
- "wayland-backend",
- "wayland-client",
- "wayland-csd-frame",
- "wayland-cursor",
- "wayland-protocols",
- "wayland-protocols-wlr",
- "wayland-scanner",
- "xkbcommon",
- "xkeysym",
-]
-
-[[package]]
-name = "smithay-client-toolkit"
-version = "0.19.2"
-source = "git+https://github.com/Smithay/client-toolkit#ca6a36e4d5f4a171eea91eabe7c8ab9b17fa98e0"
-dependencies = [
- "bitflags 2.8.0",
- "bytemuck",
- "calloop 0.14.2",
- "calloop-wayland-source 0.4.0",
+ "calloop",
+ "calloop-wayland-source",
"cursor-icon",
"libc",
"log",
@@ -4696,7 +4644,7 @@ source = "git+https://github.com/pop-os/smithay-clipboard?tag=pop-dnd-5#5a3007de
dependencies = [
"libc",
"raw-window-handle",
- "smithay-client-toolkit 0.19.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "smithay-client-toolkit",
"wayland-backend",
]

@@ -5079,7 +5027,6 @@ version = "0.1.41"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0"
dependencies = [
- "log",
"pin-project-lite",
"tracing-attributes",
"tracing-core",
@@ -6063,7 +6010,7 @@ dependencies = [
"bitflags 2.8.0",
"block2",
"bytemuck",
- "calloop 0.13.0",
+ "calloop",
"cfg_aliases 0.2.1",
"concurrent-queue",
"core-foundation",
@@ -6085,7 +6032,7 @@ dependencies = [
"redox_syscall 0.4.1",
"rustix 0.38.44",
"sctk-adwaita",
- "smithay-client-toolkit 0.19.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "smithay-client-toolkit",
"smol_str",
"tracing",
"unicode-segmentation",
diff --git a/Cargo.toml b/Cargo.toml
index 81563c3..82c5ebd 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -29,6 +29,9 @@ features = ["applet", "tokio", "wayland"]
version = "0.15"
features = ["fluent-system", "desktop-requester"]

+[patch."https://github.com/smithay/client-toolkit.git"]
+sctk = { package = "smithay-client-toolkit", version = "=0.19.2" }
+
[package.metadata.deb]
license-file = "LICENSE"
assets = [