diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..4900198 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,30 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: bug +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. Pop!_OS 24.04] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..660d084 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,61 @@ +blank_issues_enabled: false +contact_links: + - name: cosmic-applets + url: https://github.com/pop-os/cosmic-applets/issues + about: Concern all the applets living in the dock or the panel. + + - name: cosmic-comp + url: https://github.com/pop-os/cosmic-comp/issues + about: Responsible for composing your windows on the screen. If you see issues with the tilling features or your multiple displays, this is likely the place to go. + + - name: cosmic-edit + url: https://github.com/pop-os/cosmic-edit/issues + about: This is the issue tracker for COSMIC Text Editor. If you see issues with the text editor, report them here. + + - name: cosmic-files + url: https://github.com/pop-os/cosmic-files/issues + about: This is the issue tracker for COSMIC Files. If you see issues while navigating files, this is the place to go. + + - name: cosmic-settings + url: https://github.com/pop-os/cosmic-settings/issues + about: This is the issue tracker for COSMIC Settings. If you see issues while changing settings, this is the place to go. + + - name: cosmic-store + url: https://github.com/pop-os/cosmic-store/issues + about: This is the issue tracker for COSMIC Store. If you see issues with the app store, report them here. + + - name: cosmic-term + url: https://github.com/pop-os/cosmic-term/issues + about: This is the issue tracker for COSMIC Terminal. If you see issues with the terminal, report them here. + + - name: cosmic-panel + url: https://github.com/pop-os/cosmic-panel/issues + about: Contains the code to manage the dock and panel applets. You can see it as the compositor of applets. It is also responsible to draw the panel and dock at the right place (bottom, left, ect..). + + - name: cosmic-screenshot + url: https://github.com/pop-os/cosmic-screenshot/issues + about: This is the tool that help you take screenshots. + + - name: cosmic-workspaces-epoch + url: https://github.com/pop-os/cosmic-workspaces-epoch/issues + about: Responsible for the workspace overview. If you have an issue with workspaces, this is the place to go. + + - name: cosmic-greeter + url: https://github.com/pop-os/cosmic-greeter/issues + about: When your session is locked, or not opened yet, this is the window that will be shown. Basically the login screen. + + - name: cosmic-osd + url: https://github.com/pop-os/cosmic-osd/issues + about: Cosmic on screen display. This is for example, the audio notification when you change the volume, or the brightness one. + + - name: cosmic-applibrary + url: https://github.com/pop-os/cosmic-applibrary/issues + about: It is the application launched with super-a, that let you see what app are in your system, and launch them. + + - name: cosmic-launcher + url: https://github.com/pop-os/cosmic-launcher/issues + about: Launched with the super key. It lets you search in your application, and display the result in a list. + + - name: cosmic-bg + url: https://github.com/pop-os/cosmic-bg/issues + about: If you notice issues with the wallpaper, this is the place to go. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..11fc491 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: enhancement +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..e6ca28b --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +- [ ] I have disclosed use of any AI generated code in my commit messages. + - If you are using an LLM, and do not fully understand the changes it is making to the code base, do not create a PR. + - In our experience, AI generated code often results in overly complex code that lacks enough context for a proper fix or feature inclusion. This results in considerably longer code reviews. Due to this, AI authored or partially authored PRs may be closed without comment. +- [ ] I understand these changes in full and will be able to respond to review comments. +- [ ] My change is accurately described in the commit message. +- [ ] My contribution is tested and working as described. +- [ ] I have read the [Developer Certificate of Origin](https://developercertificate.org/) and certify my contribution under its conditions. + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07f583f..1e5d0c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,197 +1,56 @@ -# Build and check the parts of HyprCosmic that are not one of the two forks: -# cosmic-conf, the shared waybar/rofi assets, and the installer that places them. +# Use Arch to test build outside of Ubuntu/Pop. # -# Two jobs with different shapes on purpose. cosmic-conf is compiled code and -# gets the same per-distribution matrix the forks do. The assets are text, and -# text does not care which distribution it is on -- what matters there is whether -# generated files are still in step with their generator, which is a single -# question with a single answer. +# Tests with recent version of dependencies. Another testson a different +# distro could be used to test for lowest supported. +# +# A minimal image should also help to confirm what dependencies are needed. + name: CI on: - push: - branches: [master] pull_request: - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -env: - CARGO_TERM_COLOR: always - RUST_BACKTRACE: 1 + push: + schedule: + - cron: '0 7 * * *' # Midnight MST daily jobs: - cosmic-conf: - name: cosmic-conf (${{ matrix.distro }}) + Test: runs-on: ubuntu-latest - container: ${{ matrix.image }} - strategy: - fail-fast: false - matrix: - include: - - distro: fedora - image: fedora:latest - - distro: debian - image: debian:bookworm - - distro: arch - image: archlinux:latest - + container: + image: archlinux:base-devel + volumes: + - /:/host steps: - # Before checkout: actions/checkout needs git and these images are bare. - - name: Install build dependencies (fedora) - if: matrix.distro == 'fedora' - run: dnf -y install --setopt=install_weak_deps=False git curl gcc - - - name: Install build dependencies (debian) - if: matrix.distro == 'debian' - run: | - apt-get update - DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - git curl ca-certificates build-essential - - - name: Install build dependencies (arch) - if: matrix.distro == 'arch' - run: pacman -Syu --noconfirm --needed git curl base-devel - - - uses: actions/checkout@v4 - - - name: Install Rust - run: | - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \ - | sh -s -- -y --default-toolchain stable --profile minimal \ - --component clippy - echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" - - - uses: Swatinem/rust-cache@v2 - with: - workspaces: cosmic-conf - key: ${{ matrix.distro }} - - - name: Test - working-directory: cosmic-conf - run: cargo test --locked - - # Warnings are errors here because the alternative is a build log nobody - # reads and a lint that has been failing for six months. - - name: Clippy - working-directory: cosmic-conf - run: cargo clippy --all-targets --locked -- -D warnings - - - name: Build - working-directory: cosmic-conf - run: cargo build --release --locked - - # The end-to-end question the unit tests cannot ask: does the cosmic.conf - # this repository actually ships still parse and resolve? A schema change - # that invalidates the shipped config would pass every test in the crate - # and break every user on first login. - # - # HOME is redirected so the resolution reports against an empty config - # tree rather than the runner's own. The binary is run directly instead of - # through `cargo run`: cargo keys its registry cache on HOME, so moving - # HOME would send it off to re-download every dependency into a directory - # the cache action does not know about. - # - # --diff writes nothing, and the last two lines hold it to that. - - name: The shipped cosmic.conf still resolves - working-directory: cosmic-conf - run: | - set -eux - fake="$RUNNER_TEMP/fakehome" - rm -rf "$fake" - mkdir -p "$fake/.config" - env HOME="$fake" XDG_CONFIG_HOME="$fake/.config" \ - ./target/release/cosmic-conf apply --diff --config ../config/cosmic.conf - test -z "$(find "$fake" -type f -print -quit)" - - - uses: actions/upload-artifact@v4 - with: - name: cosmic-conf-${{ matrix.distro }} - path: cosmic-conf/target/release/cosmic-conf - retention-days: 14 - - assets: - name: assets and installer - runs-on: ubuntu-latest - steps: - # Submodules because tools/install-assets.sh also places the session entry - # point, which is versioned in the cosmic-session fork. The script degrades - # gracefully when that checkout is absent -- it warns and skips those two - # files -- so this still passes before the submodules exist, just with less - # covered. - - uses: actions/checkout@v4 - with: - submodules: recursive - - # config.jsonc is generated, and the repository's rule is that it is never - # hand-edited: every Nerd Font glyph in it comes from a codepoint table in - # generate-config.py, because Private Use Area characters are destroyed by - # being retyped and indistinguishable in a diff. That rule is currently - # enforced by remembering it. This enforces it instead -- regenerate, and - # the file must not move. - - name: The generated waybar config is in step with its generator - run: | - set -eux - python3 config/waybar/generate-config.py \ - config/waybar/config.jsonc.in config/waybar/config.jsonc - git diff --exit-code -- config/waybar/config.jsonc - - # No PUA character may reach the template or the generator's own source. - # The generator refuses to emit non-ASCII, but nothing stopped one being - # pasted into its inputs until here. - # - # Written as an `if` rather than `! grep ...` because grep exits 1 for "no - # match" and 2 for "no such file", and negating it would turn a vanished - # file into a pass -- the check would quietly stop checking anything. - - name: The template and generator stay pure ASCII - run: | - set -eu - for f in config/waybar/config.jsonc.in config/waybar/generate-config.py; do - test -f "$f" - if LC_ALL=C grep -Pn '[^\x00-\x7F]' "$f"; then - echo "$f: non-ASCII above. Glyphs belong in the codepoint table," \ - "not in the template." >&2 - exit 1 - fi - done - - # A login-time script with a syntax error is a black screen with nowhere to - # print the reason. - - name: Syntax-check the shell scripts - run: | - set -eux - bash -n config/bin/hyprcosmic-powermenu - bash -n tools/install-assets.sh - - # Both scripts are shellcheck-clean today, so this starts as a ratchet - # rather than a backlog. The runner image ships shellcheck; the install is - # there so that stopping to be true is a slow step and not a broken job. - - name: Shellcheck - run: | - set -eux - command -v shellcheck >/dev/null || { - sudo apt-get update - sudo apt-get install -y --no-install-recommends shellcheck - } - shellcheck config/bin/hyprcosmic-powermenu tools/install-assets.sh - - # A round trip. Installing into a staging root and then asking --check to - # confirm it exercises both halves of the script against each other, and - # the audit it runs first refuses to proceed at all unless every file under - # config/ is classified as shared, per-user or a generator input. That - # audit is the real test: it is what stops a new file being silently left - # out of the install. - - name: Install into a staging root, then verify it - run: | - set -eux - DESTDIR="$PWD/stage" ./tools/install-assets.sh - DESTDIR="$PWD/stage" ./tools/install-assets.sh --check - find stage -type f -printf '%M %10s %P\n' - - - uses: actions/upload-artifact@v4 - with: - name: hyprcosmic-assets - path: stage/ - retention-days: 14 + - run: > + pacman --noconfirm --needed -Syu + cargo + clang + desktop-file-utils + git + gtk3 + gtk4 + just + libdisplay-info + libinput + libxkbcommon + llvm + mesa + meson + pipewire + pulseaudio + seatd + wayland + lld + expat + fontconfig + freetype2 + flatpak + nasm + - run: rm -rf /host/usr/local/lib/android # Free space + - uses: actions/checkout@v6 + with: + submodules: recursive + # Safe directory behavior seems to have issues with `container:` + # https://github.com/actions/checkout/issues/915 + - run: git config --global --add safe.directory '*' + - run: just sysext diff --git a/.github/workflows/hyprcosmic.yml b/.github/workflows/hyprcosmic.yml new file mode 100644 index 0000000..07f583f --- /dev/null +++ b/.github/workflows/hyprcosmic.yml @@ -0,0 +1,197 @@ +# Build and check the parts of HyprCosmic that are not one of the two forks: +# cosmic-conf, the shared waybar/rofi assets, and the installer that places them. +# +# Two jobs with different shapes on purpose. cosmic-conf is compiled code and +# gets the same per-distribution matrix the forks do. The assets are text, and +# text does not care which distribution it is on -- what matters there is whether +# generated files are still in step with their generator, which is a single +# question with a single answer. +name: CI + +on: + push: + branches: [master] + pull_request: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + CARGO_TERM_COLOR: always + RUST_BACKTRACE: 1 + +jobs: + cosmic-conf: + name: cosmic-conf (${{ matrix.distro }}) + runs-on: ubuntu-latest + container: ${{ matrix.image }} + strategy: + fail-fast: false + matrix: + include: + - distro: fedora + image: fedora:latest + - distro: debian + image: debian:bookworm + - distro: arch + image: archlinux:latest + + steps: + # Before checkout: actions/checkout needs git and these images are bare. + - name: Install build dependencies (fedora) + if: matrix.distro == 'fedora' + run: dnf -y install --setopt=install_weak_deps=False git curl gcc + + - name: Install build dependencies (debian) + if: matrix.distro == 'debian' + run: | + apt-get update + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + git curl ca-certificates build-essential + + - name: Install build dependencies (arch) + if: matrix.distro == 'arch' + run: pacman -Syu --noconfirm --needed git curl base-devel + + - uses: actions/checkout@v4 + + - name: Install Rust + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \ + | sh -s -- -y --default-toolchain stable --profile minimal \ + --component clippy + echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" + + - uses: Swatinem/rust-cache@v2 + with: + workspaces: cosmic-conf + key: ${{ matrix.distro }} + + - name: Test + working-directory: cosmic-conf + run: cargo test --locked + + # Warnings are errors here because the alternative is a build log nobody + # reads and a lint that has been failing for six months. + - name: Clippy + working-directory: cosmic-conf + run: cargo clippy --all-targets --locked -- -D warnings + + - name: Build + working-directory: cosmic-conf + run: cargo build --release --locked + + # The end-to-end question the unit tests cannot ask: does the cosmic.conf + # this repository actually ships still parse and resolve? A schema change + # that invalidates the shipped config would pass every test in the crate + # and break every user on first login. + # + # HOME is redirected so the resolution reports against an empty config + # tree rather than the runner's own. The binary is run directly instead of + # through `cargo run`: cargo keys its registry cache on HOME, so moving + # HOME would send it off to re-download every dependency into a directory + # the cache action does not know about. + # + # --diff writes nothing, and the last two lines hold it to that. + - name: The shipped cosmic.conf still resolves + working-directory: cosmic-conf + run: | + set -eux + fake="$RUNNER_TEMP/fakehome" + rm -rf "$fake" + mkdir -p "$fake/.config" + env HOME="$fake" XDG_CONFIG_HOME="$fake/.config" \ + ./target/release/cosmic-conf apply --diff --config ../config/cosmic.conf + test -z "$(find "$fake" -type f -print -quit)" + + - uses: actions/upload-artifact@v4 + with: + name: cosmic-conf-${{ matrix.distro }} + path: cosmic-conf/target/release/cosmic-conf + retention-days: 14 + + assets: + name: assets and installer + runs-on: ubuntu-latest + steps: + # Submodules because tools/install-assets.sh also places the session entry + # point, which is versioned in the cosmic-session fork. The script degrades + # gracefully when that checkout is absent -- it warns and skips those two + # files -- so this still passes before the submodules exist, just with less + # covered. + - uses: actions/checkout@v4 + with: + submodules: recursive + + # config.jsonc is generated, and the repository's rule is that it is never + # hand-edited: every Nerd Font glyph in it comes from a codepoint table in + # generate-config.py, because Private Use Area characters are destroyed by + # being retyped and indistinguishable in a diff. That rule is currently + # enforced by remembering it. This enforces it instead -- regenerate, and + # the file must not move. + - name: The generated waybar config is in step with its generator + run: | + set -eux + python3 config/waybar/generate-config.py \ + config/waybar/config.jsonc.in config/waybar/config.jsonc + git diff --exit-code -- config/waybar/config.jsonc + + # No PUA character may reach the template or the generator's own source. + # The generator refuses to emit non-ASCII, but nothing stopped one being + # pasted into its inputs until here. + # + # Written as an `if` rather than `! grep ...` because grep exits 1 for "no + # match" and 2 for "no such file", and negating it would turn a vanished + # file into a pass -- the check would quietly stop checking anything. + - name: The template and generator stay pure ASCII + run: | + set -eu + for f in config/waybar/config.jsonc.in config/waybar/generate-config.py; do + test -f "$f" + if LC_ALL=C grep -Pn '[^\x00-\x7F]' "$f"; then + echo "$f: non-ASCII above. Glyphs belong in the codepoint table," \ + "not in the template." >&2 + exit 1 + fi + done + + # A login-time script with a syntax error is a black screen with nowhere to + # print the reason. + - name: Syntax-check the shell scripts + run: | + set -eux + bash -n config/bin/hyprcosmic-powermenu + bash -n tools/install-assets.sh + + # Both scripts are shellcheck-clean today, so this starts as a ratchet + # rather than a backlog. The runner image ships shellcheck; the install is + # there so that stopping to be true is a slow step and not a broken job. + - name: Shellcheck + run: | + set -eux + command -v shellcheck >/dev/null || { + sudo apt-get update + sudo apt-get install -y --no-install-recommends shellcheck + } + shellcheck config/bin/hyprcosmic-powermenu tools/install-assets.sh + + # A round trip. Installing into a staging root and then asking --check to + # confirm it exercises both halves of the script against each other, and + # the audit it runs first refuses to proceed at all unless every file under + # config/ is classified as shared, per-user or a generator input. That + # audit is the real test: it is what stops a new file being silently left + # out of the install. + - name: Install into a staging root, then verify it + run: | + set -eux + DESTDIR="$PWD/stage" ./tools/install-assets.sh + DESTDIR="$PWD/stage" ./tools/install-assets.sh --check + find stage -type f -printf '%M %10s %P\n' + + - uses: actions/upload-artifact@v4 + with: + name: hyprcosmic-assets + path: stage/ + retention-days: 14 diff --git a/.gitignore b/.gitignore index 84a06c0..4eb1002 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,15 @@ -# OMC operational artifacts -.omc/ +# Upstream cosmic-epoch's entries +.vscode +cosmic-sysext +*_build # Rust target/ **/*.rs.bk vendor/ -# The two forks used to be listed here, ignored until they had somewhere to -# live. They are submodules now -- see .gitmodules -- so ignoring them would -# only hide the commit each one is pinned to. +# OMC operational artifacts +.omc/ + +# The two forks are NOT ignored. They are submodules -- see .gitmodules -- and +# ignoring them would only hide the commit each one is pinned to. diff --git a/.gitmodules b/.gitmodules index 63a795a..f80cc6d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,116 @@ -[submodule "cosmic-comp"] - path = cosmic-comp - url = git@github.com:outbackdingo/hyprcosmic-comp.git [submodule "cosmic-session"] - path = cosmic-session + path = cosmic-session url = git@github.com:outbackdingo/hyprcosmic-session.git + branch = master +[submodule "cosmic-comp"] + path = cosmic-comp + url = git@github.com:outbackdingo/hyprcosmic-comp.git + branch = master +[submodule "cosmic-panel"] + path = cosmic-panel + url = https://github.com/pop-os/cosmic-panel + branch = master +[submodule "cosmic-applets"] + path = cosmic-applets + url = https://github.com/pop-os/cosmic-applets + branch = master +[submodule "cosmic-applibrary"] + path = cosmic-applibrary + url = https://github.com/pop-os/cosmic-applibrary + branch = master +[submodule "cosmic-launcher"] + path = cosmic-launcher + url = https://github.com/pop-os/cosmic-launcher + branch = master +[submodule "simple-wrapper"] + path = simple-wrapper + url = https://github.com/pop-os/simple-wrapper + branch = master +[submodule "cosmic-settings"] + path = cosmic-settings + url = https://github.com/pop-os/cosmic-settings + branch = master +[submodule "cosmic-settings-daemon"] + path = cosmic-settings-daemon + url = https://github.com/pop-os/cosmic-settings-daemon + branch = master +[submodule "xdg-desktop-portal-cosmic"] + path = xdg-desktop-portal-cosmic + url = https://github.com/pop-os/xdg-desktop-portal-cosmic.git + branch = master +[submodule "cosmic-osd"] + path = cosmic-osd + url = https://github.com/pop-os/cosmic-osd.git + branch = master +[submodule "cosmic-bg"] + path = cosmic-bg + url = https://github.com/pop-os/cosmic-bg.git + branch = master +[submodule "cosmic-workspaces-epoch"] + path = cosmic-workspaces-epoch + url = https://github.com/pop-os/cosmic-workspaces-epoch/ + branch = master +[submodule "cosmic-notifications"] + path = cosmic-notifications + url = https://github.com/pop-os/cosmic-notifications + branch = master +[submodule "cosmic-icons"] + path = cosmic-icons + url = https://github.com/pop-os/cosmic-icons.git + branch = master +[submodule "cosmic-greeter"] + path = cosmic-greeter + url = https://github.com/pop-os/cosmic-greeter + branch = master +[submodule "cosmic-screenshot"] + path = cosmic-screenshot + url = https://github.com/pop-os/cosmic-screenshot + branch = master +[submodule "cosmic-edit"] + path = cosmic-edit + url = https://github.com/pop-os/cosmic-edit + branch = master +[submodule "cosmic-term"] + path = cosmic-term + url = https://github.com/pop-os/cosmic-term.git + branch = master +[submodule "cosmic-randr"] + path = cosmic-randr + url = https://github.com/pop-os/cosmic-randr.git + branch = master +[submodule "cosmic-files"] + path = cosmic-files + url = https://github.com/pop-os/cosmic-files.git + branch = master +[submodule "cosmic-store"] + path = cosmic-store + url = https://github.com/pop-os/cosmic-store.git + branch = master +[submodule "cosmic-wallpapers"] + path = cosmic-wallpapers + url = https://github.com/pop-os/cosmic-wallpapers.git + branch = master +[submodule "cosmic-idle"] + path = cosmic-idle + url = https://github.com/pop-os/cosmic-idle.git + branch = master +[submodule "cosmic-player"] + path = cosmic-player + url = https://github.com/pop-os/cosmic-player.git + branch = master +[submodule "cosmic-initial-setup"] + path = cosmic-initial-setup + url = https://github.com/pop-os/cosmic-initial-setup + branch = master +[submodule "pop-launcher"] + path = pop-launcher + url = https://github.com/pop-os/launcher.git + branch = master +[submodule "cosmic-monitor"] + path = cosmic-monitor + url = https://github.com/pop-os/cosmic-monitor.git + branch = master +[submodule "cosmic-sound-theme"] + path = cosmic-sound-theme + url = https://github.com/pop-os/cosmic-sound-theme.git + branch = master diff --git a/README.md b/README.md new file mode 100644 index 0000000..62bc80c --- /dev/null +++ b/README.md @@ -0,0 +1,346 @@ +# COSMIC Desktop + +[COSMIC](https://system76.com/cosmic) is a desktop environment offering performance, efficiency, and personalization to empower a wide variety of use cases. + +## Components of COSMIC Desktop +* [cosmic-applets](https://github.com/pop-os/cosmic-applets) +* [cosmic-applibrary](https://github.com/pop-os/cosmic-applibrary) +* [cosmic-bg](https://github.com/pop-os/cosmic-bg) +* [cosmic-comp](https://github.com/pop-os/cosmic-comp) +* [cosmic-edit](https://github.com/pop-os/cosmic-edit) +* [cosmic-files](https://github.com/pop-os/cosmic-files) +* [cosmic-greeter](https://github.com/pop-os/cosmic-greeter) +* [cosmic-icons](https://github.com/pop-os/cosmic-icons) +* [cosmic-idle](https://github.com/pop-os/cosmic-idle) +* [cosmic-initial-setup](https://github.com/pop-os/cosmic-initial-setup) +* [cosmic-launcher](https://github.com/pop-os/cosmic-launcher) +* [cosmic-monitor](https://github.com/pop-os/cosmic-monitor) +* [cosmic-notifications](https://github.com/pop-os/cosmic-notifications) +* [cosmic-osd](https://github.com/pop-os/cosmic-osd) +* [cosmic-panel](https://github.com/pop-os/cosmic-panel) +* [cosmic-player](https://github.com/pop-os/cosmic-player) +* [cosmic-randr](https://github.com/pop-os/cosmic-randr) +* [cosmic-screenshot](https://github.com/pop-os/cosmic-screenshot) +* [cosmic-session](https://github.com/pop-os/cosmic-session) +* [cosmic-settings](https://github.com/pop-os/cosmic-settings) +* [cosmic-settings-daemon](https://github.com/pop-os/cosmic-settings-daemon) +* [cosmic-sound-theme](https://github.com/pop-os/cosmic-sound-theme) +* [cosmic-store](https://github.com/pop-os/cosmic-store) +* [cosmic-term](https://github.com/pop-os/cosmic-term) +* [cosmic-theme-editor](https://github.com/pop-os/cosmic-theme-editor) +* [cosmic-workspaces-epoch](https://github.com/pop-os/cosmic-workspaces-epoch) +* [xdg-desktop-portal-cosmic](https://github.com/pop-os/xdg-desktop-portal-cosmic) +* [pop-launcher](https://github.com/pop-os/launcher) + +### COSMIC libraries/crates + +* [cosmic-protocols](https://github.com/pop-os/cosmic-protocols) +* [cosmic-text](https://github.com/pop-os/cosmic-text) +* [cosmic-theme](https://github.com/pop-os/cosmic-theme) +* [cosmic-time](https://github.com/pop-os/cosmic-time) + +### COSMIC toolkit for apps and applets + +* [libcosmic](https://github.com/pop-os/libcosmic) + +## Installing on Pop!\_OS + +### Pop!\_OS 24.04 + +COSMIC DE's first release (Epoch 1) is included in Pop!\_OS 24.04. There are two ways to get the 24.04 release: + +- Install it from the [latest release ISO](https://system76.com/cosmic/). +- Upgrade an existing Pop!\_OS 22.04 installation using the following command: `pop-upgrade release upgrade -f` + - If you experience problems during the upgrade, please open an issue in the [pop-upgrade GitHub repository](https://github.com/pop-os/upgrade) or join the [Pop!\_OS Mattermost chat server](https://chat.pop-os.org) for assistance. + +COSMIC users, including Pop!_OS users, are welcome to join the [Pop!\_OS Mattermost chat server](https://chat.pop-os.org) to receive news about development. Join the [COSMIC Epoch channel](https://chat.pop-os.org/pop-os/channels/cosmic-epoch) for COSMIC user discussion, or the [Development channel](https://chat.pop-os.org/pop-os/channels/development) for developer-oriented discussion. + +### Pop!\_OS 22.04 + +Due to dependency requirements, **COSMIC Epoch is no longer receiving updates on Pop!\_OS 22.04 LTS.** It's no longer recommended to test COSMIC Epoch on Pop!\_OS 22.04 because the latest bug fixes and features are only available on newer distributions such as Pop!\_OS 24.04. + +Individual COSMIC applications work in the default GNOME session of Pop!\_OS 22.04. You can install individual COSMIC applications using the following command: + +``` +sudo apt install cosmic-edit cosmic-files cosmic-player cosmic-store cosmic-term +``` + +#### Old Release on 22.04 + +An **older release** of the COSMIC Epoch desktop environment alpha is still available on Pop!\_OS 22.04 LTS. If you encounter bugs while testing COSMIC Epoch on Pop!\_OS 22.04, please check if they exist in Pop!\_OS 24.04 before reporting them. You can install the older release on 22.04 with these instructions: + +##### Enable Wayland + +`sudo nano /etc/gdm3/custom.conf` + +Change `WaylandEnable` to `true`: +``` +WaylandEnable=true +``` + +Reboot for this change to take effect. + +##### Update udev rules for NVIDIA users + +```shell +sudo nano /usr/lib/udev/rules.d/61-gdm.rules +``` + +Look for `LABEL="gdm_prefer_xorg"` and `LABEL="gdm_disable_wayland"`. Add `#` to the `RUN` statements so they look like this: + +``` +LABEL="gdm_prefer_xorg" +#RUN+="/usr/libexec/gdm-runtime-config set daemon PreferredDisplayServer xorg" +GOTO="gdm_end" + +LABEL="gdm_disable_wayland" +#RUN+="/usr/libexec/gdm-runtime-config set daemon WaylandEnable false" +GOTO="gdm_end" +``` + +Restart gdm + +```shell +sudo systemctl restart gdm +``` + +##### Install COSMIC + +`sudo apt install cosmic-session` + +After logging out, click on your user and there will be a sprocket at the bottom right. Change the setting to COSMIC. Proceed to log in. + +## Installing on Arch Linux +Install via [cosmic-session](https://archlinux.org/packages/extra/x86_64/cosmic-session/) or the [cosmic](https://archlinux.org/groups/x86_64/cosmic/) group, e.g.: +`pacman -S cosmic-session` or `pacman -S cosmic` + +Then log out, click on your user, and a sprocket at the bottom right shows an additional entry alongside your desktop environments. Change to COSMIC and proceed with log in. +For a more detailed discussion, consider the [relevant section in the Arch wiki](https://wiki.archlinux.org/title/COSMIC). + +## Installing on Fedora Linux + +COSMIC can be installed from the built-in repositories on Fedora 41+: + +``` +sudo dnf install @cosmic-desktop-environment +``` + +Alternatively, for more up-to-date COSMIC packages (but less quality control), you can use the nightly COPR builds: + +``` +sudo dnf copr enable ryanabx/cosmic-epoch && sudo dnf install cosmic-desktop +``` + +After installing, log out, click on your user, and use the sprocket in the bottom right to select the COSMIC desktop environment before logging in. +For more information, check the [Fedora Wiki COSMIC SIG page](https://fedoraproject.org/wiki/SIGs/COSMIC) or the [COPR page](https://copr.fedorainfracloud.org/coprs/ryanabx/cosmic-epoch/). + +## Installing on NixOS +The COSMIC module on NixOS can be enabled by adding the following lines to +your NixOS configuration file (`configuration.nix` or in your Flake): +```nix +{ + # Enable the COSMIC login manager + services.displayManager.cosmic-greeter.enable = true; + + # Enable the COSMIC desktop environment + services.desktopManager.cosmic.enable = true; +} +``` + +While some packages like `cosmic-session` might be present in prior versions, +the modules that add full support for COSMIC were added in **NixOS 25.05**. + +You can find more details on the [NixOS Wiki](https://wiki.nixos.org/wiki/COSMIC). + + +## Installing on openSUSE tumbleweed +Cosmic can be installed by adding X11:COSMIC:Factory repo with opi. +``` +opi patterns-cosmic +``` +Select X11:COSMIC:Factory, after installing keep the repo. + +Then log out, click on your user, and a sprocket at the bottom right shows an additional entry alongside your desktop environments. Change to COSMIC and proceed with log in. +For further information, you may check the [OBS page](https://build.opensuse.org/project/show/X11:COSMIC:Factory). + +## Installing on Gentoo Linux +COSMIC can be installed on Gentoo via a custom overlay. Add the overlay using your preferred overlay manager (such as eselect), and then install the desktop environment: + +`eselect repository add cosmic-overlay git https://github.com/fsvm88/cosmic-overlay.git` + +Next, synchronize the repository with +`emaint sync -r cosmic-overlay` + +and install the COSMIC desktop environment and its associated themes: + +`emerge cosmic-meta pop-theme-meta -av` + +Please note that the ebuilds have testing keywords and need to unmasked on stable systems for successful installation. + +Then log out, and switch the desktop environment to COSMIC, the procedure depends on your login manager. +For further information, you may check the [Gentoo Wiki](https://wiki.gentoo.org/wiki/COSMIC) or [Overlay Repository](https://github.com/fsvm88/cosmic-overlay). + +## Setup on distributions without packaging of COSMIC components + +The COSMIC desktop environment requires a few dependencies. The rustc and just packages of your distro may be too old, so we recommend installing rustc and cargo with rustup, and installing just with cargo. +(This list does not try to be exhaustive, but rather tries to provide a decent starting point. For detailed instructions, check out the individual projects): + +- [just](https://github.com/casey/just) +- rustc +- cargo +- c compiler (cc) +- make +- git +- libwayland +- mesa (or third-party libEGL/libGL implementations, though interfacing with mesa's libglvnd is generally recommended). +- libseat +- libxkbcommon +- libinput +- udev +- dbus +- libdisplay-info-dev +- libgstreamer1.0-dev +- libgstreamer-plugins-base1.0-dev + +optionally (though the build-system might currently require these libraries): +- libsystem +- libpulse +- libexpat1 +- libfontconfig +- libfreetype +- lld +- libgbm-dev +- libclang-dev +- libpipewire-0.3-dev + +Note: `libfontconfig`, `libfreetype`, and `lld` are packages specific to Linux distributions. You may need to find the equivalent version for your distribution if you are not using Pop!_OS. + +The required ones can be installed with: +``` +sudo apt install -y \ + build-essential \ + dbus \ + git \ + libdbus-1-dev \ + libdisplay-info-dev \ + libflatpak-dev \ + libglvnd-dev \ + libgstreamer-plugins-base1.0-dev \ + libgstreamer1.0-dev \ + libinput-dev \ + libpam0g-dev \ + libpixman-1-dev \ + libseat-dev \ + libssl-dev \ + libwayland-dev \ + libxkbcommon-dev \ + rustup \ + udev + +rustup toolchain install stable +cargo install just +``` + +and the optional ones with: +``` +sudo apt install -y \ + libclang-dev \ + libexpat1-dev \ + libfontconfig-dev \ + libfreetype-dev \ + libgbm-dev \ + libpipewire-0.3-dev \ + libpulse-dev \ + libsystemd-dev \ + lld \ + mold +``` + +They can be installed all at once with: +``` +sudo apt install -y \ + build-essential \ + dbus \ + git \ + libclang-dev \ + libdbus-1-dev \ + libdisplay-info-dev \ + libexpat1-dev \ + libflatpak-dev \ + libfontconfig-dev \ + libfreetype-dev \ + libgbm-dev \ + libglvnd-dev \ + libgstreamer-plugins-base1.0-dev \ + libgstreamer1.0-dev \ + libinput-dev \ + libpam0g-dev \ + libpipewire-0.3-dev \ + libpixman-1-dev \ + libpulse-dev \ + libseat-dev \ + libssl-dev \ + libsystemd-dev \ + libwayland-dev \ + libxkbcommon-dev \ + lld \ + mold \ + rustup \ + udev + +rustup toolchain install stable +cargo install just +``` + +### Testing + +The easiest way to test COSMIC DE currently is by building a systemd system extension (see `man systemd-sysext`). + +``` +git clone --recurse-submodules https://github.com/pop-os/cosmic-epoch +cd cosmic-epoch +just sysext +``` + +This will create a system-extension called `cosmic-sysext`, which you can move (without renaming!) into e.g. `/var/lib/extensions`. +After starting systemd-sysext.service (`sudo systemctl enable --now systemd-sysext`) and refreshing (`sudo systemd-sysext refresh`) or rebooting, +COSMIC will be an available option in your favorite display manager. + +If you have SELinux enabled (e.g. on Fedora), the installed extension won't have the correct labels applied. +To test COSMIC, you can temporarily disable it and restart `gdm` (note that this will close your running programs). + +```shell +sudo setenforce 0 +sudo systemctl restart gdm +``` + +**Note**: An extension created this way will be linked against specific libraries on your system and will not work on other distributions. +It also requires the previously mentioned libraries/dependencies at runtime to be installed in your system (the system extension does not carry these libraries). + +**Read-Only Filesystem**: If you're not on an immutable distro you may notice that `/usr/` and `/opt/` are read-only. +this is caused by `systemd-sysext` being enabled, when you are done testing you can disable `systemd-sysext` (`sudo systemctl disable --now systemd-sysext`) + +It is thus not a proper method for long term deployment. + +### Packaging + +COSMIC DE is packaged for Pop!_OS. For reference, look at the `debian` folders in the projects repositories. +These and the `justfile` inside this repository may be used as references on how to package COSMIC DE, though no backwards-compatibility guarantees are provided at this stage. + +### Versioning + +COSMIC DE is a work in progress with many moving pieces. +We do our best to keep the referenced submodule commits in this repository building and working together; as a consequence, they might not contain the latest updates and features from these repositories (yet). + +The commits corresponding with the current release are tagged `epoch-X.Y.Z`, where `X` is the major release and the last two numbers denote incremental minor releases. (During development of new major versions, an additional `-alpha.Y.Z` or `-beta.Y.Z` may be appended.) + +COSMIC Epoch version numbers are mainly for the benefit of non-Pop!_OS distributions; Pop!_OS uses its own build system, and typically receives updates to individual submodules before they're tagged as part of a COSMIC Epoch release. + +## Translating + +To submit translations for COSMIC in your language, please use Weblate: https://hosted.weblate.org/projects/pop-os/ + +## Contact +- [Mattermost](https://chat.pop-os.org/) +- [Twitter](https://twitter.com/pop_os_official) +- [Instagram](https://www.instagram.com/pop_os_official/) diff --git a/TRADEMARK.md b/TRADEMARK.md new file mode 100644 index 0000000..4f67714 --- /dev/null +++ b/TRADEMARK.md @@ -0,0 +1,39 @@ +# COSMIC Trademark Policy + +This document outlines the policy regarding the use of the COSMIC desktop environment trademark owned by System76. The purpose of this policy is to ensure that the COSMIC trademark is used correctly and consistently, maintaining the integrity and reputation of the COSMIC brand. + +1. Usage of the COSMIC Trademark + 1. The COSMIC trademark includes, but is not limited to, the name "COSMIC", “COSMIC DE” the COSMIC logo, and any associated symbols or designs. + 2. The COSMIC trademark may only be used in accordance with this policy. Unauthorized use of the trademark is prohibited. +2. Permissible Use + 1. Community Projects: Community projects such as Linux distributions may use the COSMIC trademark to refer to the desktop environment, provided that such use is not misleading and does not imply endorsement by System76 without explicit permission. + 2. Educational and Informational Use: The COSMIC trademark may be used in educational and informational materials, including books, websites, and articles, to refer to the desktop environment, provided that such use complies with the guidelines set forth in this policy. + 3. Marketing and Promotional Use: Partners and affiliates of System76 may use the COSMIC trademark in marketing and promotional materials with prior written consent from System76. +3. Prohibited Use + 1. Misrepresentation: The COSMIC trademark must not be used in a way that misrepresents or implies false association with, endorsement by, or sponsorship from System76. + 2. Modification: The COSMIC trademark must not be altered, modified, or used as part of another trademark or logo without prior written permission from System76. + 3. Merchandising: The COSMIC trademark must not be used on merchandise (e.g., T-shirts, mugs) for commercial purposes without explicit authorization from System76. +4. Logo Usage Guidelines + 1. The COSMIC logo must be used as provided by System76 without any modifications. This includes maintaining the logo’s colors, proportions, and overall design. + 2. The COSMIC logo must be displayed in a manner that is clear and legible. Sufficient clear space should be maintained around the logo to ensure it is not crowded by other visual elements. + 3. The COSMIC name should be identified as a trademark using the “™” symbol. +5. Official COSMIC Software + 1. Software hosted at [System76's GitHub repository](https://github.com/pop-os) is considered official COSMIC software. Only software that has been approved by System76 is permitted to use the COSMIC trademarks to refer to itself. Applications and applets that are official COSMIC software use the “cosmic-” package namespace and “com.system76.” prefixed App ID. Other applications should avoid using these prefixes. + 2. Third-party applications, applets, and software that integrate with or extend the COSMIC desktop environment must not use the COSMIC trademark in a way that implies official status or endorsement without prior approval from System76. Third-party developers are encouraged to use the "cosmic-ext-" package namespace. These applications and applets may be described as "for the COSMIC™ desktop". + 3. Third-party applications and applets may request inclusion as official COSMIC software. To request inclusion, please contact System76 at cosmic@system76.com. +6. Request for Permission + 1. To request permission for uses of the COSMIC trademark not covered by this policy, please contact System76 at trademark@system76.com. + 2. All requests will be reviewed on a case-by-case basis, and System76 reserves the right to grant or deny permission at its sole discretion. +7. Enforcement + 1. System76 reserves the right to take appropriate legal action against any unauthorized use of the COSMIC trademark. + 2. System76 may, at its discretion, require the cessation of use of the COSMIC trademark by any party that fails to comply with this policy. + +## Contact Information + +For any questions or to request permission to use the COSMIC trademark, please contact:

