chore(repo): merge komorebi-for-kde history

Merges the KDE old repo's history, with its original commit hashes, under komorebi-for-kde/. The subtree is byte-identical to the old tip 7d19fd40 (654/654 renames in the move commit). Verified: tree equality, git blame, git log --follow, cargo metadata, and that no KDE workflow sits outside komorebi-for-kde/.
This commit is contained in:
LGUG2Z committed 2026-10-31 01:37:53 -07:00
commit a7dd44c75b
654 files changed
+121517

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
[env]
# The version crate reads the commit from git when HEAD is on a branch, and from
# this variable otherwise (a detached HEAD, which jj leaves, or a build with no
# .git directory). Nix sets the real commit, which takes precedence over this.
COMMIT_HASH = "unknown"
+1
View File
@@ -0,0 +1 @@
use flake
+54
View File
@@ -0,0 +1,54 @@
name: nix
description: Install nix on a hosted runner, with the store cached and, on request, KVM enabled
inputs:
kvm:
description: Make /dev/kvm usable and tell nix that this machine can run NixOS tests
default: "false"
cache:
description: Restore the nix store from the cache, and save it when the job ends
default: "true"
runs:
using: composite
steps:
# A Plasma guest is a closure of about 10 GB, and a hosted runner has little free space on /
# until the toolchains it ships with are gone.
- name: Free disk space
if: inputs.kvm == 'true'
shell: bash
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
df -h /
# The udev rule is what makes /dev/kvm writable for the runner's user. KVM on hosted runners
# is documented for public repositories; `test -w` is what says whether this one has it.
- name: Enable KVM
if: inputs.kvm == 'true'
shell: bash
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' |
sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
# The host of a hosted runner is not chosen: some have no nested virtualization. The step is
# named so that rerun-no-kvm.yaml can tell this failure from a failed suite and run it again.
test -w /dev/kvm || { echo "::error::this runner has no usable /dev/kvm"; exit 1; }
# This action only installs nix. It does not use the Cachix service, and no Cachix cache, account
# or token is configured anywhere in this repository.
- uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
system-features = nixos-test benchmark big-parallel ${{ inputs.kvm == 'true' && 'kvm' || '' }}
# The key is flake.lock, so a job that builds against another nixpkgs (the canary) turns the
# cache off: what it restored would be of no use to it, and what it saved would replace the
# store of the jobs that do use this lock. The architecture is part of the key, because the
# x86_64 and arm64 runners build different store paths.
- if: inputs.cache == 'true'
uses: nix-community/cache-nix-action@v7
with:
primary-key: nix-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('flake.lock', '**/Cargo.lock') }}
restore-prefixes-first-match: nix-${{ runner.os }}-${{ runner.arch }}-
gc-max-store-size-linux: 8G
+21
View File
@@ -0,0 +1,21 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
assignees:
- "LGUG2Z"
commit-message:
prefix: chore
include: scope
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "weekly"
assignees:
- "LGUG2Z"
commit-message:
prefix: chore
include: scope
+12
View File
@@ -0,0 +1,12 @@
<!--
Please follow the Conventional Commits specification.
If you need to update your PR with changes from `master`, please run `git rebase master`.
By opening this PR, you confirm that you have read, understood and agree to this project's `CONTRIBUTING.md`.
-->
<!--
A change to behavior that a real KWin decides comes with a VM test:
docs/dev/vm-tests.md says how to add one.
-->
+353
View File
@@ -0,0 +1,353 @@
# Every job is gated on the repository, so that a fork does not run them on its own runners.
name: ci
on:
pull_request:
branches:
- "*"
push:
branches:
- master
- feature/*
- hotfix/*
tags:
- v*
schedule:
- cron: "30 0 * * 0" # Every Sunday at 00:30 UTC
workflow_dispatch:
jobs:
cargo-deny:
if: github.repository == 'LGUG2Z/komorebi-for-kde'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: EmbarkStudios/cargo-deny-action@v2
# Everything that does not need a virtual machine: the formatting, clippy, rustdoc, the tests and
# the VM library's own tests, as derivations. The jobs that boot KWin are separate, and `nix flake
# check` is not used here because on Linux it would run those suites with no KVM. Built all at
# once on one runner they ran it out of resources (it was shut down about six minutes in, twice),
# so they are split into shards: a check that matches no shard but the last is built there, and so
# a new check needs no edit here.
checks:
if: github.repository == 'LGUG2Z/komorebi-for-kde'
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- shard: rust
pattern: "^komorebi-workspace-"
- shard: guests
pattern: "^(run-kde|wsl2-probe|plasma-guests|nixos-module|nix-options)"
- shard: rest
pattern: ""
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: ./.github/actions/nix
- name: Build the ${{ matrix.shard }} checks
env:
PATTERN: ${{ matrix.pattern }}
run: |
# the last shard takes whatever the others do not, and the library's own tests
rust='^komorebi-workspace-'
guests='^(run-kde|wsl2-probe|plasma-guests|nixos-module|nix-options)'
nix eval --json .#checks.x86_64-linux --apply builtins.attrNames |
jq -r --arg p "$PATTERN" --arg rust "$rust" --arg guests "$guests" '
[.[] | select(startswith("vm-") | not)] + ["vm-lib"]
| .[] | select(if $p == "" then (test($rust) or test($guests) | not) else test($p) end)' |
sed 's|^|.#checks.x86_64-linux.|' |
xargs --no-run-if-empty nix build -L --no-link
lint:
if: github.repository == 'LGUG2Z/komorebi-for-kde'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: ./.github/actions/nix
- run: nix develop --command just lint
# The suites are found in the flake, so that a new directory under nix/tests/vm/suites is run
# without an edit here.
discover:
if: github.repository == 'LGUG2Z/komorebi-for-kde'
runs-on: ubuntu-24.04
outputs:
fast: ${{ steps.tiers.outputs.fast }}
slow: ${{ steps.tiers.outputs.slow }}
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/nix
- id: tiers
run: |
tiers=$(nix eval --json .#legacyPackages.x86_64-linux.vmTiers)
echo "fast=$(jq -c '.fast // []' <<<"$tiers")" >> "$GITHUB_OUTPUT"
echo "slow=$(jq -c '.slow // []' <<<"$tiers")" >> "$GITHUB_OUTPUT"
# The pull request gate: the suites that take minutes, each in its own machine, in a sandboxed
# `nix build` like any other check.
vm-fast:
needs: discover
if: github.repository == 'LGUG2Z/komorebi-for-kde' && needs.discover.outputs.fast != '[]'
runs-on: ubuntu-24.04
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
suite: ${{ fromJson(needs.discover.outputs.fast) }}
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/nix
with:
kvm: "true"
- run: nix build -L .#checks.x86_64-linux.vm-${{ matrix.suite }}
# The suites that draw and move a pointer. They run on master, every week, and on a pull
# request with the label `ci:vm-slow`. The driver is run by hand, outside the sandbox, so that
# the screenshots and the journals of a failed run can be uploaded.
vm-slow:
needs: discover
if: >-
github.repository == 'LGUG2Z/komorebi-for-kde' && needs.discover.outputs.slow != '[]' &&
(github.ref == 'refs/heads/master' || github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch' ||
contains(github.event.pull_request.labels.*.name, 'ci:vm-slow'))
runs-on: ubuntu-24.04
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
suite: ${{ fromJson(needs.discover.outputs.slow) }}
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/nix
with:
kvm: "true"
- run: nix build -L .#legacyPackages.x86_64-linux.vm.${{ matrix.suite }}.driver -o driver
- run: mkdir -p out && cd out && ../driver/bin/nixos-test-driver -o .
- if: always()
uses: actions/upload-artifact@v7
with:
name: vm-${{ matrix.suite }}-${{ github.sha }}
path: out/
retention-days: 7
# The flake follows the tip of nixpkgs-unstable, so KWin and Plasma change under it whenever
# flake.lock moves. Every week, and on a manual run, this job moves nixpkgs to the tip in a copy
# of the checkout and builds every check against it, the VM suites of both tiers included, one
# after the other on one machine, so that komorebi and the guests are built once. When a check
# fails, it opens an issue, or comments on the one that is open. Nothing is pushed: the new lock
# exists only in the copy.
canary:
if: >-
github.repository == 'LGUG2Z/komorebi-for-kde' &&
(github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
runs-on: ubuntu-24.04
timeout-minutes: 360
permissions:
contents: read
issues: write
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: ./.github/actions/nix
with:
kvm: "true"
cache: "false"
- name: Move nixpkgs to the tip in a copy of the checkout
run: |
cp -a . "$RUNNER_TEMP/canary"
cd "$RUNNER_TEMP/canary"
locked=$(nix eval --raw --inputs-from . nixpkgs#kdePackages.kwin.version)
nix flake update nixpkgs
rev=$(jq -r .nodes.nixpkgs.locked.rev flake.lock)
echo "NIXPKGS_REV=$rev" >>"$GITHUB_ENV"
tip=$(nix eval --raw --inputs-from . nixpkgs#kdePackages.kwin.version)
echo "KWIN=$tip (flake.lock has $locked)" >>"$GITHUB_ENV"
- id: build
name: Build every check against it
working-directory: ${{ runner.temp }}/canary
run: |
failed="$RUNNER_TEMP/canary-failed"
: >"$failed"
# the checks that need no virtual machine, as the checks job lists them, then the suites
# of both tiers, as the discover job lists them
checks=$(nix eval --json .#checks.x86_64-linux --apply builtins.attrNames |
jq -r '(.[] | select(startswith("vm-") | not)), "vm-lib"')
suites=$(nix eval --json .#legacyPackages.x86_64-linux.vmTiers |
jq -r '(.fast // []) + (.slow // []) | .[] | "vm-" + .')
for check in $checks $suites; do
echo "::group::$check"
nix build -L --no-link ".#checks.x86_64-linux.$check" || echo "$check" >>"$failed"
echo "::endgroup::"
done
test ! -s "$failed"
- name: Report
if: always()
env:
BUILD: ${{ steps.build.outcome }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
failed="$RUNNER_TEMP/canary-failed"
{
echo "- commit: $GITHUB_SHA"
if [ -n "${NIXPKGS_REV:-}" ]; then
echo "- nixpkgs-unstable:" \
"[\`${NIXPKGS_REV:0:12}\`](https://github.com/NixOS/nixpkgs/commit/$NIXPKGS_REV)${KWIN:+, with KWin $KWIN}"
else
echo "- nixpkgs-unstable: the update of flake.lock failed"
fi
echo
if [ -s "$failed" ]; then
echo "These failed:"
echo
while read -r check; do echo "- \`$check\`"; done <"$failed"
elif [ "$BUILD" = success ]; then
echo "Every check passed."
else
echo "The job failed before it could build the checks."
fi
echo
echo "The logs are in [the run]($RUN_URL)."
} >"$RUNNER_TEMP/canary.md"
cat "$RUNNER_TEMP/canary.md" >>"$GITHUB_STEP_SUMMARY"
- name: Open or update the canary issue
if: failure()
env:
GH_TOKEN: ${{ github.token }}
run: |
title="Canary: a check fails against the tip of nixpkgs-unstable"
number=$(gh issue list --repo "$GITHUB_REPOSITORY" --state open --limit 1000 \
--json number,title |
jq -r --arg title "$title" 'map(select(.title == $title)) | first | .number // empty')
if [ -n "$number" ]; then
gh issue comment "$number" --repo "$GITHUB_REPOSITORY" --body-file "$RUNNER_TEMP/canary.md"
else
gh issue create --repo "$GITHUB_REPOSITORY" --title "$title" \
--body-file "$RUNNER_TEMP/canary.md"
fi
# komorebi and komorebic for each architecture, kept for 14 days, and what the publish job
# releases. nix points a binary at the dynamic loader and the libraries of its store, which only a
# machine with those store paths has, so each binary is pointed at the system's loader instead,
# at the path every glibc system has it, and run on this Ubuntu runner to show that it works.
# The arm64 job may fail without failing the run.
build:
if: github.repository == 'LGUG2Z/komorebi-for-kde'
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
runs-on: ubuntu-24.04
loader: /lib64/ld-linux-x86-64.so.2
optional: false
- target: aarch64-unknown-linux-gnu
runs-on: ubuntu-24.04-arm
loader: /lib/ld-linux-aarch64.so.1
optional: true
runs-on: ${{ matrix.runs-on }}
continue-on-error: ${{ matrix.optional }}
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/nix
- name: Build komorebi and komorebic
env:
LOADER: ${{ matrix.loader }}
run: |
mkdir bin
for name in komorebi komorebic; do
cp "$(nix build -L --no-link --print-out-paths ".#$name")/bin/$name" bin/
done
chmod u+w bin/*
nix run --inputs-from . nixpkgs#patchelf -- --set-interpreter "$LOADER" --remove-rpath bin/*
echo "the newest glibc symbol version they need:" \
"$(objdump -T bin/* | grep -o 'GLIBC_[0-9.]*' | sort -uV | tail -n 1)"
bin/komorebi --version
bin/komorebic --version
- uses: actions/upload-artifact@v7
with:
name: komorebi-${{ matrix.target }}-${{ github.sha }}
path: bin/
retention-days: 14
# A push of a `v*` tag makes a release of what the build job made, and a scheduled or manual run
# on master replaces the rolling `nightly` prerelease, once the lint and the fast VM tier have
# passed. The release notes are the commit messages since the previous version tag, by kokai.
publish:
needs: [lint, checks, vm-fast, build]
if: >-
github.repository == 'LGUG2Z/komorebi-for-kde' && (startsWith(github.ref, 'refs/tags/v') ||
(github.ref == 'refs/heads/master' &&
(github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')))
runs-on: ubuntu-24.04
permissions:
contents: write
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Decide what is published
run: |
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
echo "TAG=$GITHUB_REF_NAME" >>"$GITHUB_ENV"
echo "VERSION=${GITHUB_REF_NAME#v}" >>"$GITHUB_ENV"
else
echo "TAG=nightly" >>"$GITHUB_ENV"
echo "VERSION=nightly" >>"$GITHUB_ENV"
fi
- uses: actions/download-artifact@v8
with:
pattern: komorebi-*-${{ github.sha }}
path: artifacts
- name: Package
run: |
mkdir dist
for target in x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu; do
build="artifacts/komorebi-$target-$GITHUB_SHA"
if [ ! -d "$build" ]; then
echo "::warning::there is no build for $target, so it is not published"
continue
fi
# an artifact does not keep the executable bit
chmod +x "$build/komorebi" "$build/komorebic"
zip -j "dist/komorebi-$VERSION-$target.zip" "$build/komorebi" "$build/komorebic"
done
- name: Add the schema of komorebi.json
if: hashFiles('schema.json') != ''
run: cp schema.json dist/
- name: Write the checksums
working-directory: dist
run: sha256sum -- * >checksums.txt
- name: Write the release notes
run: |
cargo install --locked kokai@0.3.1
# kokai lists the commits between the tag before the one it is given and that one. The
# nightly tag of the last run moves to this commit, so that the range starts at the
# last version.
if [ "$TAG" = nightly ]; then git tag --force nightly; fi
kokai release --no-emoji --add-links github:commits,issues --ref "$TAG" \
>"$RUNNER_TEMP/release-notes.md"
- name: Publish
run: |
if [ "$TAG" = nightly ]; then
gh release delete nightly --cleanup-tag --yes || true
gh release create nightly --target "$GITHUB_SHA" --prerelease \
--title "komorebi for KDE nightly ($GITHUB_SHA)" \
--notes-file "$RUNNER_TEMP/release-notes.md" dist/*
else
gh release create "$TAG" --verify-tag --title "komorebi for KDE $TAG" \
--notes-file "$RUNNER_TEMP/release-notes.md" dist/*
fi
+37
View File
@@ -0,0 +1,37 @@
# A hosted runner of a private repository may land on a host with no KVM, which fails the "Enable
# KVM" step of .github/actions/nix. Another attempt usually gets another host, so a run that failed
# only for that is rerun, up to three attempts. A suite that fails is left alone. A run cannot rerun
# its own failed jobs while it is still in progress, hence a workflow of its own.
name: rerun-no-kvm
on:
workflow_run:
workflows: [ci]
types: [completed]
jobs:
rerun:
if: >-
github.repository == 'LGUG2Z/komorebi-for-kde' &&
github.event.workflow_run.conclusion == 'failure' &&
github.event.workflow_run.run_attempt < 3
runs-on: ubuntu-24.04
permissions:
actions: write
steps:
- name: Rerun the failed jobs when every one of them failed to get KVM
env:
GH_TOKEN: ${{ github.token }}
RUN_ID: ${{ github.event.workflow_run.id }}
REPO: ${{ github.repository }}
run: |
# for each failed job, the name of the step that failed
failed=$(gh api --paginate "repos/$REPO/actions/runs/$RUN_ID/jobs?filter=latest" \
--jq '.jobs[] | select(.conclusion == "failure") | [.name, ([.steps[] | select(.conclusion == "failure") | .name] | first // "")] | @tsv')
echo "$failed"
if [ -z "$failed" ] || printf '%s\n' "$failed" | awk -F'\t' '$2 !~ /Enable KVM/ { bad = 1 } END { exit !bad }'; then
echo "something other than a missing /dev/kvm failed: not rerunning"
exit 0
fi
gh run rerun "$RUN_ID" --repo "$REPO" --failed
@@ -0,0 +1,25 @@
# komorebi tracks the tip of nixpkgs-unstable, so the lock moves every week. The pull request runs
# the same jobs as any other, which is what says whether the new KWin still works.
name: update-flake-lock
on:
schedule:
- cron: "0 3 * * 1" # Every Monday at 03:00 UTC
workflow_dispatch:
jobs:
update:
if: github.repository == 'LGUG2Z/komorebi-for-kde'
runs-on: ubuntu-24.04
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v7
- uses: cachix/install-nix-action@v31
- uses: DeterminateSystems/update-flake-lock@v29
with:
commit-msg: "chore(deps): flake.lock: Update"
pr-title: "chore(deps): flake.lock: Update"
pr-assignees: LGUG2Z
+8
View File
@@ -0,0 +1,8 @@
/target
/result*
/.direnv
/.vm
# Python bytecode
__pycache__/
*.pyc
+239
View File
@@ -0,0 +1,239 @@
# Contributing to the Project
The project is a collection of contributions from both the project leaders and
community members. There are many ways to contribute, this can include content
in the project repositories, as well as contributing in public and private
conversation, assisting users, writing blog posts, and many other ways.
## How contributions are made
Contributions to the project primarily happen in the project source
repositories, but may also occur in other places, such as discussion forums and
public and private discourse.
## Contributing content to the Project
In order for the project leaders to manage sustained progress toward the
project goals and maintain project velocity, focus and quality, the project may
adjust the license terms over time.
Content contributed to the project must therefore be provided under
sufficiently liberal terms to allow these operations to proceed unimpeded. As
such contributions are accepted with the following understanding:
* Contributed content is licensed under the terms of the 0-BSD license
* Contributors accept the terms of the project license at the time of
contribution
By making a contribution, you accept both the current project license terms,
and that all contributions that you have made are provided under the terms of
the 0-BSD license.
## Working on the code
`nix develop` (or [direnv](https://direnv.net), through the [`.envrc`](.envrc))
provides the Rust toolchain, a nightly `rustfmt` and the tools the checks use.
[`rustfmt.toml`](rustfmt.toml) uses an unstable option, which is why the
formatter is a nightly one.
`just check` runs everything a change has to pass before it is pushed: the
formatting check, clippy with warnings denied, the tests, rustdoc with warnings
denied, the checks of the bridge, and `just lint`: the macros the code does not
use, and actionlint (with shellcheck) over the workflows. `just fmt` formats the Rust sources, and `nix fmt` every file
type the repository has. `nix flake check` builds the same checks, plus
`cargo deny`, as derivations; on Linux it also boots every VM test, which needs
KVM.
## The bridge
[`bridge.js`](komorebi/src/kwin/bridge.js), the script komorebi loads into
KWin, is JavaScript that KWin runs as it is: there is no package.json and no
build step. Its types are JSDoc comments, which `tsc` checks against
[`kwin-api.d.ts`](komorebi/src/kwin/kwin-api.d.ts), the part of KWin's
scripting API the bridge uses; something the bridge starts to use is declared
there first. Its tests, [`bridge.test.js`](komorebi/src/kwin/bridge.test.js),
run under `node --test` against a fake KWin. `just check-js` runs both, with the
`tsc` and `node` of the dev shell.
The messages between the bridge and the daemon are in
[`komorebi/src/kwin/fixtures`](komorebi/src/kwin/fixtures), which the tests of
both sides read. A change to a message changes the fixture, the bridge and the
daemon in the same commit.
## The NixOS module
[`nix/nixos-module.nix`](nix/nixos-module.nix) is `services.komorebi`, which the
flake exports as `nixosModules.default` with its overlay. A change to it comes
with a scenario in [`nix/tests/nixos-module.nix`](nix/tests/nixos-module.nix),
the `nixos-module-eval` check: each scenario is a real NixOS system that is
evaluated and never built, and its checks read the assertions, the unit and
the options it evaluates to. It runs on a Mac too, with `nix build
.#checks.aarch64-darwin.nixos-module-eval`. A change to what the unit does in a
session also changes the VM suite `module`, which logs in to Plasma on a machine
with the module and checks the daemon the unit runs. Every other VM suite runs
on machines built with the module too.
Three files are generated from the Rust types and committed: `schema.json` and
`schema.asc.json` (`just jsonschema`), and `nix/komorebi-options.nix`, which types the
module's `config` (`just nixgen`, which needs `schemars-nixgen`, `cargo install
schemars-nixgen`). A change to what `komorebi.json` or an `applications.json` can
say regenerates them in the same commit, and the check `schema-fresh` fails when
it does not. The first line of the options file is the hash of the schema it was
made from, which is how the check tells without running `schemars-nixgen`.
A change to what `komorebic hotkeys compile` prints for a key binding file shows
in `keybindings-fixtures`, which compares its output for every file of the
fixture corpus with `nix/tests/keybindings.expected`: write the file again with
the loop in `nix/tests/keybindings.nix`, and read the difference before
committing it.
[`nix/supported-kwin.nix`](nix/supported-kwin.nix) has the oldest KWin komorebi
supports, `min`, and the newest one every VM suite has passed against,
`testedMax`, which the module checks a system's KWin against. `testedMax` is
raised by hand, once every suite has passed against a newer KWin: in the weekly
canary job, or on a branch whose `flake.lock` has it. The commit changes
`testedMax` and the dated comment above it (the date, the nixpkgs revision and
the KWin), and its message says which run that was and which suites ran.
`nix eval --raw --file nix/supported-kwin.nix testedMax` reads it without the
flake. `min` changes with the code, in the commit that starts to use something an
older KWin does not have.
## The comparison
[`docs/dev/COMPARE.md`](docs/dev/COMPARE.md) compares komorebi for KDE with komorebi
for Windows and komorebi for Mac, and its tables are generated by
[`scripts/compare-gen.py`](scripts/compare-gen.py) (Python 3 and nothing else) from
this checkout and from checkouts of the other two, `~/komorebi` and
`~/komorebi-for-mac` unless `--kfw` and `--kfm` say otherwise. Continuous
integration has neither checkout, so it does not run the script. A change to a
`komorebic` command, a `SocketMessage`, a key of `komorebi.json`, a
`WindowManagerEvent`, a method of `Backend` or a list of keys in `check.rs` is
followed by `python3 -I scripts/compare-gen.py --check docs/dev/COMPARE.md`, and
by `--update` when it reports a stale block, in the same commit. The script stops
and says what when a command, key, event or method has no note about why it
differs, and when a sentence of the document stops being true; the text around an
updated block is read again each time.
## VM tests
A change that needs a real KWin to be checked comes with a VM test, next to
the Rust test that covers the same behavior against the fake desktop.
[`docs/dev/vm-tests.md`](docs/dev/vm-tests.md) says how they are laid out, how
to run one (`just vm NAME`) and how to add one.
## The KWin effects
The patches in [`nix`](nix) change the KWin effects komorebi drives. Each one
is a derivative work of its effect, which is under the GNU General Public
License version 3, and is under the same license. A patch starts with a header
that describes the change and carries the license notice; `patch` skips the
text before the first `diff` line. To change a patch, make the change in the
effect's source at the version the package pins, and write the whole diff again
with `diff -ruN a b` below the header. The check of each package, named after
it (in [`nix/tests/effects.nix`](nix/tests/effects.nix)), builds the package
and checks the files it installs, and for a patched package that the patch is
in them:
```sh
nix build .#checks.x86_64-linux.kde-rounded-corners-komorebi-install
nix build .#checks.x86_64-linux.kwin-effect-geometry-change-komorebi-install
```
## Plasma guests to develop in
[`nix/dev`](nix/dev) has NixOS guests with Plasma for trying a change by hand,
on an Apple silicon Mac (two that QEMU runs and a disk image for UTM) and on a
Linux machine with KVM (the same two QEMU guests, for `x86_64` and for
`aarch64`, and a demo guest, [`nix/dev/run-kde.nix`](nix/dev/run-kde.nix)).
[`docs/dev/utm.md`](docs/dev/utm.md) says how to build and run them,
and what a builder has to be for a Mac. They install komorebi with the NixOS
module, and carry nothing of the person who uses them: a key, a password or a
configuration of yours goes into the guest when it runs, never into these files.
The `plasma-guests-eval` check evaluates them, the VM suite `rdp` runs their
RDP server, [`nix/dev/krdp.nix`](nix/dev/krdp.nix), and the VM suite `run-kde`
boots the demo guest. The demo guest has no
password and no key in its closure: the host shares a directory with them, and
`run-kde` ([`scripts/run-kde`](scripts/run-kde)) starts it. The script is
shellchecked when the package is built, and `run-kde-dry-run` and
`run-kde-doctor` compare what it prints for made-up machines with the texts in
[`nix/tests/run-kde`](nix/tests/run-kde): change one with the other.
## Continuous integration
[`ci.yaml`](.github/workflows/ci.yaml) runs on every pull request and on every
push to `master`, `feature/*` and `hotfix/*`, in this repository only. The
`lint` job builds every check that needs no virtual machine and runs
`just lint`, `cargo-deny` checks licenses and advisories, and
the VM tests run on KVM in two jobs: `vm-fast` on every pull request and
`vm-slow` on `master`, every week, and on pull requests labeled `ci:vm-slow`. A weekly
[workflow](.github/workflows/update-flake-lock.yaml) opens a pull request that
moves `flake.lock`, and the same jobs run on it.
The flake follows the tip of nixpkgs-unstable, so KWin and Plasma change
whenever `flake.lock` moves. The `canary` job of `ci.yaml` runs every week, and
when the workflow is started by hand: it runs `nix flake update nixpkgs` in a
copy of the checkout and builds every check against the result, the VM suites
of both tiers included. When a check fails, it opens an issue titled "Canary: a
check fails against the tip of nixpkgs-unstable" with the failed checks, the
nixpkgs revision and its KWin version, or comments on that issue if it is
still open. The job changes nothing in the repository. To reproduce a failure,
run `nix flake update nixpkgs` in a checkout and build the check the issue
names (`just vm NAME` for a VM suite). The fix goes in a commit of its own;
nixpkgs is not pinned back.
## Releases
A release is a tag. Set `version` under `[workspace.package]` in
[`Cargo.toml`](Cargo.toml) to the new version, commit it, and push the tag
`vVERSION` on that commit. For every run, the `build` job of `ci.yaml` builds
`komorebi` and `komorebic` with nix on an x86_64 and an arm64 runner, and keeps
them as an artifact of the run for 14 days. On a tag, once `lint`, `vm-fast` and
`build` have passed, the `publish` job makes the GitHub release of that tag
with:
- `komorebi-VERSION-x86_64-unknown-linux-gnu.zip` and
`komorebi-VERSION-aarch64-unknown-linux-gnu.zip`, each with the two binaries;
- `checksums.txt`, the SHA-256 sum of every other file of the release;
- `schema.json`, the schema of `komorebi.json`, when the repository has one;
- release notes that [kokai](https://github.com/Joxit/kokai) writes from the
commit messages since the previous version tag.
The scheduled run on `master` every week, and a run of the workflow started by
hand on `master`, replace the `nightly` prerelease the same way: `nightly`
takes the place of the version in the file names, and the notes list the
commits since the last version tag. The arm64 job may fail without failing the
run; the release then has no arm64 zip.
nix builds a binary that loads glibc from the nix store, so the build job
points each binary at the system's dynamic loader, at the standard path for its
architecture, with no library path, and runs it on the Ubuntu runner to check
that it starts. A release binary therefore uses the glibc of the system it runs
on.
## Commits
Commit messages follow the
[Conventional Commits](https://www.conventionalcommits.org/) specification:
`type(scope): description`. The scope is the Rust module the change is in
(`wm`, `kwin`, `layouts`), `repo` for repository files and markdown, `nix` for
the flake and `github` for workflows. Every line of a message, the header
included, is at most 80 columns, and the body says why the change is made.
Documentation lands in the commit that changes the behavior it describes, not
in a later one. A change to a `komorebic` subcommand regenerates its page in
[`docs/cli`](docs/cli) with `just docgen`.
## Zero-Clause BSD
```text
Permission to use, copy, modify, and/or distribute this software for
any purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE
FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
```
+6492
View File
File diff suppressed because it is too large. Load diff
+47
View File
@@ -0,0 +1,47 @@
[workspace]
resolver = "2"
members = [
"komorebi",
"komorebi-client",
"komorebi-hotkeys",
"komorebic",
"version",
]
[workspace.package]
version = "0.1.0"
[workspace.dependencies]
# upstream's layouts, at a revision of its `next` branch that has the fix for resizing a tile by
# dragging its edge (LGUG2Z/komorebi#1765), the placement helpers komorebi for KDE uses and the
# platform-free half of the rework of the Scrolling layout
komorebi-layouts = { git = "https://github.com/LGUG2Z/komorebi", rev = "6d862a11471b819236000a463c575abce2ed13c3", features = [
"schemars",
] }
# the model of a strip of columns that the Scrolling layout is laid out with, from the same
# revision, whose layouts re-export it as `komorebi_layouts::scrolling::model`
komorebi-scrolling = { git = "https://github.com/LGUG2Z/komorebi", rev = "6d862a11471b819236000a463c575abce2ed13c3" }
# the themes (and the palettes made from pictures), from the same upstream revision
komorebi-themes = { git = "https://github.com/LGUG2Z/komorebi", rev = "6d862a11471b819236000a463c575abce2ed13c3" }
chrono = "0.4"
clap = { version = "4", features = ["derive", "wrap_help"] }
color-eyre = "0.6"
crossbeam-channel = "0.5"
crossbeam-utils = "0.8"
dirs = "7"
hotwatch = "0.5"
lazy_static = "1"
pastey = "0.2"
schemars = "1.1"
serde = { version = "1", features = ["derive"] }
serde_json = { package = "serde_json_lenient", version = "0.2" }
shadow-rs = "2"
sysinfo = "0.40"
tracing = "0.1"
tracing-appender = "0.2"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
[workspace.metadata.crane]
name = "komorebi-workspace"
+108
View File
@@ -0,0 +1,108 @@
# Komorebi License
Version 2.0.0
## Acceptance
In order to get any license under these terms, you must agree
to them as both strict obligations and conditions to all
your licenses.
## Copyright License
The licensor grants you a copyright license for the software
to do everything you might do with the software that would
otherwise infringe the licensor's copyright in it for any
permitted purpose. However, you may only distribute the source
code of the software according to the [Distribution License](
#distribution-license), you may only make changes according
to the [Changes License](#changes-license), and you may not
otherwise distribute the software or new works based on the
software.
## Distribution License
The licensor grants you an additional copyright license to
distribute copies of the source code of the software. Your
license to distribute covers distributing the source code of
the software with changes permitted by the [Changes License](
#changes-license).
## Changes License
The licensor grants you an additional copyright license to
make changes for any permitted purpose.
## Patent License
The licensor grants you a patent license for the software that
covers patent claims the licensor can license, or becomes able
to license, that you would infringe by using the software.
## Personal Uses
Personal use for research, experiment, and testing for
the benefit of public knowledge, personal study, private
entertainment, hobby projects, amateur pursuits, or religious
observance, without any anticipated commercial application,
is use for a permitted purpose.
## Fair Use
You may have "fair use" rights for the software under the
law. These terms do not limit them.
## No Other Rights
These terms do not allow you to sublicense or transfer any of
your licenses to anyone else, or prevent the licensor from
granting licenses to anyone else. These terms do not imply
any other licenses.
## Patent Defense
If you make any written claim that the software infringes or
contributes to infringement of any patent, your patent license
for the software granted under these terms ends immediately. If
your company makes such a claim, your patent license ends
immediately for work on behalf of your company.
## Violations
The first time you are notified in writing that you have
violated any of these terms, or done anything with the software
not covered by your licenses, your licenses can nonetheless
continue if you come into full compliance with these terms,
and take practical steps to correct past violations, within
32 days of receiving notice. Otherwise, all your licenses
end immediately.
## No Liability
***As far as the law allows, the software comes as is, without
any warranty or condition, and the licensor will not be liable
to you for any damages arising out of these terms or the use
or nature of the software, under any kind of legal claim.***
## Definitions
The **licensor** is the individual or entity offering these
terms, and the **software** is the software the licensor makes
available under these terms.
**You** refers to the individual or entity agreeing to these
terms.
**Your company** is any legal entity, sole proprietorship,
or other kind of organization that you work for, plus all
organizations that have control over, are under the control of,
or are under common control with that organization. **Control**
means ownership of substantially all the assets of an entity,
or the power to direct its management and policies by vote,
contract, or otherwise. Control can be direct or indirect.
**Your licenses** are all the licenses granted to you for the
software under these terms.
**Use** means anything you do with the software requiring one
of your licenses.
+414
View File
@@ -0,0 +1,414 @@
# komorebi for KDE
A tiling window manager for KDE Plasma on Wayland, in the family of
[komorebi](https://github.com/LGUG2Z/komorebi) for Windows and
[komorebi for Mac](https://github.com/LGUG2Z/komorebi-for-mac). The daemon
decides where each window goes, and KWin, the window manager of Plasma, does the
moving and the drawing.
## Installing it
On NixOS, the flake's module, `services.komorebi`, installs `komorebi` and
`komorebic` and starts komorebi with every Plasma session: one flake input,
one module line and `services.komorebi.enable = true`. Elsewhere, both are
built from source, or taken from a release of this repository
([Binaries](#binaries)). [`docs/installation.md`](docs/installation.md) has the
module and the build from source. The Komorebi license does not allow anyone
else to redistribute binaries.
## Running it locally
```sh
nix develop
cargo run --bin komorebi --locked -- --version
cargo run --bin komorebi --locked -- --log-level debug
cargo run --bin komorebi --locked -- --fake-backend
```
Inside a Plasma Wayland session, `komorebi` loads a script into KWin, reads the
monitors and the windows that are open, tiles them, and tiles the windows again
whenever one opens, closes, takes the focus, is minimized or comes back, until
it is stopped with Ctrl-C. It needs KWin 6.8 or newer, which the NixOS module
checks against [`nix/supported-kwin.nix`](nix/supported-kwin.nix);
[`docs/dev/PLATFORM.md`](docs/dev/PLATFORM.md) has what it expects of the
session. Outside a Plasma session it exits with an error that says what is
missing. `--fake-backend` runs the window manager against an in-memory desktop
with one monitor and no windows instead.
While it runs, the daemon takes messages on a Unix socket, `komorebi.sock` in
`$XDG_RUNTIME_DIR/komorebi` (the local data directory when there is no runtime
directory): a message can ask for the state of the window manager, ask which
monitor, workspace or container has the focus, give the focus to another
window, move the focused window to another tile, change the layout, resize a
tile, float a window, give one window the whole work area or have KWin maximize it, retile every
monitor, or stop the daemon. [`komorebi-client`](komorebi-client) writes them, and `komorebic`,
the command line, is how a person sends them. `komorebic start` runs the
`komorebi` on the `PATH`, and passes it what follows a `--`. In a Plasma
session:
```sh
cargo build --locked
export PATH="$PWD/target/debug:$PATH"
komorebic start
komorebic state
komorebic stop
```
`komorebic start -- --fake-backend` tries the daemon and `komorebic` without a
compositor, against the in-memory desktop.
`nix develop` provides the Rust toolchain that [`rust-toolchain.toml`](rust-toolchain.toml)
selects, a nightly `rustfmt`, and the tools `just check` and the flake's checks
use. With [direnv](https://direnv.net), the [`.envrc`](.envrc) does it on
`cd`. On Linux, `nix run .#komorebi -- --version` builds and runs the daemon
without a checkout of the toolchain.
## Trying it in a virtual machine
On a Linux machine with KVM, which includes NixOS in WSL 2 on Windows 11, one command starts a
Plasma guest in which komorebi tiles a few windows, in a window of your desktop:
```sh
nix run .#run-kde
```
`run-kde --doctor` checks the machine and says how to fix what is missing.
[`docs/trying-it.md`](docs/trying-it.md) says what you need, what you see, the key bindings to try
and what to do when it does not start.
## Binaries
The [releases](https://github.com/LGUG2Z/komorebi-for-kde/releases) of this
repository have `komorebi` and `komorebic` for x86_64 and aarch64 Linux, one zip
per architecture, with a `checksums.txt` of SHA-256 sums. The `nightly`
prerelease is built from `master` every week. CI builds the binaries;
[`CONTRIBUTING.md`](CONTRIBUTING.md#releases) says how. They use the glibc of
the system they run on, which has to be 2.39 or newer at time of writing
(2026-10-28). NixOS cannot run them without
[nix-ld](https://github.com/nix-community/nix-ld); on NixOS, build komorebi
from this flake instead.
The [Komorebi License](LICENSE.md) allows anyone to distribute the source code,
but not binaries built from it. The releases of this repository are the only
binaries, and there is no public binary cache for the flake: nix builds
komorebi from source.
## Crates
- [`komorebi`](komorebi): the daemon, and the library behind it. The library has
the vocabulary the window manager is written in (`core`), the `Backend` trait
through which it reaches a compositor and the in-memory desktop the tests use
(`backend`), the backend that reaches KWin through a script it runs and edits
the settings of KWin's it needs in the user's `kwinrc`, the parking desktop it
hides the back of a stack and the windows behind a monocle on, and the borders
and animations it has KWin draw (`kwin`), the border and animation settings and
the look they make (`border_manager`, `animation`), the colors a theme gives the
borders (`theme_manager`), the wallpapers of monitors and workspaces, which it has
the Plasma shell show (`kwin::wallpaper`), the opacity of the windows that do not
have the focus (`transparency_manager`),
the model of what it tiles (`monitor`, `workspace`, `container`, `window`), the
window manager that keeps the model (`window_manager`), loads it from the
backend (`desktop`) and changes it when the compositor reports an event
(`window_manager_event`, `window_manager_event_listener`, `process_event`), the
`Ring` that holds monitors, workspaces and containers, and the lists in which
some elements are locked in place. It answers the messages on the daemon's
socket (`core::SocketMessage`, `process_command`), shows its state (`state`),
keeps the monitors in step with the compositor's outputs as they change size
and are unplugged and plugged in, and when the machine wakes or the screen is
unlocked (`monitor_reconciliator`, `reconcile`, `kwin::power`), sends its
subscribers a notification of each event, message and change of the monitors
it handles (`notify_subscribers`), and is configured by a `komorebi.json` that
it reads and reads again when it changes (`static_config`), and checks it, the
key binding file, and the desktop it runs on, for mistakes without the daemon
(`check`). With a key binding file, it registers keys with KWin's global
shortcut daemon and runs their commands (`kwin::hotkeys`).
- [`komorebi-client`](komorebi-client): a library that sends messages to the
daemon, reads its answers, subscribes to its notifications, and re-exports
the types they are made of.
- [`komorebi-hotkeys`](komorebi-hotkeys): reads the key binding files of skhd,
whkd and sxhkd into one model, with the keys as KDE stores them, plans each
binding as a KDE shortcut file or as a key komorebi registers itself, and has
the engine that decides, with no I/O of its own, which keys komorebi holds
and what each press does. It does not depend on the daemon. Its tests read the files in
[`komorebi-hotkeys/tests/fixtures`](komorebi-hotkeys/tests/fixtures), where
each case is written in every format that can express it.
- [`komorebic`](komorebic): the command line. A subcommand that asks something
of the daemon is one message on its socket, and the others work without the daemon:
`start` and the autostart commands start it, `check` looks at the files and the
desktop, `quickstart` writes files, `export-kde-shortcuts` and `hotkeys compile`
write the bindings of a key binding file that KDE can run by itself as shortcut
files, and `configuration`, `log`, `data-directory`, `completions`, the schema
printers and the hidden `docgen` print.
- [`version`](version): the version string every binary reports.
The layouts, which turn a work area and a number of containers into a rectangle
for each, are `komorebi-layouts` from [komorebi](https://github.com/LGUG2Z/komorebi),
a git dependency at the revision `Cargo.toml` pins.
## KWin effects
The flake also builds the KWin effects komorebi drives, which are not part of
KWin:
- `kde-rounded-corners-komorebi`
([`nix/kde-rounded-corners.nix`](nix/kde-rounded-corners.nix)): KDE Rounded
Corners 0.11.0, which draws an outline around each window, built so that KWin
does not load it until it is asked to, and with a patch that lets komorebi
give each window a color of its own.
- `kwin-effect-geometry-change-komorebi`
([`nix/kwin-effect-geometry-change.nix`](nix/kwin-effect-geometry-change.nix)):
Geometry Change 1.5, a scripted effect that animates a window that a program
or a script moves or resizes, with a patch that makes its easing curve a
setting.
Each one is a package for Linux and an attribute of `overlays.default`, built
with the KWin of the nixpkgs the overlay is applied to.
[`nix/tests/effects.nix`](nix/tests/effects.nix) checks the files each package
installs. [`docs/dev/PLATFORM.md`](docs/dev/PLATFORM.md#kwin-effects) has what
they need from KWin.
## Checks
`just check` runs the formatting check, clippy with warnings denied, the tests,
rustdoc with warnings denied, and the type check and tests of the bridge (no
package.json: `tsc` and `node` come from the dev shell), inside `nix develop`.
The test of the signals for sleep and lock starts private D-Bus buses with
`dbus-daemon`, which the dev shell has, and does nothing where there is none.
`nix flake check` runs the same checks as derivations, plus `cargo deny`, the
TOML and Nix formatting, the tests under `cargo nextest`, and
`nixos-module-eval`, which evaluates the NixOS module in real NixOS systems,
`keybindings-fixtures`, which runs every key binding file of the fixture corpus
through `komorebic hotkeys compile` and compares what it prints with
`nix/tests/keybindings.expected`, `schema-fresh`, which compares the schemas and
the options made from them with the Rust types, and `nix-options-validation`,
which checks the example configuration, in Nix and in JSON, against the schema,
all on Linux and on an Apple silicon Mac. On Linux it also builds the KWin effects and checks
their files, and boots every VM test, which needs KVM. A Mac runs the tests against the fake
desktop, since KWin only exists on Linux. `nix fmt` formats every file the checks look at.
The VM tests boot NixOS with Plasma and run a real KWin, on machines configured
with the NixOS module, so every one of them runs komorebi as the module installs
it. `just vm NAME` runs one; [`docs/dev/vm-tests.md`](docs/dev/vm-tests.md) has
the details, including how to run them on a Mac.
To try komorebi by hand in a real Plasma session, the flake has Plasma guests
to develop in. For an Apple silicon Mac there are two that QEMU runs, one with a
session that can be reached over RDP, and a disk image for UTM, which renders on
the Mac's GPU. For a Linux machine with KVM there are the same two QEMU guests,
for `x86_64` and for `aarch64`, and a demo guest of the session guest, which
shows komorebi tiling a few windows in the first minute. On Linux,
`nix run .#run-kde` (or `just run-kde`) starts the demo in a window, and
`run-kde --doctor` says what the machine lacks.
[`docs/dev/utm.md`](docs/dev/utm.md) says how to build and run them;
`plasma-guests-eval` evaluates them on every system, and `run-kde-dry-run` and
`run-kde-doctor` run the command against machines that a test makes up.
## How it fits together
The daemon decides where every window goes and asks the compositor to put it
there. Everything it needs from the compositor is behind one trait, `Backend`,
so the window manager logic runs against a real compositor and against an
in-memory fake desktop alike. [`docs/dev/ARCHITECTURE.md`](docs/dev/ARCHITECTURE.md)
describes the trait and where each of its rules is enforced.
On KDE Plasma the backend is in two parts. A script that komorebi loads into
KWin, the bridge, reports what KWin sees over the session bus, and carries out
the commands it is given as the answer to a call it holds open. The daemon keeps
a table of the windows and monitors from those reports, answers the window
manager's questions from it, and turns each report into an event for the window
manager. If KWin restarts, the daemon loads the bridge into the new one.
komorebi's workspaces are KWin's own virtual desktops: workspace `i` is desktop
`i`, and each monitor shows a desktop of its own, which the daemon has KWin do by
turning on its per-output virtual desktops (the setting is put back when the
daemon stops). Showing a workspace is a request to KWin, which shows the
windows of that desktop, hides the others, and gives the focus to one of them.
When something else switches a monitor to another desktop (a pager, a shortcut,
an application raising a window of another desktop), or puts a window on
another desktop, the window manager follows.
When a monitor changes size (a resolution, a scale, a panel that takes more room),
the bridge reports the outputs again and the monitor reconciliator, a thread of
the daemon, reads the size and the work area of every monitor and tiles the
workspace in front of the focused monitor in the area it now has. When an output
is unplugged, KWin takes its windows to the outputs that are left, and the
daemon takes the monitor's containers over to the monitors the windows are on,
tiles them there, and keeps the monitor, with its settings, for when it is
plugged in again. A window that something else moves to another output (a
shortcut, an application, KWin itself) is followed to the workspace of the same
number on that monitor and tiled there.
While the screen is locked or the machine is asleep KWin sends its clients no
frame callbacks, so what the daemon asked for in that time is not done. The
daemon watches for the machine waking up (logind's `PrepareForSleep`) and for
the lock screen going away (`org.freedesktop.ScreenSaver`), and then looks at
the monitors and at where every window is, and puts each in its tile. The lock
screen is a window of KWin's that the bridge does not report as an application
window, so it has no tile.
The window manager models the desktop as monitors, each with a ring of
workspaces, each with a ring of containers, each with a ring of windows. A
workspace's layout gives each of its containers a tile of the monitor's work
area, and every window of a container is moved onto its tile. At startup the
window manager loads the monitors and the windows that are open from the
backend and tiles them; after that it changes the model when the compositor
reports that a window was shown, closed, focused, minimized or restored, and
tiles the workspace in front again. A window the user drags with the pointer
onto the tile of another swaps places with it, and dragging the edge of a tile
resizes it, as `resize-edge` does, with the tiles next to the edge following it
while it is dragged. A window open at startup goes to the workspace whose desktop
it is on.
A container with more than one window is a stack: the layout gives it one tile,
and the window in front is in sight. The others are hidden, which on KWin means
moved to one more virtual desktop, `komorebi-park`, that nobody looks at and that
is not a workspace. The daemon makes it when it first needs it, removes it when
it stops, and removes one that a run that did not stop left behind. A monocle
hides the windows of the other containers there too.
Everything else reaches the daemon as a message on its socket: one JSON
`SocketMessage` per line, handled one at a time with the window manager
locked. A message that asks a question is answered on the same connection. A
message that gives an order changes the model the way an event does: `focus`
and `cycle-focus` give the focus to the container on one side of the focused
one in the layout, or to the next one in the workspace's order, and `move` and
`cycle-move` swap the focused container with that one and tile the workspace
again. `change-layout`, `cycle-layout` and `flip-layout` tile the workspace in
another layout, `layout-ratios` and `scrolling-layout-columns` tune it,
`toggle-tiling` stops it moving windows and starts it again,
`preselect-direction` reserves a tile for the next window, `resize-edge` and
`resize-axis` move the edges of the focused tile, `promote` brings the
focused window to the largest tile, `toggle-float` takes it out of the
layout, `toggle-monocle` gives its container the whole work area, hiding the
others, and puts it back, `toggle-maximize` has KWin maximize the focused window
and restore it (a window the user maximizes leaves the layout the same way, and
a fullscreen window is left where it is),
`toggle-workspace-layer` switches the focus commands between the tiles and the
floating windows, and `toggle-lock` keeps its container at its
place. The scrolling layout is a strip of columns that runs past the edges of
the monitor and scrolls to the window that has the focus. `minimize` and `close`
ask KWin to minimize or close the focused window, `unmanage` takes it out of the
layout until `manage` takes it back, and `toggle-pause` stops the daemon acting
on events and orders until it is resumed. The padding commands set the gaps around the tiles, and
the work area offsets keep parts of a monitor free of tiles. Rules decide which
windows are managed at all: `ignore-rule` keeps an application out of the
layout, `manage-rule` tiles it whatever the ignore rules say, and
`session-float-rule` floats the focused window and the windows like it, and a
workspace rule (`workspace-rule`, `initial-workspace-rule`, their named forms,
or `workspace_rules` in `komorebi.json`) sends the windows of an application to a
workspace, once or whenever the window manager looks, which it does at every event.
`focus-workspace` shows another workspace, and `move-to-workspace` and
`send-to-workspace` put the focused window on another workspace, with and
without showing it; their `cycle-` and `-last-workspace` forms go to the next,
the previous or the last workspace, `workspace-name` names a workspace for
`focus-named-workspace` and the other named commands, and `new-workspace` and
`close-workspace` add and remove one.
At the edge of a monitor, `focus` and `move` cross to the monitor on that side;
`focus-monitor`, `move-to-monitor`, `send-to-monitor` and their kind work on the
monitors, and `eager-focus` finds the window of an application wherever it is.
`stack` puts the focused window and the one next to it in one stack, `unstack`
takes it out again, and `stack-all` and `unstack-all` do it for a whole
workspace; `cycle-stack` and `focus-stack-window` bring another window of a
stack to the front, and `cycle-stack-index` moves the front one along it.
`toggle-window-container-behaviour` makes a window that opens join
the focused stack, and `toggle-float-override` makes it float.
The daemon is configured by `komorebi.json`: the file `--config` names, or the
one in `~/.config/komorebi`. It reads the file when it starts, once it has the
monitors, and gives each monitor the workspaces the file lists for it, with their
names, layouts, paddings and rules. It watches the file, and when it changes
applies it again to the windows it has. It also sets what a window that opens
gets (`window_container_behaviour`, `float_override`, `floating_layer_behaviour`,
for a workspace or for all of them) and what focusing does in monocle
(`monocle_focus_behaviour`). Where a new window goes in the layout is the
workspace's `initial_window_placement_rules`: after the focused container unless
they say another place, which can depend on the window's program, app id or
title. A key that komorebi for KDE does not read
is ignored, so one file serves every platform. Rules for particular applications
can be in files of their own, which `app_specific_configuration_path` names.
`workspace-layout-rule` makes a
workspace change layout with the number of windows it has, as the file's
`layout_rules` do, and `generate-static-config` prints the settings the daemon
has as a `komorebi.json`, and `replace-configuration` makes the daemon start over from
another file. `quickstart` writes an example configuration and sample key bindings, and
`enable-autostart` an autostart entry that has Plasma start komorebi at login. The Rust types that read the file describe it as a JSON Schema
(`schema.json`, written by `just jsonschema` and printed by `static-config-schema`), and the
module's `config` option is typed from that schema (`nix/komorebi-options.nix`, written by
`just nixgen`), so a configuration written in Nix is checked when it is evaluated.
`check` reads the file the way the daemon does and says in words what is wrong with it: JSON that
does not parse, with the line, a value komorebi does not read, a key that is not a setting (with
the nearest one that is), a workspace that is not tiled, and an applications file that is not
there. It looks at the key binding file as well (how many bindings it has, the lines that cannot
be read, and whether the shortcut files `hotkeys compile` wrote are the ones it would write now),
and at the desktop (a Plasma session on Wayland, KWin 6 on the session bus, the daemon and its
script in KWin, and what starts komorebi at login), unless `--configuration-only` leaves that out.
It exits with status 1 if something is an error.
A program such as a status bar can subscribe to the daemon's notifications: it
listens on a socket of its own, and after each event, each message and each
change of the monitors, the daemon connects to it and writes it with the state
of the window manager.
On NixOS, the module [`nix/nixos-module.nix`](nix/nixos-module.nix) runs the
daemon as a systemd user unit that the Plasma session starts, and systemd
starts it again if it fails.
The borders are KWin's: komorebi asks the backend for a look, a border of a
width, a radius and two colors, and the KWin backend has the KDE Rounded Corners
effect draw it, which the module installs. A border takes room around each
window, so the layout leaves the room while the compositor says it draws one, and
komorebi gives each window the border color of what it is to the layout: the focused
window, the others, a locked container, a floating window. `border`, `border-colour`,
`border-width` and `border-offset` set it. Windows going to their places are
animated by another effect, Geometry Change, which `animation`,
`animation-duration` and `animation-style` turn on and set. `transparency` makes
the windows that do not have the focus see-through, by the opacity KWin gives a
window, and `focus-follows-mouse` has KWin give the focus to the window under the
pointer, by its own focus policy. A theme gives the borders their colors, and
the palette of a picture is made and kept in the cache directory. A monitor or a workspace
can have a wallpaper, which the Plasma shell is asked to show when the workspace comes into view,
and which gives the borders the colors of its palette.
Key bindings are written in the format of skhd, whkd or sxhkd. `komorebi-hotkeys`
reads such a file into one model and sorts its bindings into static shortcuts,
which KDE runs by itself from a `.desktop` file, and those that need komorebi
to register the keys and decide what each press does. `komorebic hotkeys
compile` writes the static shortcuts, and the daemon runs the engine for the
rest: it registers their keys with KWin's global shortcut daemon over the
session bus and runs the command of each press. On NixOS, the module's
`keybindings` options do both: the static shortcuts go into the system profile,
and the unit starts the daemon with the file.
## Documentation
The user guide starts at [`docs/index.md`](docs/index.md),
[`docs/trying-it.md`](docs/trying-it.md) starts a guest in which komorebi tiles a few windows,
[`docs/installation.md`](docs/installation.md) says how to install komorebi,
[`docs/usage/configuration.md`](docs/usage/configuration.md) explains `komorebi.json`,
[`docs/example-configurations.md`](docs/example-configurations.md) has an example of it,
[`docs/usage/keybindings.md`](docs/usage/keybindings.md) how to give komorebi key bindings,
and [`docs/cli`](docs/cli) has a page for every `komorebic` subcommand, which
`just docgen` writes from the subcommands' help.
`cargo doc --workspace --no-deps --open` builds the API documentation.
[`CONTRIBUTING.md`](CONTRIBUTING.md) says how to work on the code.
[`docs/dev/ARCHITECTURE.md`](docs/dev/ARCHITECTURE.md) describes the model,
[`docs/dev/DESIGN.md`](docs/dev/DESIGN.md) says why it is built that way,
[`docs/dev/PLATFORM.md`](docs/dev/PLATFORM.md) what it needs from KDE Plasma,
[`docs/dev/COMPARE.md`](docs/dev/COMPARE.md) what is the same and what is different in
komorebi for Windows and komorebi for Mac,
[`docs/dev/vm-tests.md`](docs/dev/vm-tests.md) how the VM tests work, and
[`docs/dev/utm.md`](docs/dev/utm.md) how to develop in a Plasma guest, and
[`docs/dev/wsl2-probe.md`](docs/dev/wsl2-probe.md) how to find out whether a
NixOS-WSL2 machine can run one (`nix run .#wsl2-probe`).
## License
komorebi for KDE is under the [Komorebi License](LICENSE.md). Contributions
are accepted under the terms in [`CONTRIBUTING.md`](CONTRIBUTING.md).
The license lets others distribute the source code but not binaries, so there
is no public binary cache for what the flake builds: komorebi and the KWin
effects are built on each machine that installs them, with their dependencies
from nixpkgs. The patches to the effects in [`nix`](nix) are derivative works
of the effects, which are under the GNU General Public License version 3, and
are under the same license, as the header of each one states.
+104
View File
@@ -0,0 +1,104 @@
[graph]
targets = [
"x86_64-unknown-linux-gnu",
"aarch64-unknown-linux-gnu",
"aarch64-apple-darwin",
]
all-features = false
no-default-features = false
[output]
feature-depth = 1
[advisories]
ignore = [
{ id = "RUSTSEC-2024-0449", reason = "unsafe-libyaml comes with serde_yaml, which komorebi-layouts reads Windows-only custom layouts with; nothing here calls it" },
{ id = "RUSTSEC-2026-0370", reason = "zvariant is maintained inside zbus from zbus 6; komorebi talks to KWin with zbus 5" },
{ id = "RUSTSEC-2026-0371", reason = "zbus_names is maintained inside zbus from zbus 6; komorebi talks to KWin with zbus 5" },
{ id = "RUSTSEC-2026-0372", reason = "zvariant_derive is maintained inside zbus from zbus 6; komorebi talks to KWin with zbus 5" },
{ id = "RUSTSEC-2024-0320", reason = "yaml-rust comes with serde_yaml 0.8 under flavours, which komorebi-themes makes palettes with; not using any yaml features from this library" },
{ id = "RUSTSEC-2025-0056", reason = "adler comes with the image decoder under flavours, which komorebi-themes makes palettes with; only used for color palette generation" },
{ id = "RUSTSEC-2026-0192", reason = "ttf-parser comes with the fonts of egui, which komorebi-themes pulls in for its theme types; komorebi draws no text" },
]
[licenses]
allow = [
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause",
"CC0-1.0",
"ISC",
"MIT",
"MPL-2.0",
"OFL-1.1",
"Ubuntu-font-1.0",
"Unicode-3.0",
"Zlib",
"LicenseRef-Komorebi-2.0",
]
confidence-threshold = 0.8
[[licenses.clarify]]
crate = "komorebi"
expression = "LicenseRef-Komorebi-2.0"
license-files = []
[[licenses.clarify]]
crate = "komorebi-client"
expression = "LicenseRef-Komorebi-2.0"
license-files = []
[[licenses.clarify]]
crate = "komorebi-hotkeys"
expression = "LicenseRef-Komorebi-2.0"
license-files = []
[[licenses.clarify]]
crate = "komorebi-layouts"
expression = "LicenseRef-Komorebi-2.0"
license-files = []
[[licenses.clarify]]
crate = "komorebi-scrolling"
expression = "LicenseRef-Komorebi-2.0"
license-files = []
[[licenses.clarify]]
crate = "komorebic"
expression = "LicenseRef-Komorebi-2.0"
license-files = []
[[licenses.clarify]]
crate = "komorebi-themes"
expression = "LicenseRef-Komorebi-2.0"
license-files = []
[[licenses.clarify]]
crate = "version"
expression = "LicenseRef-Komorebi-2.0"
license-files = []
[[licenses.clarify]]
crate = "base16-egui-themes"
expression = "MIT"
license-files = []
[bans]
multiple-versions = "allow"
wildcards = "allow"
highlight = "all"
workspace-default-features = "allow"
external-default-features = "allow"
[sources]
unknown-registry = "deny"
unknown-git = "deny"
allow-registry = ["https://github.com/rust-lang/crates.io-index"]
allow-git = [
"https://github.com/LGUG2Z/base16-egui-themes",
"https://github.com/LGUG2Z/base16_color_scheme",
"https://github.com/LGUG2Z/catppuccin-egui",
"https://github.com/LGUG2Z/flavours",
"https://github.com/LGUG2Z/komorebi",
"https://github.com/LGUG2Z/whkd",
]
@@ -0,0 +1,19 @@
```text
Adjust container padding on the focused workspace
Usage: adjust-container-padding <SIZING> <ADJUSTMENT>
Arguments:
<SIZING>
Possible values:
- increase: Increase
- decrease: Decrease
<ADJUSTMENT>
Pixels to adjust by as an integer
Options:
-h, --help
Print help (see a summary with '-h')
```
@@ -0,0 +1,19 @@
```text
Adjust workspace padding on the focused workspace
Usage: adjust-workspace-padding <SIZING> <ADJUSTMENT>
Arguments:
<SIZING>
Possible values:
- increase: Increase
- decrease: Decrease
<ADJUSTMENT>
Pixels to adjust by as an integer
Options:
-h, --help
Print help (see a summary with '-h')
```
@@ -0,0 +1,19 @@
```text
Set the duration for movement animations in ms
Usage: animation-duration [OPTIONS] <DURATION>
Arguments:
<DURATION>
Desired animation durations in ms
Options:
-a, --animation-type <ANIMATION_TYPE>
Animation type to apply the duration to. If not specified, sets global duration
[possible values: movement]
-h, --help
Print help
```
@@ -0,0 +1,14 @@
```text
Set the frames per second for movement animations
Usage: animation-fps <FPS>
Arguments:
<FPS>
Desired animation frames per second
Options:
-h, --help
Print help
```
@@ -0,0 +1,53 @@
```text
Set the ease function for movement animations
Usage: animation-style [OPTIONS]
Options:
-s, --style <STYLE>
Desired ease function for animation
Possible values:
- linear: Linear
- ease-in-sine: Ease in sine
- ease-out-sine: Ease out sine
- ease-in-out-sine: Ease in out sine
- ease-in-quad: Ease in quad
- ease-out-quad: Ease out quad
- ease-in-out-quad: Ease in out quad
- ease-in-cubic: Ease in cubic
- ease-out-cubic: Ease out cubic
- ease-in-out-cubic: Ease in out cubic
- ease-in-quart: Ease in quart
- ease-out-quart: Ease out quart
- ease-in-out-quart: Ease in out quart
- ease-in-quint: Ease in quint
- ease-out-quint: Ease out quint
- ease-in-out-quint: Ease in out quint
- ease-in-expo: Ease in expo
- ease-out-expo: Ease out expo
- ease-in-out-expo: Ease in out expo
- ease-in-circ: Ease in circ
- ease-out-circ: Ease out circ
- ease-in-out-circ: Ease in out circ
- ease-in-back: Ease in back
- ease-out-back: Ease out back
- ease-in-out-back: Ease in out back
- ease-in-elastic: Ease in elastic
- ease-out-elastic: Ease out elastic
- ease-in-out-elastic: Ease in out elastic
- ease-in-bounce: Ease in bounce
- ease-out-bounce: Ease out bounce
- ease-in-out-bounce: Ease in out bounce
[default: linear]
-a, --animation-type <ANIMATION_TYPE>
Animation type to apply the style to. If not specified, sets global style
[possible values: movement]
-h, --help
Print help (see a summary with '-h')
```
+19
View File
@@ -0,0 +1,19 @@
```text
Enable or disable movement animations
Usage: animation [OPTIONS] <BOOLEAN_STATE>
Arguments:
<BOOLEAN_STATE>
[possible values: enable, disable]
Options:
-a, --animation-type <ANIMATION_TYPE>
Animation type to apply the state to. If not specified, sets global state
[possible values: movement]
-h, --help
Print help
```
@@ -0,0 +1,10 @@
```text
Generate a JSON Schema for applications.json
Usage: application-specific-configuration-schema
Options:
-h, --help
Print help
```
@@ -0,0 +1,24 @@
```text
Set the color for a window border kind
Usage: border-colour [OPTIONS] <R> <G> <B>
Arguments:
<R>
Red
<G>
Green
<B>
Blue
Options:
-w, --window-kind <WINDOW_KIND>
[default: single]
[possible values: single, stack, monocle, unfocused, unfocused-locked, floating]
-h, --help
Print help
```
@@ -0,0 +1,14 @@
```text
Set the border offset
Usage: border-offset <OFFSET>
Arguments:
<OFFSET>
Desired offset of the window border
Options:
-h, --help
Print help
```
+14
View File
@@ -0,0 +1,14 @@
```text
Set the border width
Usage: border-width <WIDTH>
Arguments:
<WIDTH>
Desired width of the window border
Options:
-h, --help
Print help
```
+14
View File
@@ -0,0 +1,14 @@
```text
Enable or disable borders
Usage: border <BOOLEAN_STATE>
Arguments:
<BOOLEAN_STATE>
[possible values: enable, disable]
Options:
-h, --help
Print help
```
@@ -0,0 +1,10 @@
```text
Cancel a workspace preselect set by the preselect-direction command, if one exists
Usage: cancel-preselect
Options:
-h, --help
Print help
```
+10
View File
@@ -0,0 +1,10 @@
```text
Scroll the Scrolling layout so that the focused column is in the middle of the screen, once
Usage: center-focus
Options:
-h, --help
Print help
```
@@ -0,0 +1,23 @@
```text
Set the layout on the focused workspace
Usage: change-layout <DEFAULT_LAYOUT>
Arguments:
<DEFAULT_LAYOUT>
Possible values:
- bsp: BSP Layout
- columns: Columns Layout
- rows: Rows Layout
- vertical-stack: Vertical Stack Layout
- horizontal-stack: Horizontal Stack Layout
- ultrawide-vertical-stack: Ultrawide Vertical Stack Layout
- grid: Grid Layout
- right-main-vertical-stack: Right Main Vertical Stack Layout
- scrolling: Scrolling Layout
Options:
-h, --help
Print help (see a summary with '-h')
```
+16
View File
@@ -0,0 +1,16 @@
```text
Check komorebi configuration and the desktop it runs on for common errors
Usage: check [OPTIONS]
Options:
-k, --komorebi-config <KOMOREBI_CONFIG>
Path to a static configuration JSON file
--configuration-only
Look at the configuration and the key bindings only, not at the desktop
-h, --help
Print help
```
@@ -0,0 +1,10 @@
```text
Remove all application association rules for all workspaces
Usage: clear-all-workspace-rules
Options:
-h, --help
Print help
```
@@ -0,0 +1,14 @@
```text
Clear all dynamic layout rules for the specified workspace
Usage: clear-named-workspace-layout-rules <WORKSPACE>
Arguments:
<WORKSPACE>
Target workspace name
Options:
-h, --help
Print help
```
@@ -0,0 +1,14 @@
```text
Remove all application association rules for a named workspace
Usage: clear-named-workspace-rules <WORKSPACE>
Arguments:
<WORKSPACE>
Name of a workspace
Options:
-h, --help
Print help
```
@@ -0,0 +1,10 @@
```text
Clear all session float rules
Usage: clear-session-float-rules
Options:
-h, --help
Print help
```
@@ -0,0 +1,17 @@
```text
Clear all dynamic layout rules for the specified workspace
Usage: clear-workspace-layout-rules <MONITOR> <WORKSPACE>
Arguments:
<MONITOR>
Monitor index (zero-indexed)
<WORKSPACE>
Workspace index on the specified monitor (zero-indexed)
Options:
-h, --help
Print help
```
@@ -0,0 +1,17 @@
```text
Remove all application association rules for a workspace by monitor and workspace index
Usage: clear-workspace-rules <MONITOR> <WORKSPACE>
Arguments:
<MONITOR>
Monitor index (zero-indexed)
<WORKSPACE>
Workspace index on the specified monitor (zero-indexed)
Options:
-h, --help
Print help
```
@@ -0,0 +1,10 @@
```text
Close the focused workspace (must be empty and unnamed)
Usage: close-workspace
Options:
-h, --help
Print help
```
+10
View File
@@ -0,0 +1,10 @@
```text
Close the focused window
Usage: close
Options:
-h, --help
Print help
```
+14
View File
@@ -0,0 +1,14 @@
```text
Generate komorebic CLI completions for the target shell
Usage: completions <SHELL>
Arguments:
<SHELL>
[possible values: bash, elvish, fish, powershell, zsh]
Options:
-h, --help
Print help
```
@@ -0,0 +1,10 @@
```text
Show the path to komorebi.json
Usage: configuration
Options:
-h, --help
Print help
```
+14
View File
@@ -0,0 +1,14 @@
```text
Take the neighbouring window on one side into the focused column of the Scrolling layout
Usage: consume <OPERATION_DIRECTION>
Arguments:
<OPERATION_DIRECTION>
[possible values: left, right, up, down]
Options:
-h, --help
Print help
```
@@ -0,0 +1,20 @@
```text
Set the container padding for the specified workspace
Usage: container-padding <MONITOR> <WORKSPACE> <SIZE>
Arguments:
<MONITOR>
Monitor index (zero-indexed)
<WORKSPACE>
Workspace index on the specified monitor (zero-indexed)
<SIZE>
Pixels to pad with as an integer
Options:
-h, --help
Print help
```
@@ -0,0 +1,19 @@
```text
Set the behaviour when moving windows across monitor boundaries
Usage: cross-monitor-move-behaviour <MOVE_BEHAVIOUR>
Arguments:
<MOVE_BEHAVIOUR>
Possible values:
- swap: Swap the window container with the window container at the edge of the adjacent
monitor
- insert: Insert the window container into the focused workspace on the adjacent monitor
- no-op: Do nothing if trying to move a window container in the direction of an adjacent
monitor
Options:
-h, --help
Print help (see a summary with '-h')
```
@@ -0,0 +1,14 @@
```text
Focus the next empty workspace in the given cycle direction (if one exists)
Usage: cycle-empty-workspace <CYCLE_DIRECTION>
Arguments:
<CYCLE_DIRECTION>
[possible values: previous, next]
Options:
-h, --help
Print help
```
+14
View File
@@ -0,0 +1,14 @@
```text
Change focus to the window in the specified cycle direction
Usage: cycle-focus <CYCLE_DIRECTION>
Arguments:
<CYCLE_DIRECTION>
[possible values: previous, next]
Options:
-h, --help
Print help
```
+14
View File
@@ -0,0 +1,14 @@
```text
Cycle between available layouts
Usage: cycle-layout <CYCLE_DIRECTION>
Arguments:
<CYCLE_DIRECTION>
[possible values: previous, next]
Options:
-h, --help
Print help
```
@@ -0,0 +1,14 @@
```text
Focus the monitor in the given cycle direction
Usage: cycle-monitor <CYCLE_DIRECTION>
Arguments:
<CYCLE_DIRECTION>
[possible values: previous, next]
Options:
-h, --help
Print help
```
@@ -0,0 +1,14 @@
```text
Move the focused window to the monitor in the given cycle direction
Usage: cycle-move-to-monitor <CYCLE_DIRECTION>
Arguments:
<CYCLE_DIRECTION>
[possible values: previous, next]
Options:
-h, --help
Print help
```
@@ -0,0 +1,14 @@
```text
Move the focused window to the workspace in the given cycle direction
Usage: cycle-move-to-workspace <CYCLE_DIRECTION>
Arguments:
<CYCLE_DIRECTION>
[possible values: previous, next]
Options:
-h, --help
Print help
```
@@ -0,0 +1,14 @@
```text
Move the focused workspace monitor in the given cycle direction
Usage: cycle-move-workspace-to-monitor <CYCLE_DIRECTION>
Arguments:
<CYCLE_DIRECTION>
[possible values: previous, next]
Options:
-h, --help
Print help
```
+14
View File
@@ -0,0 +1,14 @@
```text
Move the focused window in the specified cycle direction
Usage: cycle-move <CYCLE_DIRECTION>
Arguments:
<CYCLE_DIRECTION>
[possible values: previous, next]
Options:
-h, --help
Print help
```
@@ -0,0 +1,14 @@
```text
Send the focused window to the monitor in the given cycle direction
Usage: cycle-send-to-monitor <CYCLE_DIRECTION>
Arguments:
<CYCLE_DIRECTION>
[possible values: previous, next]
Options:
-h, --help
Print help
```
@@ -0,0 +1,14 @@
```text
Send the focused window to the workspace in the given cycle direction
Usage: cycle-send-to-workspace <CYCLE_DIRECTION>
Arguments:
<CYCLE_DIRECTION>
[possible values: previous, next]
Options:
-h, --help
Print help
```
@@ -0,0 +1,14 @@
```text
Cycle the index of the focused window in the focused stack in the specified cycle direction
Usage: cycle-stack-index <CYCLE_DIRECTION>
Arguments:
<CYCLE_DIRECTION>
[possible values: previous, next]
Options:
-h, --help
Print help
```
+14
View File
@@ -0,0 +1,14 @@
```text
Cycle the focused stack in the specified cycle direction
Usage: cycle-stack <CYCLE_DIRECTION>
Arguments:
<CYCLE_DIRECTION>
[possible values: previous, next]
Options:
-h, --help
Print help
```
@@ -0,0 +1,14 @@
```text
Focus the workspace in the given cycle direction
Usage: cycle-workspace <CYCLE_DIRECTION>
Arguments:
<CYCLE_DIRECTION>
[possible values: previous, next]
Options:
-h, --help
Print help
```
@@ -0,0 +1,10 @@
```text
Show the path to komorebi's data directory, which has its socket
Usage: data-directory
Options:
-h, --help
Print help
```
@@ -0,0 +1,10 @@
```text
Removes the XDG autostart entry
Usage: disable-autostart
Options:
-h, --help
Print help
```
@@ -0,0 +1,17 @@
```text
Set the display index preference for a monitor identified using its display name
Usage: display-index-preference <INDEX_PREFERENCE> <DISPLAY>
Arguments:
<INDEX_PREFERENCE>
Preferred monitor index (zero-indexed)
<DISPLAY>
Display name as identified in komorebic state
Options:
-h, --help
Print help
```
+14
View File
@@ -0,0 +1,14 @@
```text
Focus the first managed window matching the given executable
Usage: eager-focus <EXE>
Arguments:
<EXE>
Case-sensitive exe identifier
Options:
-h, --help
Print help
```
@@ -0,0 +1,13 @@
```text
Writes an XDG autostart entry so komorebi starts with the Plasma session
Usage: enable-autostart [OPTIONS]
Options:
-c, --config <CONFIG>
Path to a static configuration JSON file
-h, --help
Print help
```
@@ -0,0 +1,10 @@
```text
Enforce all workspace rules, including initial workspace rules that have already been applied
Usage: enforce-workspace-rules
Options:
-h, --help
Print help
```
@@ -0,0 +1,17 @@
```text
Create these many named workspaces for the specified monitor
Usage: ensure-named-workspaces <MONITOR> [NAMES]...
Arguments:
<MONITOR>
Monitor index (zero-indexed)
[NAMES]...
Names of desired workspaces
Options:
-h, --help
Print help
```
@@ -0,0 +1,17 @@
```text
Create at least this many workspaces for the specified monitor
Usage: ensure-workspaces <MONITOR> <WORKSPACE_COUNT>
Arguments:
<MONITOR>
Monitor index (zero-indexed)
<WORKSPACE_COUNT>
Number of desired workspaces
Options:
-h, --help
Print help
```
+11
View File
@@ -0,0 +1,11 @@
```text
Make the focused column of the Scrolling layout fill the room that the columns in view leave on the
screen, which does nothing in any other layout
Usage: expand
Options:
-h, --help
Print help
```
+11
View File
@@ -0,0 +1,11 @@
```text
Take the focused window out of its column in the Scrolling layout and put it in a column of its own
on the right
Usage: expel
Options:
-h, --help
Print help
```
@@ -0,0 +1,22 @@
```text
Turn an skhdrc into KDE global shortcuts (they work over RDP, unlike evdev hotkey daemons)
Usage: export-kde-shortcuts [OPTIONS]
Options:
-s, --skhdrc <SKHDRC>
The skhdrc to translate [default: skhdrc in the komorebi config directory]
-o, --output <OUTPUT>
Where to write the shortcut files [default: $XDG_DATA_HOME/kglobalaccel]
--reload
Activate shortcuts that are new straight away, instead of at the next login
--dry-run
Show the shortcuts that would be written without writing anything
-h, --help
Print help
```
+17
View File
@@ -0,0 +1,17 @@
```text
Flip the layout on the focused workspace
Usage: flip-layout <AXIS>
Arguments:
<AXIS>
Possible values:
- horizontal: Horizontal axis
- vertical: Vertical axis
- horizontal-and-vertical: Both horizontal and vertical axes
Options:
-h, --help
Print help (see a summary with '-h')
```
@@ -0,0 +1,10 @@
```text
Focus the last focused workspace on the focused monitor
Usage: focus-last-workspace
Options:
-h, --help
Print help
```
@@ -0,0 +1,10 @@
```text
Focus the monitor at the current cursor location
Usage: focus-monitor-at-cursor
Options:
-h, --help
Print help
```
@@ -0,0 +1,17 @@
```text
Focus the specified workspace on the target monitor
Usage: focus-monitor-workspace <TARGET_MONITOR> <TARGET_WORKSPACE>
Arguments:
<TARGET_MONITOR>
Target monitor index (zero-indexed)
<TARGET_WORKSPACE>
Workspace index on the target monitor (zero-indexed)
Options:
-h, --help
Print help
```
@@ -0,0 +1,14 @@
```text
Focus the specified monitor
Usage: focus-monitor <TARGET>
Arguments:
<TARGET>
Target index (zero-indexed)
Options:
-h, --help
Print help
```
@@ -0,0 +1,14 @@
```text
Focus the specified workspace
Usage: focus-named-workspace <WORKSPACE>
Arguments:
<WORKSPACE>
Target workspace name
Options:
-h, --help
Print help
```
@@ -0,0 +1,14 @@
```text
Focus the specified window index in the focused stack
Usage: focus-stack-window <TARGET>
Arguments:
<TARGET>
Target index (zero-indexed)
Options:
-h, --help
Print help
```
@@ -0,0 +1,14 @@
```text
Focus the specified workspace on the focused monitor
Usage: focus-workspace <TARGET>
Arguments:
<TARGET>
Target index (zero-indexed)
Options:
-h, --help
Print help
```
@@ -0,0 +1,14 @@
```text
Focus the specified workspace on all monitors
Usage: focus-workspaces <TARGET>
Arguments:
<TARGET>
Target index (zero-indexed)
Options:
-h, --help
Print help
```
+14
View File
@@ -0,0 +1,14 @@
```text
Change focus to the window in the specified direction
Usage: focus <OPERATION_DIRECTION>
Arguments:
<OPERATION_DIRECTION>
[possible values: left, right, up, down]
Options:
-h, --help
Print help
```
@@ -0,0 +1,14 @@
```text
Set container padding on the focused workspace
Usage: focused-workspace-container-padding <SIZE>
Arguments:
<SIZE>
Pixels size to set as an integer
Options:
-h, --help
Print help
```
@@ -0,0 +1,14 @@
```text
Set workspace padding on the focused workspace
Usage: focused-workspace-padding <SIZE>
Arguments:
<SIZE>
Pixels size to set as an integer
Options:
-h, --help
Print help
```
@@ -0,0 +1,10 @@
```text
Generates a static configuration JSON file based on the current window manager state
Usage: generate-static-config
Options:
-h, --help
Print help
```
+10
View File
@@ -0,0 +1,10 @@
```text
Show a JSON representation of the current global state
Usage: global-state
Options:
-h, --help
Print help
```
@@ -0,0 +1,23 @@
```text
Set offsets to exclude parts of the work area from tiling
Usage: global-work-area-offset <LEFT> <TOP> <RIGHT> <BOTTOM>
Arguments:
<LEFT>
Size of the left work area offset (set right to left * 2 to maintain right padding)
<TOP>
Size of the top work area offset (set bottom to the same value to maintain bottom padding)
<RIGHT>
Size of the right work area offset
<BOTTOM>
Size of the bottom work area offset
Options:
-h, --help
Print help
```
@@ -0,0 +1,41 @@
```text
Plan the bindings of a key binding file, and write those that are static shortcuts as KDE shortcut
files
Usage: compile [OPTIONS] [FILE]
Arguments:
[FILE]
The key binding file [default: the first of skhdrc, whkdrc and sxhkdrc in the komorebi
config directory]
Options:
-f, --format <FORMAT>
The format of the file [default: from the end of its name: skhdrc, whkdrc or sxhkdrc]
[possible values: skhd, whkd, sxhkd]
-m, --mode <MODE>
Which bindings are static shortcuts: none (engine), every binding a shortcut file can
express (auto), or only those, leaving the others out (static)
[default: engine]
[possible values: auto, engine, static]
-o, --output <OUTPUT>
Where to write the shortcut files [default: $XDG_DATA_HOME/kglobalaccel]
--strict
Write nothing, and fail, when a diagnostic is a warning or an error: something in the file
is not realized the way its own hotkey daemon realizes it
--reload
Activate shortcuts that are new straight away, instead of at the next login
--dry-run
Show the shortcuts that would be written without writing anything
-h, --help
Print help
```
@@ -0,0 +1,10 @@
```text
Unregister every key komorebi has registered with KDE, whether a daemon runs or not
Usage: release
Options:
-h, --help
Print help
```
@@ -0,0 +1,10 @@
```text
Have the daemon read its key binding file again
Usage: reload
Options:
-h, --help
Print help
```
@@ -0,0 +1,10 @@
```text
Show the keys komorebi has registered with KDE, and what the engine of the daemon is doing
Usage: state
Options:
-h, --help
Print help
```
+19
View File
@@ -0,0 +1,19 @@
```text
Key bindings: KDE global shortcuts from a key binding file, and the keys of the daemon
Usage: hotkeys <COMMAND>
Commands:
compile Plan the bindings of a key binding file, and write those that are static shortcuts as KDE
shortcut files
state Show the keys komorebi has registered with KDE, and what the engine of the daemon is
doing
reload Have the daemon read its key binding file again
release Unregister every key komorebi has registered with KDE, whether a daemon runs or not
help Print this message or the help of the given subcommand(s)
Options:
-h, --help
Print help
```
+21
View File
@@ -0,0 +1,21 @@
```text
Add a rule to ignore the specified application
Usage: ignore-rule <IDENTIFIER> <ID>
Arguments:
<IDENTIFIER>
Possible values:
- exe: Executable name
- class: Role or subrole
- title: Window title
- path: Executable path
<ID>
Identifier as a string
Options:
-h, --help
Print help (see a summary with '-h')
```
@@ -0,0 +1,24 @@
```text
Add a rule to associate an application with a named workspace on first show
Usage: initial-named-workspace-rule <IDENTIFIER> <ID> <WORKSPACE>
Arguments:
<IDENTIFIER>
Possible values:
- exe: Executable name
- class: Role or subrole
- title: Window title
- path: Executable path
<ID>
Identifier as a string
<WORKSPACE>
Name of a workspace
Options:
-h, --help
Print help (see a summary with '-h')
```
@@ -0,0 +1,27 @@
```text
Add a rule to associate an application with a workspace on first show
Usage: initial-workspace-rule <IDENTIFIER> <ID> <MONITOR> <WORKSPACE>
Arguments:
<IDENTIFIER>
Possible values:
- exe: Executable name
- class: Role or subrole
- title: Window title
- path: Executable path
<ID>
Identifier as a string
<MONITOR>
Monitor index (zero-indexed)
<WORKSPACE>
Workspace index on the specified monitor (zero-indexed)
Options:
-h, --help
Print help (see a summary with '-h')
```
@@ -0,0 +1,16 @@
```text
Set the layout column and row ratios for the focused workspace
Usage: layout-ratios [OPTIONS]
Options:
-c, --columns <COLUMNS>...
Column width ratios (space-separated values between 0.1 and 0.9)
-r, --rows <ROWS>...
Row height ratios (space-separated values between 0.1 and 0.9)
-h, --help
Print help
```
+14
View File
@@ -0,0 +1,14 @@
```text
Load the resize layout dimensions from a file
Usage: load-resize <PATH>
Arguments:
<PATH>
File from which the resize layout dimensions should be loaded
Options:
-h, --help
Print help
```
+10
View File
@@ -0,0 +1,10 @@
```text
Tail komorebi's process logs (cancel with Ctrl-C)
Usage: log
Options:
-h, --help
Print help
```
+21
View File
@@ -0,0 +1,21 @@
```text
Add a rule to always manage the specified application
Usage: manage-rule <IDENTIFIER> <ID>
Arguments:
<IDENTIFIER>
Possible values:
- exe: Executable name
- class: Role or subrole
- title: Window title
- path: Executable path
<ID>
Identifier as a string
Options:
-h, --help
Print help (see a summary with '-h')
```
+10
View File
@@ -0,0 +1,10 @@
```text
Force komorebi to manage the focused window
Usage: manage
Options:
-h, --help
Print help
```
+10
View File
@@ -0,0 +1,10 @@
```text
Minimize the focused window
Usage: minimize
Options:
-h, --help
Print help
```
@@ -0,0 +1,10 @@
```text
Show information about connected monitors
Usage: monitor-information
Options:
-h, --help
Print help
```
@@ -0,0 +1,26 @@
```text
Set offsets for a monitor to exclude parts of the work area from tiling
Usage: monitor-work-area-offset <MONITOR> <LEFT> <TOP> <RIGHT> <BOTTOM>
Arguments:
<MONITOR>
Monitor index (zero-indexed)
<LEFT>
Size of the left work area offset (set right to left * 2 to maintain right padding)
<TOP>
Size of the top work area offset (set bottom to the same value to maintain bottom padding)
<RIGHT>
Size of the right work area offset
<BOTTOM>
Size of the bottom work area offset
Options:
-h, --help
Print help
```
@@ -0,0 +1,18 @@
```text
Set the behavior when focusing in a direction while a monocle container is active
Usage: monocle-focus-behaviour <BEHAVIOUR>
Arguments:
<BEHAVIOUR>
Desired monocle focus behavior
Possible values:
- cycle: Cycle the monocle container to the next/previous container in the workspace
- no-op: Do nothing, allowing focus to fall through to cross-monitor logic
Options:
-h, --help
Print help (see a summary with '-h')
```
@@ -0,0 +1,14 @@
```text
Enable or disable mouse follows focus on all workspaces
Usage: mouse-follows-focus <BOOLEAN_STATE>
Arguments:
<BOOLEAN_STATE>
[possible values: enable, disable]
Options:
-h, --help
Print help
```
Loaded 100 of 654 files, more files were not shown because too many files have changed in this diff. Show more