{"id":51328190,"url":"https://github.com/rdicosmo/kwin-focus","last_synced_at":"2026-07-01T20:04:30.727Z","repository":{"id":361654787,"uuid":"1255276857","full_name":"rdicosmo/kwin-focus","owner":"rdicosmo","description":"List and focus application windows on KDE Plasma 6 (X11 \u0026 Wayland), fully Activities-aware — a CLI + Plasma applet replacement for wmctrl/xdotool.","archived":false,"fork":false,"pushed_at":"2026-05-31T16:38:26.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-31T18:21:42.046Z","etag":null,"topics":["activities","kde","kwin","plasma","wayland","window-management","x11"],"latest_commit_sha":null,"homepage":null,"language":"QML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rdicosmo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-31T16:21:54.000Z","updated_at":"2026-05-31T16:38:30.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/rdicosmo/kwin-focus","commit_stats":null,"previous_names":["rdicosmo/kwin-focus"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/rdicosmo/kwin-focus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdicosmo%2Fkwin-focus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdicosmo%2Fkwin-focus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdicosmo%2Fkwin-focus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdicosmo%2Fkwin-focus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rdicosmo","download_url":"https://codeload.github.com/rdicosmo/kwin-focus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdicosmo%2Fkwin-focus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35020873,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-01T02:00:05.325Z","response_time":130,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["activities","kde","kwin","plasma","wayland","window-management","x11"],"created_at":"2026-07-01T20:04:30.154Z","updated_at":"2026-07-01T20:04:30.715Z","avatar_url":"https://github.com/rdicosmo.png","language":"QML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kwin-focus\n\nList and focus application windows on **KDE Plasma 6** (X11 *and* Wayland),\nfully **Activities-aware**. A replacement for `wmctrl` / `xdotool` workflows,\nwhich are broken on Plasma 6 (no Wayland support, no Activities).\n\nTwo front-ends share one idea — *talk to KWin, enumerate every window across all\nvirtual desktops and Activities, and focus the one you want*:\n\n| | |\n|---|---|\n| **`cli/kwin-focus`** | a self-contained bash tool: list (`-l`), JSON (`-j`), pattern-focus (`-p RE`, ideal for global keybindings), and an interactive picker (fzf or a numbered menu). |\n| **`applet/`** (\"Window Filter\") | a Plasma 6 panel/dock applet: a search box over a live window list, **fully keyboard-driven** (the search field always keeps focus — type to filter, arrow to move the highlight, never lose your place). Filter by title / application / **Activity name**; **per-row actions** (close, minimise/maximise, keep-above, full-screen, move to desktop/activity) via right-click or the **Menu** key; focus a window with Enter (KWin switches desktop **and** Activity for free). Toggle the sort order (Most-recently-used by default / Alphabetical / By-activity), **pin** the list open to keep navigating, and show each window's Activity. Assign a **global shortcut** to summon it on whatever Activity you're on (see below). Press **F1** for the in-app keyboard cheat-sheet. |\n\n### Applet keyboard map\n\nThe search field owns every key (single-focus, KRunner/rofi style), so type-to-filter\nnever breaks:\n\n| Key | Action |\n|---|---|\n| `↑` / `↓` | Move the highlight |\n| `Home` / `End` | First / last window |\n| `PgUp` / `PgDn` | Move by a page |\n| `Enter` | Focus the highlighted window (closes unless pinned) |\n| `Esc` | Clear the filter, then (if empty) dismiss back to where you were |\n| `Menu` / `Shift+F10` | Open the per-row action menu |\n| `Ctrl+W` / `Del`¹ | Close the highlighted window (list stays open to keep triaging) |\n| `Ctrl+M` / `Ctrl+Shift+M` | Minimise / maximise the highlighted window |\n| `Ctrl+S` / `Ctrl+Shift+S` | Cycle the sort order forward / backward |\n| `Ctrl+P` | Toggle pin |\n| `F1` | Toggle the keyboard cheat-sheet |\n\n¹ `Del` closes the window only when the filter is empty; while typing it edits text.\n\n### Global shortcut\n\nThe applet ships with **no default global shortcut** — it won't claim a key behind\nyour back. To summon the list from anywhere, assign one yourself: right-click the\nwidget → **Configure Window Filter…** → **Keyboard Shortcut**, or via *System\nSettings → Keyboard → Shortcuts*. **`Meta+Shift+W`** is a good pick — `Meta`\ncombos never clash with application shortcuts, and it avoids KWin's own `Meta+W`\n(Overview). Plasma remembers it across sessions.\n\n## How it works (the interesting part)\n\nKWin exposes **no** direct \"list windows\" D-Bus method, and the two front-ends\nsolve the data problem very differently:\n\n- **The CLI** is *outside* Plasma, so it injects a JavaScript snippet via\n  `org.kde.KWin /Scripting loadScript`, and reads the script's `print()` output\n  back from the **systemd user journal** (`journalctl --user`, where it lands as\n  `kwin_x11[…]: js: …`). A common dead end is filtering with\n  `journalctl --user -u plasma-kwin_x11.service` — kwin is *not* a user systemd\n  unit, so that matches nothing; drop the `-u` filter. Focusing sets\n  `workspace.activeWindow` (write-deferred — don't read it back in the same\n  tick) after `raiseWindow()`, switches the virtual desktop, and switches the\n  Activity via `org.kde.ActivityManager … SetCurrentActivity`.\n- **The applet** runs *inside* plasmashell, so it needs none of that: it uses\n  `TaskManager.TasksModel` directly and `requestActivate()`, which switches\n  desktop **and** Activity for free.\n\n## Install\n\n```sh\nmake install          # links ~/bin/kwin-focus onto PATH + installs the applet\nmake dev              # run the applet standalone (plasmawindowed) to try it\nmake upgrade          # redeploy the applet after edits\nmake uninstall        # remove both\n```\n\nThen add the applet to a panel/dock: right-click the panel → **Add Widgets…** →\nsearch **\"Window Filter\"**.\n\n## Requirements\n\n- **CLI:** `qdbus6` (or `qdbus`), `journalctl`, `awk`, `sed`. Optional: `fzf`.\n- **Applet:** KDE Plasma 6 (`kpackagetool6` to install). Uses the stock\n  `org.kde.taskmanager` and `org.kde.kitemmodels` QML modules.\n\n## Layout\n\n```\ncli/kwin-focus                          the command-line tool\napplet/metadata.json                    Plasma applet manifest (id: org.dicosmo.windowfilter)\napplet/contents/ui/main.qml             root: models, dispatcher, keyboard, menu host\napplet/contents/ui/WindowDelegate.qml   one row of the list\napplet/contents/ui/WindowContextMenu.qml the per-row action menu\napplet/contents/ui/code/actions.js      the window-action catalog\n```\n\nSee [CHANGELOG.md](CHANGELOG.md) for release notes.\n\n## License\n\nMIT. See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frdicosmo%2Fkwin-focus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frdicosmo%2Fkwin-focus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frdicosmo%2Fkwin-focus/lists"}