+System76, Inc.
+trademark@system76.com

+This trademark policy is effective as of June 3, 2024 and may be updated from time to time at the discretion of System76. + +--- +By adhering to these guidelines, you help us protect the COSMIC brand and ensure it remains a symbol of quality and innovation. Thank you for your cooperation. diff --git a/cosmic-applets b/cosmic-applets new file mode 160000 index 0000000..ec8ffdc --- /dev/null +++ b/cosmic-applets @@ -0,0 +1 @@ +Subproject commit ec8ffdc85d1f316b387cf89672609933064e6e88 diff --git a/cosmic-applibrary b/cosmic-applibrary new file mode 160000 index 0000000..172acda --- /dev/null +++ b/cosmic-applibrary @@ -0,0 +1 @@ +Subproject commit 172acdae07aeb78a554813a566c0f8b942dcc831 diff --git a/cosmic-bg b/cosmic-bg new file mode 160000 index 0000000..76e89e6 --- /dev/null +++ b/cosmic-bg @@ -0,0 +1 @@ +Subproject commit 76e89e6aff4224e3a820cbe71c74ee91adb60d03 diff --git a/cosmic-edit b/cosmic-edit new file mode 160000 index 0000000..4ac0da3 --- /dev/null +++ b/cosmic-edit @@ -0,0 +1 @@ +Subproject commit 4ac0da3af97207fb3807375928812f23ec04161f diff --git a/cosmic-files b/cosmic-files new file mode 160000 index 0000000..24e34ea --- /dev/null +++ b/cosmic-files @@ -0,0 +1 @@ +Subproject commit 24e34eaa0f0acf4e24ea1338ad4bbde3a138e1f3 diff --git a/cosmic-greeter b/cosmic-greeter new file mode 160000 index 0000000..d39915a --- /dev/null +++ b/cosmic-greeter @@ -0,0 +1 @@ +Subproject commit d39915ae2381424d406cd511a2310ef928144f4c diff --git a/cosmic-icons b/cosmic-icons new file mode 160000 index 0000000..b78b059 --- /dev/null +++ b/cosmic-icons @@ -0,0 +1 @@ +Subproject commit b78b059636ed967ad7c6f120709c7d29b2bafac1 diff --git a/cosmic-idle b/cosmic-idle new file mode 160000 index 0000000..c95d066 --- /dev/null +++ b/cosmic-idle @@ -0,0 +1 @@ +Subproject commit c95d066b5b640509a6369634b669ca60dc50e168 diff --git a/cosmic-initial-setup b/cosmic-initial-setup new file mode 160000 index 0000000..b5ac418 --- /dev/null +++ b/cosmic-initial-setup @@ -0,0 +1 @@ +Subproject commit b5ac4182bb00bc774ca86febadf0369e362bc031 diff --git a/cosmic-launcher b/cosmic-launcher new file mode 160000 index 0000000..8799503 --- /dev/null +++ b/cosmic-launcher @@ -0,0 +1 @@ +Subproject commit 8799503120d28383b3548f19a50880cbe83701c5 diff --git a/cosmic-monitor b/cosmic-monitor new file mode 160000 index 0000000..70e6cff --- /dev/null +++ b/cosmic-monitor @@ -0,0 +1 @@ +Subproject commit 70e6cff1684310996d350d6dc1a8b438f5ee0217 diff --git a/cosmic-notifications b/cosmic-notifications new file mode 160000 index 0000000..7c723b7 --- /dev/null +++ b/cosmic-notifications @@ -0,0 +1 @@ +Subproject commit 7c723b7705ec77b1ad5396a1baa9ae1c0cb5a0da diff --git a/cosmic-osd b/cosmic-osd new file mode 160000 index 0000000..20a2055 --- /dev/null +++ b/cosmic-osd @@ -0,0 +1 @@ +Subproject commit 20a2055dfc0eed78b417f0ecd38cc15807df3285 diff --git a/cosmic-panel b/cosmic-panel new file mode 160000 index 0000000..d6699ff --- /dev/null +++ b/cosmic-panel @@ -0,0 +1 @@ +Subproject commit d6699ffc423a3830bf4cab7e2c7f08a173e998f0 diff --git a/cosmic-player b/cosmic-player new file mode 160000 index 0000000..23d5944 --- /dev/null +++ b/cosmic-player @@ -0,0 +1 @@ +Subproject commit 23d59445afaf74aa0ac39a16d6d88f5f20d91d1f diff --git a/cosmic-randr b/cosmic-randr new file mode 160000 index 0000000..6e8e795 --- /dev/null +++ b/cosmic-randr @@ -0,0 +1 @@ +Subproject commit 6e8e795970fa06d434af22775e415b517f7552d3 diff --git a/cosmic-screenshot b/cosmic-screenshot new file mode 160000 index 0000000..fc778df --- /dev/null +++ b/cosmic-screenshot @@ -0,0 +1 @@ +Subproject commit fc778df20fd9b3f2b266b090da89c09ce625e0a4 diff --git a/cosmic-settings b/cosmic-settings new file mode 160000 index 0000000..7287257 --- /dev/null +++ b/cosmic-settings @@ -0,0 +1 @@ +Subproject commit 7287257ec9f2ca301642bd4800f391ad9079d3e9 diff --git a/cosmic-settings-daemon b/cosmic-settings-daemon new file mode 160000 index 0000000..21a9692 --- /dev/null +++ b/cosmic-settings-daemon @@ -0,0 +1 @@ +Subproject commit 21a9692b53fcbffa0f18f7d0a12bf0f9d5bd0590 diff --git a/cosmic-sound-theme b/cosmic-sound-theme new file mode 160000 index 0000000..7aabe44 --- /dev/null +++ b/cosmic-sound-theme @@ -0,0 +1 @@ +Subproject commit 7aabe449093787163c74c25aa1bd4663fb4c324c diff --git a/cosmic-store b/cosmic-store new file mode 160000 index 0000000..f56cb48 --- /dev/null +++ b/cosmic-store @@ -0,0 +1 @@ +Subproject commit f56cb48aa10cf058799972b1ab225fe9fcfedcfd diff --git a/cosmic-term b/cosmic-term new file mode 160000 index 0000000..543cbb0 --- /dev/null +++ b/cosmic-term @@ -0,0 +1 @@ +Subproject commit 543cbb0cb818e1ef724d7f917ca562af44340e47 diff --git a/cosmic-wallpapers b/cosmic-wallpapers new file mode 160000 index 0000000..3c59953 --- /dev/null +++ b/cosmic-wallpapers @@ -0,0 +1 @@ +Subproject commit 3c59953e7ee5792efecdb232cb4c7211e7785f52 diff --git a/cosmic-workspaces-epoch b/cosmic-workspaces-epoch new file mode 160000 index 0000000..8faab4c --- /dev/null +++ b/cosmic-workspaces-epoch @@ -0,0 +1 @@ +Subproject commit 8faab4c2a92f438a704d072e3c5aa9526d2acc88 diff --git a/docs/DEBUGGING.md b/docs/DEBUGGING.md new file mode 100644 index 0000000..b5825ad --- /dev/null +++ b/docs/DEBUGGING.md @@ -0,0 +1,41 @@ +Debugging COSMIC +================ + +An assortment of useful tools and settings for debugging COSMIC. + +## Logs +Cosmic-comp, cosmic-panel, and other components log to `stderr`, as well as journald (if present). + +## Wayland and X11 Protocols + +Run clients with `WAYLAND_DEBUG=1` to see what wayland calls are made. `xtrace -n ` can be used to see what X calls an X11 client is making. + +## XWayland + +A tool like `xprop` can be used to determine if an application is running in XWayland. If `xprop` is unable to select a window, it is a native Wayland window. + +## Performance + +`sudo perf top` can be used to see what functions, across all processes, are using the most CPU time. The `-p` argument can be used to restrict this to a single process. The output is more useful for executables with debug symbols. + +`cosmic-comp` integrates Tracy for profiling. It can be built with `cargo build --features profile-with-tracy --profile fastdebug`, then the Tracy client can connect from the same system or a different one + +## Graphics drivers +`eglinfo` and `vulkaninfo` indicate what graphics cards and drivers are in use for hardware-accelerated rendering. + +On systems with NVIDIA graphics, `nvidia-smi` has information about the GPU and driver. + +## DRM +The Linux DRM subsystem handles graphics cards and display controllers. + +`drm_info` prints information about the outputs, planes, etc. associated with each GPU and their properties. The output of this command can be useful for understanding display related issues. + +https://gitlab.freedesktop.org/wlroots/wlroots/-/wikis/DRM-Debugging documents how to configure DRM to enable additional logging, which can be useful for understanding some DRM driver issues. + +## Frozen desktop + +If the desktop is frozen and `ctrl+alt+f*` don't work to change to a TTY, [the magic SysRq key](https://www.kernel.org/doc/html/latest/admin-guide/sysrq.html) with `r` can be used to switch input into raw mode, so the kernel will handle the tty switch key binding. `/etc/sysctl.conf` or `/etc/sysctl.d` may need to be edited first to set `kernel.sysrq=1` or another value that allows this command. + +It is also possible to connect over `ssh` from another computer. + +Then `pidof cosmic-comp` can be used to get the PID of the compositor. Then it is possible to investigate further with tools like `gdb`, using `sudo gdb` and then `attach `. diff --git a/justfile b/justfile new file mode 100644 index 0000000..0f7c518 --- /dev/null +++ b/justfile @@ -0,0 +1,104 @@ +set dotenv-load +just := just_executable() +make := `which make` + +build: + mkdir -p build + {{ just }} cosmic-applets/build-release + {{ just }} cosmic-applibrary/build-release + {{ just }} cosmic-bg/build-release + {{ make }} -C cosmic-comp all + {{ just }} cosmic-edit/build-release + {{ just }} cosmic-files/build-release + {{ just }} cosmic-greeter/build-release + {{ just }} cosmic-idle/build-release + {{ just }} cosmic-initial-setup/build-release + {{ just }} cosmic-launcher/build-release + {{ just }} cosmic-monitor/build-release + {{ just }} cosmic-notifications/build-release + {{ just }} cosmic-osd/build-release + {{ just }} cosmic-panel/build-release + {{ just }} cosmic-player/build-release + {{ just }} cosmic-randr/build-release + {{ just }} cosmic-screenshot/build-release + {{ just }} cosmic-settings/build-release + {{ make }} -C cosmic-settings-daemon all + {{ just }} cosmic-session/build-release + {{ just }} cosmic-store/build-release + {{ just }} cosmic-term/build-release + {{ make }} -C cosmic-wallpapers all + {{ make }} -C cosmic-workspaces-epoch all + {{ just }} pop-launcher/build-release + {{ make }} -C xdg-desktop-portal-cosmic all + +install rootdir="" prefix="/usr/local": build + {{ just }} rootdir={{rootdir}} prefix={{prefix}} cosmic-applets/install + {{ just }} rootdir={{rootdir}} prefix={{prefix}} cosmic-applibrary/install + {{ just }} rootdir={{rootdir}} prefix={{prefix}} cosmic-bg/install + {{ make }} -C cosmic-comp install DESTDIR={{rootdir}} prefix={{prefix}} + {{ just }} rootdir={{rootdir}} prefix={{prefix}} cosmic-edit/install + {{ just }} rootdir={{rootdir}} prefix={{prefix}} cosmic-files/install + {{ just }} rootdir={{rootdir}} prefix={{prefix}} cosmic-greeter/install + {{ just }} rootdir={{rootdir}} prefix={{prefix}} cosmic-icons/install + {{ just }} rootdir={{rootdir}} prefix={{prefix}} cosmic-idle/install + {{ just }} rootdir={{rootdir}} prefix={{prefix}} cosmic-initial-setup/install + {{ just }} rootdir={{rootdir}} prefix={{prefix}} cosmic-launcher/install + {{ just }} rootdir={{rootdir}} prefix={{prefix}} cosmic-monitor/install + {{ just }} rootdir={{rootdir}} prefix={{prefix}} cosmic-notifications/install + {{ just }} rootdir={{rootdir}} prefix={{prefix}} cosmic-osd/install + {{ just }} rootdir={{rootdir}} prefix={{prefix}} cosmic-panel/install + {{ just }} rootdir={{rootdir}} prefix={{prefix}} cosmic-player/install + {{ just }} rootdir={{rootdir}} prefix={{prefix}} cosmic-randr/install + {{ just }} rootdir={{rootdir}} prefix={{prefix}} cosmic-screenshot/install + {{ just }} rootdir={{rootdir}} prefix={{prefix}} cosmic-settings/install + {{ make }} -C cosmic-settings-daemon install DESTDIR={{rootdir}} prefix={{prefix}} + {{ just }} rootdir={{rootdir}} prefix={{prefix}} cosmic-session/install + {{ just }} rootdir={{rootdir}} prefix={{prefix}} cosmic-store/install + {{ just }} rootdir={{rootdir}} prefix={{prefix}} cosmic-term/install + {{ make }} -C cosmic-wallpapers install DESTDIR={{rootdir}} prefix={{prefix}} + {{ make }} -C cosmic-workspaces-epoch install DESTDIR={{rootdir}} prefix={{prefix}} + {{ just }} rootdir={{rootdir}} pop-launcher/install + {{ make }} -C xdg-desktop-portal-cosmic install DESTDIR={{rootdir}} prefix={{prefix}} + +_mkdir dir: + mkdir -p dir + +sysext dir=(invocation_directory() / "cosmic-sysext") version=("nightly-" + `git rev-parse --short HEAD`): (_mkdir dir) (install dir "/usr") + #!/usr/bin/env sh + mkdir -p {{dir}}/usr/lib/extension-release.d/ + cat >{{dir}}/usr/lib/extension-release.d/extension-release.cosmic-sysext <