COSMIC

From Gentoo Wiki
Jump to:navigation Jump to:search
Resources

COSMIC is a desktop environment built by System76 in Rust.

Warning
SELinux policies are not currently available through fsvm88's COSMIC overlay.

Installation

On musl profiles, build Rust (dev-lang/rust ) from source before attempting installation.

Overlay

fsvm88's cosmic-overlay provides all necessary packages.

root #eselect repository add cosmic-overlay git https://github.com/fsvm88/cosmic-overlay.git
root #emaint sync -r cosmic-overlay

Unmasking unstable ebuilds

For the latest tagged release, accept unstable ebuilds:

FILE /etc/portage/package.accept_keywords/cosmic-deUnmasking unstable ebuilds
cosmic-base/*
cosmic-de/*

Unmasking live ebuilds

To try out the latest commits from the master branch, accept live ebuilds:

FILE /etc/portage/package.accept_keywords/cosmic-deUnmasking unstable ebuilds
# Live ebuilds are masked via "missing" keywords
cosmic-base/* **
cosmic-de/* **
Warning
Do not mix unstable/alpha releases with live ebuilds. It can cause ABI/API mismatches (for example, an alpha version of the cosmic-session package being built alongside a live version of the xdg-desktop-portal-cosmic package), resulting in COSMIC failing to start.

Emerge

After unmasking the ebuilds, COSMIC can be installed by emerging the following packages:

root #emerge --ask cosmic-meta pop-theme-meta
Note
cosmic-overlay ebuilds attempt to install dev-util/dart-sass-bin , which may conflict with the official dev-ruby/sass package. As per this commit, gui-libs/adw-gtk3 versions greater than or equal to 5.10 won't build with dev-ruby/sass . Therefore, consider using dev-util/dart-sass-bin from cosmic-overlay.

Configuration

The most convenient method of login management while using COSMIC is to use a display manager such as greetd. If a display manager is not already in use, install greetd:

root #emerge --ask gui-libs/greetd

The following assumes greetd is being used. Users of SDDM should refer to the "SDDM" section.

systemd

Enable the greetd, cosmic-greeter, upower, and acpid services.

root #systemctl enable greetd.service cosmic-greeter.service cosmic-greeter-daemon.service upower.service acpid.socket

OpenRC

Warning
While COSMIC can be run on OpenRC systems, it currently only fully supports systemd.

In addition to greetd, gui-libs/display-manager-init and elogind should also be installed:

root #emerge --ask gui-libs/display-manager-init gui-libs/greetd sys-auth/elogind

Configure greetd as a display manager:

FILE /etc/conf.d/display-managergreetd with cosmic-greeter
CHECKVT=7
DISPLAYMANAGER="greetd"

Add the relevant OpenRC services to the relevant runlevels:

root #rc-update add elogind boot
root #rc-update add display-manager default

Configure greetd to run cosmic-greeter as the frontend, which must be run as the cosmic-greeter user.

FILE /etc/greetd/config.tomlgreetd with cosmic-greeter
[terminal]
vt=7
[default_session]
command="/usr/bin/dbus-run-session /usr/bin/cosmic-comp /usr/bin/cosmic-greeter >>/var/log/cosmic.log 2>&1"
user="cosmic-greeter"

Finally, reboot the machine.

Optionally, logging can be configured to use the system logger directly, rather than writing to a separate file:

FILE /etc/greetd/config.tomlgreetd with cosmic-greeter
[terminal]
vt=7
[default_session]
command="/usr/bin/dbus-run-session /usr/bin/cosmic-comp /usr/bin/cosmic-greeter 2>&1 | /usr/bin/logger -t cosmic-greeter"
user="cosmic-greeter"

Additionally, if auto-login is desired:

FILE /etc/greetd/config.tomlgreetd autologin to COSMIC
[terminal]
vt=7
[default_session]
command="/usr/bin/dbus-run-session env XDG_SESSION_TYPE=wayland XDG_CURRENT_DESKTOP=COSMIC /usr/bin/start-cosmic 2>&1 | /usr/bin/logger -t cosmic-greeter"
user="your-username"

SDDM

To make COSMIC launch from SDDM's session list, create or edit /usr/share/wayland-sessions/cosmic.desktop:

FILE /usr/share/wayland-sessions/cosmic.desktopCOSMIC session for SDDM
[DesktopEntry]
Name=COSMIC
Comment=System76COSMICDesktop
Exec=dbus-run-session env XDG_SESSION_TYPE=wayland XDG_CURRENT_DESKTOP=COSMIC start-cosmic
Type=Application
DesktopNames=COSMIC

If auto-login is desired:

FILE /etc/sddm.conf.d/10-autologin.confSDDM autologin to COSMIC
[Autologin]
User=your-username
Session=cosmic.desktop

Locales

In the COSMIC ecosystem, locales are managed via the COSMIC "initial setup" and "settings" applications.

systemd

On systemd systems, the required localed daemon should be running already.

OpenRC

To manage locales on OpenRC systems, the openrc-settingsd service must be used; this service provides the org.freedesktop.locale1 D-Bus interface.

Add the openrc-settingsd service to the default runlevel, and start it:

root #rc-update add openrc-settingsd default
root #rc-service openrc-settingsd start

Troubleshooting

COSMIC session does not start

If the COSMIC session does not start, first check if it starts successfully via a TTY:

root # dbus-run-session -- env XDG_SESSION_TYPE=wayland XDG_CURRENT_DESKTOP=COSMIC start-cosmic

Check D-Bus services

Inside a running COSMIC session, verify that System76 D-Bus services are available:

root # dbus-send --session --dest=org.freedesktop.DBus --type=method_call --print-reply /org/freedesktop/DBus org.freedesktop.DBus.ListNames | sed -n 's/.*string "\(com\.system76[^"]*\)".*/1円/p'

The output should list multiple com.system76 names, e.g. com.system76.CosmicSettingsDaemon.

Check session environment

Ensure the session has the XDG_CURRENT_DESKTOP and XDG_SESSION_TYPE variables set correctly:

root # env | grep -E 'XDG_CURRENT_DESKTOP|XDG_SESSION_TYPE|XDG_RUNTIME_DIR|DBUS_SESSION_BUS_ADDRESS'

The value of XDG_CURRENT_DESKTOP should be COSMIC, and the value of XDG_SESSION_TYPE should be wayland.

Verify services are running

The dbus service, which provides a D-Bus system bus (as distinct from a session bus started via e.g. dbus-run-session), and the login/session manager service, e.g. elogindon OpenRC and systemd-logind on systemd, must be running for COSMIC to start properly.

On OpenRC systems:

root #rc-service dbus status
root #rc-service elogind status

On systemd systems:

root #systemctl status dbus
root #systemctl status systemd-logind

Check greeter user runtime directory

If using greetd, confirm the cosmic-greeter user has a runtime directory:

root #ls -ld /run/user/$(id -u cosmic-greeter)

If that directory is missing, verify that /etc/pam.d/greetd contains:

FILE /etc/pam.d/greetdPAM config for greetd with elogind
auth include system-login
account include system-login
password include system-login
session include system-login
session required pam_elogind.so

Examine logs

If COSMIC immediately returns to the greeter, check the logs:

root # tail -n 200 /var/log/messages | grep -Ei 'cosmic-greeter|cosmic-comp|elogind|dbus|permission|denied'

See also