Compare commits

..

16 commits

Author SHA1 Message Date
a73b324002 chore: fige Cargo.lock (epoch-1.9.0, [patch] locaux)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 21:03:54 +02:00
d1f2851ec7 merge: epoch-1.9.0 d'upstream
# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	data/cosmic-mimeapps.list
2026-09-24 20:50:58 +02:00
Ashley Wulber
1e4f10b582 Recommend cosmic-viewer and set as default image viewer 2026-09-23 13:41:35 -04:00
r0chd
81dd888ec9 Fix compilation error when autostart feature is enabled without systemd 2026-09-22 10:06:52 -06:00
r0chd
2e0ee1b796 update flake.lock 2026-09-22 10:06:52 -06:00
Jeremy Soller
b712061806 Add cosmic-osk 2026-09-21 13:47:17 -06:00
Christoph Dalski
2770d1155a fix: login shell path interpreted as string by modern shells
The single quotes around the login shell path are interpreted as string by modern shells like nushell.
The exec call breaks.

Tested locally with nushell.

Fixes: #221
2026-09-16 22:02:14 +02:00
Michael Aaron Murphy
cd90a03e3f Epoch 1.9.0 version update
Generated by cosmic-epoch scripts/version-update.sh
2026-09-15 18:44:47 +02:00
Vukašin Vojinović
3ccf897693 feat: set COSMIC_VERSION env var 2026-09-09 18:32:01 +02:00
Vukašin Vojinović
d02ced6297 feat: add version argument 2026-09-09 18:32:01 +02:00
7a4f481ea0 chore: fige Cargo.lock (reordonnancement patch.unused par cargo) 2026-09-04 10:48:53 +02:00
4904c346e8 chore: fige Cargo.lock tel que resolu apres le merge 1.7.0
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-27 07:58:50 +02:00
e1d2eb535b Merge tag 'epoch-1.7.0' into local/yoda-main
Epoch 1.7.0
2026-08-27 07:49:24 +02:00
fa2d2a40ce session: plafonne les trames pre-rendues par le pilote NVIDIA
Passe __GL_MaxFramesAllowed=1 a cosmic-comp lorsque /proc/driver/nvidia
existe. Sans cela le pilote laisse grossir sa file de trames pre-rendues,
ce qui ajoute de la latence a l'affichage (smithay#1562, cosmic-comp#1179).

La variable n'est ajoutee que sur machine NVIDIA ; ailleurs l'environnement
transmis reste le seul COSMIC_SESSION_SOCK.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-21 09:54:33 +02:00
Hugo Osvaldo Barrera
3bdf11741a Fix hardcoded values for XDG_RUNTIME_DIR
Remove hardcoded values and use the proper backing environment variable
instead.
2026-08-19 16:32:48 -06:00
Hugo Osvaldo Barrera
3e2f7368d0 start-cosmic: use sh
Nothing else is cosmic uses bash, so it's only a dependency for a single
script.

Rewrite start-cosmic as a shell script, dropping the dependency on bash.

No AI/LLM-generated code is included in this PR.
2026-08-19 14:16:43 -06:00
9 changed files with 273 additions and 422 deletions

570
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.3.0"
version = "1.9.0"
license = "GPL-3.0-only"
edition = "2024"
rust-version = "1.93"

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
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
# `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'"
# `-l`: start $SHELL as a login shell so it sources the user's profile.
exec "${SHELL}" -l -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; do
for QT_PLUGIN_PATH in /usr/lib*/qt6/plugins /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 /run/user/$UID/keyring exists
if [ -d "/run/user/$(id -u)/keyring" ]; then
# -> check if $XDG_RUNTIME_DIR/keyring exists
if [ -d "$XDG_RUNTIME_DIR/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 "/run/user/$(id -u)/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 "/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"
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"
fi
fi
@ -84,30 +84,26 @@ 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.
mapfile -t existing_env_vars < <(systemctl --user show-environment)
for env_var in "${existing_env_vars[@]}"; do
systemctl --user show-environment | while IFS= read -r env_var; do
env_var_name="${env_var%%=*}"
env_var_value=${!env_var_name:-}
env_var_value="$(printenv "${env_var_name}" || true)"
# 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
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
# Skip updating variables where systemd already holds this exact value.
if [ "${env_var}" = "${env_var_name}=${env_var_value}" ]; then
continue
fi
systemctl --user import-environment "${env_var_name}" ||:
systemctl --user import-environment "${env_var_name}" || true
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,3 +1,9 @@
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,6 +27,7 @@ Depends:
cosmic-launcher,
cosmic-notifications,
cosmic-osd,
cosmic-osk,
cosmic-panel,
cosmic-randr,
cosmic-screenshot,
@ -46,6 +47,7 @@ Recommends:
cosmic-player,
cosmic-store,
cosmic-term,
cosmic-viewer,
cosmic-wallpapers,
orca,
system-config-printer,

41
flake.lock generated
View file

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

View file

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

View file

@ -122,12 +122,21 @@ 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([("COSMIC_SESSION_SOCK", comp.as_raw_fd().to_string())])
.with_env(comp_env)
.with_on_exit(move |pman, _, err_code, _will_restart| {
let session_dbus_tx = session_dbus_tx.clone();
async move {

View file

@ -24,8 +24,9 @@ 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, is_systemd_used, spawn_scope};
use systemd::{get_systemd_env, spawn_scope};
use tokio::signal::unix::{SignalKind, signal};
use tokio::sync::mpsc::{Receiver, Sender};
use tokio::sync::{Mutex, oneshot};
@ -46,6 +47,13 @@ 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();
@ -159,6 +167,13 @@ 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 {
@ -324,6 +339,9 @@ 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;