COSMIC Chord, coschord, helps you stay focused while you switch apps
under COSMIC1.
Given an app ID, it will make sure that the app is running and has a
window selected. Once coschord is on a few keyboard shortcuts, when
your monkey brain thinks "show me web page," your fingers can make the
right thing happen instantly. No fiddling with the mouse, and no
distractions.
I set up COSMIC's custom keyboard shortcuts (cosmic-settings keyboard) like this:
| app | chord | command |
|---|---|---|
| COSMIC Files | Ctrl-Alt-Shift-F | coschord com.system76.CosmicFiles |
| COSMIC Terminal | Ctrl-Alt-Shift-T | coschord com.system76.CosmicTerm |
| GNU Emacs | Ctrl-Alt-Shift-E | coschord emacs |
| Google Chrome | Ctrl-Alt-Shift-W | coschord google-chrome |
Usage: coschord [<app_id>] [<launch_command>...]
If there are matching windows, coschord will select the first one it
finds. If one is already selected, coschord will select the next
one.
If there are no matching windows, coschord will start the app using
launch_command, e.g.:
coschord emacs /usr/local/bin/emacsIf you only supply app_id (e.g. coschord emacs), coschord will
run the launch command for app_id found in
~/.config/coschord/commands.json.
To see the app IDs of all running programs, run coschord with no
arguments.
Here's a sample commands.json configuration file:
{
"com.system76.CosmicFiles": ["cosmic-files"],
"com.system76.CosmicTerm": ["cosmic-term"],
"emacs": ["emacs"],
"google-chrome": ["google-chrome"]
}coschord is written in Rust. To build and install it:
cd coschord
cargo build --release
cargo install --path .
Footnotes
-
I switched to COSMIC after upgrading my System76 laptop to Pop!_OS 24.04 LTS. COSMIC's tiling window manager is so good that I don't need the window-manipulation parts of my Window Chord project any more.
coschordwas the only missing piece. ↩