Compare commits

..

No commits in common. "local/yoda-main" and "post-1.6-merge-20260819" have entirely different histories.

9 changed files with 424 additions and 275 deletions

574
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,7 @@
[package]
name = "cosmic-session"
description = "The session manager for the COSMIC desktop environment"
version = "1.9.0"
version = "1.3.0"
license = "GPL-3.0-only"
edition = "2024"
rust-version = "1.93"

View file

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
set -e
@ -23,8 +23,8 @@ fi
if [ -n "${SHELL}" ]; then
# --in-login-shell: our flag to indicate that we don't need to recurse any further
if [ "${1}" != "--in-login-shell" ]; then
# `-l`: start $SHELL as a login shell so it sources the user's profile.
exec "${SHELL}" -l -c "${0} --in-login-shell"
# `exec -l`: like `login`, prefixes $SHELL with a hyphen to start a login shell
exec bash -c "exec -l '${SHELL}' -c '${0} --in-login-shell'"
fi
fi
@ -42,7 +42,7 @@ export DCONF_PROFILE=cosmic
# Set the QT platform theme to CuteCosmic. Fallback to qt6ct if CuteCosmic is not installed.
if [ -z "$QT_QPA_PLATFORMTHEME" ]; then
export QT_QPA_PLATFORMTHEME=cosmic
for QT_PLUGIN_PATH in /usr/lib*/qt6/plugins /usr/lib/*/qt6/plugins; do
for QT_PLUGIN_PATH in /usr/lib{*,/*}/qt6/plugins; do
if [ -f "${QT_PLUGIN_PATH}/platformthemes/libcutecosmictheme.so" ]; then
# CuteCosmic found, no need for a fallback.
export QT_QPA_PLATFORMTHEME=cosmic
@ -56,8 +56,8 @@ if [ -z "$QT_QPA_PLATFORMTHEME" ]; then
fi
# Start gnome keyring components if the daemon is active
# -> check if $XDG_RUNTIME_DIR/keyring exists
if [ -d "$XDG_RUNTIME_DIR/keyring" ]; then
# -> check if /run/user/$UID/keyring exists
if [ -d "/run/user/$(id -u)/keyring" ]; then
# Use PATH lookup instead of hardcoding /usr/bin
if command -v gnome-keyring-daemon >/dev/null 2>&1; then
@ -69,10 +69,10 @@ if [ -d "$XDG_RUNTIME_DIR/keyring" ]; then
# Only set SSH_AUTH_SOCK if the socket actually exists. Either
# set the correct one, or don't set one at all. Don't set the
# wrong value.
if [ -S "$XDG_RUNTIME_DIR/gcr/ssh" ]; then
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gcr/ssh"
elif [ -S "$XDG_RUNTIME_DIR/keyring/ssh" ]; then
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/keyring/ssh"
if [ -S "/run/user/$(id -u)/gcr/ssh" ]; then
export SSH_AUTH_SOCK="/run/user/$(id -u)/gcr/ssh"
elif [ -S "/run/user/$(id -u)/keyring/ssh" ]; then
export SSH_AUTH_SOCK="/run/user/$(id -u)/keyring/ssh"
fi
fi
@ -84,26 +84,30 @@ if command -v systemctl >/dev/null; then
# For environment variables already imported into the user's
# session, if the value imported differs from the value in this
# environment, update it.
systemctl --user show-environment | while IFS= read -r env_var; do
mapfile -t existing_env_vars < <(systemctl --user show-environment)
for env_var in "${existing_env_vars[@]}"; do
env_var_name="${env_var%%=*}"
env_var_value="$(printenv "${env_var_name}" || true)"
env_var_value=${!env_var_name:-}
# Skip current iteration if the environment variable's value
# in the current envionment is unset.
if [ -z "${env_var_value}" ]; then
if [[ -z "${env_var_value}" ]]; then
continue
fi
# Skip updating variables where systemd already holds this exact value.
if [ "${env_var}" = "${env_var_name}=${env_var_value}" ]; then
env_var_val_str_to_compare="${env_var_name}=${env_var_value}"
env_var_val_str_to_compare_ansi_c_quoted="${env_var_name}=\$'$(printf '%q' "${env_var_value}")'"
if [[ "${env_var}" == "${env_var_val_str_to_compare}" ]]; then
continue
elif [[ "${env_var}" == "${env_var_val_str_to_compare_ansi_c_quoted}" ]]; then
continue
fi
systemctl --user import-environment "${env_var_name}" || true
systemctl --user import-environment "${env_var_name}" ||:
done
fi
# Run cosmic-session
if [ -z "${DBUS_SESSION_BUS_ADDRESS}" ]; then
if [[ -z "${DBUS_SESSION_BUS_ADDRESS}" ]]; then
exec /usr/bin/dbus-run-session -- /usr/bin/cosmic-session
else
exec /usr/bin/cosmic-session

6
debian/changelog vendored
View file

@ -1,9 +1,3 @@
cosmic-session (1.9.0) noble; urgency=medium
* Epoch 1.9.0 version update
-- Michael Murphy <michael@mmurphy.dev> Mon, 14 Sep 2026 17:54:45 +0200
cosmic-session (1.0.0) noble; urgency=medium
* Initial release

2
debian/control vendored
View file

@ -27,7 +27,6 @@ Depends:
cosmic-launcher,
cosmic-notifications,
cosmic-osd,
cosmic-osk,
cosmic-panel,
cosmic-randr,
cosmic-screenshot,
@ -47,7 +46,6 @@ Recommends:
cosmic-player,
cosmic-store,
cosmic-term,
cosmic-viewer,
cosmic-wallpapers,
orca,
system-config-printer,

41
flake.lock generated
View file

@ -1,12 +1,17 @@
{
"nodes": {
"crane": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1788465171,
"narHash": "sha256-Y1/TTVXjYXGF068IThQH9fPSZ0SIE74PABlUxnWTUH0=",
"lastModified": 1702141249,
"narHash": "sha256-8wDpJKbDTDqFmyJfNEJOLrHYDoEzCjCbmz+lSRoU3CI=",
"owner": "ipetkov",
"repo": "crane",
"rev": "eb35abda9f232cc6610b1d1e3200d15c49b7ac54",
"rev": "62fc1a0cbe144c1014d956e603d56bf1ffe69c7d",
"type": "github"
},
"original": {
@ -23,11 +28,11 @@
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1788865058,
"narHash": "sha256-ZkvwEHlSa46BkODMEwHCEh9hlUC2igneJ+noEUn9ww4=",
"lastModified": 1702189261,
"narHash": "sha256-TN6gE1eZddDhAoRrScV6Wji1Nk3uqMIDjGwN5ZesAZk=",
"owner": "nix-community",
"repo": "fenix",
"rev": "9efa138447c5773995d98d9aafa9eba4982aceab",
"rev": "cae060dbaf53430bb2b549ced0affd54d40e6cee",
"type": "github"
},
"original": {
@ -41,11 +46,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"lastModified": 1701680307,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"type": "github"
},
"original": {
@ -56,11 +61,11 @@
},
"nix-filter": {
"locked": {
"lastModified": 1757882181,
"narHash": "sha256-+cCxYIh2UNalTz364p+QYmWHs0P+6wDhiWR4jDIKQIU=",
"lastModified": 1701697642,
"narHash": "sha256-L217WytWZHSY8GW9Gx1A64OnNctbuDbfslaTEofXXRw=",
"owner": "numtide",
"repo": "nix-filter",
"rev": "59c44d1909c72441144b93cf0f054be7fe764de5",
"rev": "c843418ecfd0344ecb85844b082ff5675e02c443",
"type": "github"
},
"original": {
@ -71,11 +76,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1788865024,
"narHash": "sha256-3YkAzvtt4LoE11IcBDzPshIF3fJ0aIoILqE7dAg8CLI=",
"lastModified": 1702206697,
"narHash": "sha256-vE9oEx3Y8TO5MnWwFlmopjHd1JoEBno+EhsfUCq5iR8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "422d1ae605d7fcd9896412b37dc065c456c0eefb",
"rev": "29d6c96900b9b576c2fb89491452f283aa979819",
"type": "github"
},
"original": {
@ -97,11 +102,11 @@
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1788794694,
"narHash": "sha256-FROpcpM2ELawfxhW8cWuz8m3dp/0EFAFCiK+AbNw95w=",
"lastModified": 1702153490,
"narHash": "sha256-F98s0+mUHtqiUk9iCApPTy23YMLmcKqTfsShpIPB40Q=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "48d839420745124e85140234ce783ccd90dab24e",
"rev": "9d87a23cdef6087c1a0c97980949e2310271a941",
"type": "github"
},
"original": {

View file

@ -7,6 +7,7 @@
nix-filter.url = "github:numtide/nix-filter";
crane = {
url = "github:ipetkov/crane";
inputs.nixpkgs.follows = "nixpkgs";
};
fenix = {
url = "github:nix-community/fenix";
@ -18,7 +19,7 @@
flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] (system:
let
pkgs = nixpkgs.legacyPackages.${system};
craneLib = (crane.mkLib pkgs).overrideToolchain fenix.packages.${system}.stable.toolchain;
craneLib = crane.lib.${system}.overrideToolchain fenix.packages.${system}.stable.toolchain;
pkgDef = {
nativeBuildInputs = with pkgs; [ just pkg-config autoPatchelfHook ];
@ -46,7 +47,7 @@
inherit cosmic-session;
};
packages.default = cosmic-session.overrideAttrs (oldAttrs: {
packages.default = cosmic-session.overrideAttrs (oldAttrs: rec {
buildPhase = ''
just prefix=$out xdp_cosmic=/run/current-system/sw/bin/xdg-desktop-portal-cosmic build
'';

View file

@ -122,21 +122,12 @@ pub fn run_compositor(
Ok(tokio::spawn(async move {
// Create a new process handler for cosmic-comp, with our compositor socket's
// file descriptor as the `COSMIC_SESSION_SOCK` environment variable.
let mut comp_env = vec![(
"COSMIC_SESSION_SOCK".to_string(),
comp.as_raw_fd().to_string(),
)];
// NVIDIA keeps a growing pool of pre-rendered compositor frames
// (smithay#1562 / cosmic-comp#1179). Cap it to a single buffer.
if std::path::Path::new("/proc/driver/nvidia").exists() {
comp_env.push(("__GL_MaxFramesAllowed".to_string(), "1".to_string()));
}
process_manager
.start_process(
Process::new()
.with_executable(exec)
.with_args(args)
.with_env(comp_env)
.with_env([("COSMIC_SESSION_SOCK", comp.as_raw_fd().to_string())])
.with_on_exit(move |pman, _, err_code, _will_restart| {
let session_dbus_tx = session_dbus_tx.clone();
async move {

View file

@ -24,9 +24,8 @@ use std::path::PathBuf;
#[cfg(feature = "autostart")]
use std::process::{Command, Stdio};
use std::sync::Arc;
use systemd::is_systemd_used;
#[cfg(feature = "systemd")]
use systemd::{get_systemd_env, spawn_scope};
use systemd::{get_systemd_env, is_systemd_used, spawn_scope};
use tokio::signal::unix::{SignalKind, signal};
use tokio::sync::mpsc::{Receiver, Sender};
use tokio::sync::{Mutex, oneshot};
@ -47,13 +46,6 @@ const ENVIRONMENT_NAME: &'static str = "COSMIC";
#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<()> {
if let Some(arg) = env::args().nth(1)
&& (arg == "--version" || arg == "-V")
{
println!("cosmic-session {}", env!("CARGO_PKG_VERSION"));
return Ok(());
}
color_eyre::install().wrap_err("failed to install color_eyre error handler")?;
let trace = tracing_subscriber::registry();
@ -167,13 +159,6 @@ async fn start(
env_vars.push(("XDG_SESSION_TYPE".to_string(), "wayland".to_string()));
systemd::set_systemd_environment("XDG_SESSION_TYPE", "wayland").await;
// expose the session version
env_vars.push((
"COSMIC_VERSION".to_string(),
env!("CARGO_PKG_VERSION").to_string(),
));
systemd::set_systemd_environment("COSMIC_VERSION", env!("CARGO_PKG_VERSION")).await;
#[cfg(feature = "systemd")]
let _inhibit_fd = if *is_systemd_used() {
match get_systemd_env().await {
@ -339,9 +324,6 @@ async fn start(
let span = info_span!(parent: None, "cosmic-osd");
start_component("cosmic-osd", span, &process_manager, &env_vars).await;
let span = info_span!(parent: None, "cosmic-osk");
start_component("cosmic-osk", span, &process_manager, &env_vars).await;
let span = info_span!(parent: None, "cosmic-bg");
start_component("cosmic-bg", span, &process_manager, &env_vars).await;