{"id":21279037,"url":"https://github.com/lostatc/swtchr","last_synced_at":"2025-07-11T08:33:29.781Z","repository":{"id":227741595,"uuid":"766488269","full_name":"lostatc/swtchr","owner":"lostatc","description":"A pretty Gnome-style window switcher for the Sway window manager","archived":false,"fork":false,"pushed_at":"2024-03-25T09:44:37.000Z","size":279,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-25T12:21:47.604Z","etag":null,"topics":["sway","swaywm","wayland"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lostatc.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}},"created_at":"2024-03-03T12:09:18.000Z","updated_at":"2024-04-04T10:58:43.000Z","dependencies_parsed_at":"2024-03-25T10:58:28.547Z","dependency_job_id":null,"html_url":"https://github.com/lostatc/swtchr","commit_stats":null,"previous_names":["lostatc/swtchr"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostatc%2Fswtchr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostatc%2Fswtchr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostatc%2Fswtchr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostatc%2Fswtchr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lostatc","download_url":"https://codeload.github.com/lostatc/swtchr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225708400,"owners_count":17511660,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["sway","swaywm","wayland"],"created_at":"2024-11-21T10:18:24.425Z","updated_at":"2024-11-21T10:18:25.117Z","avatar_url":"https://github.com/lostatc.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"[![Tests Workflow Status (main)](https://img.shields.io/github/actions/workflow/status/lostatc/swtchr/test.yaml?branch=main\u0026label=Tests\u0026style=for-the-badge\u0026logo=github)](https://github.com/lostatc/swtchr/actions/workflows/test.yaml)\n\n# swtchr\n\n![A screenshot of the swtchr window switcher over a Sway desktop](./etc/screenshot.png)\n\nA pretty Gnome-style window switcher for the [Sway](https://swaywm.org/) window\nmanager.\n\nOut of the box, you can use `\u003cSuper\u003eTab` and `\u003cSuper\u003e\u003cShift\u003eTab` to page\nforward and backward through a list of windows ordered from most to least\nrecently accessed.\n\n## Installing\n\nYou can find prebuilt binaries on the [releases\npage](https://github.com/lostatc/swtchr/releases), or you can build from\nsource.\n\nTo build from source, you'll need to install these system dependencies:\n\n- [libgtk-4-dev](https://gtk-rs.org/gtk4-rs/stable/latest/book/installation_linux.html)\n- [gtk4-layer-shell](https://github.com/wmww/gtk4-layer-shell?tab=readme-ov-file#distro-packages)\n\nThen [install Rust](https://www.rust-lang.org/tools/install) and run this\ncommand (you do not need to clone the repo):\n\n```\ncargo install swtchr\n```\n\nThis will install the `swtchr` and `swtchrd` binaries to `~/.cargo/bin/`.\n\n## Getting started\n\nTo get started, drop these commands into your Sway config, which is usually\nlocated at `~/.config/sway/config`. Substitute whatever path you installed the\n`swtchr` and `swtchrd` binaries to.\n\n```\n# Start the swtchr daemon.\nexec_always ~/.cargo/bin/swtchrd\n\n# Set up keybinds to open the window switcher.\nbindsym $mod+Tab mode swtchr; exec ~/.cargo/bin/swtchr\nbindsym $mod+Shift+Tab mode swtchr; exec ~/.cargo/bin/swtchr\n\n# This is important! More information below.\nmode swtchr bindsym Backspace mode default\n```\n\nSee [Configuring swtchr](#configuring-swtchr) to customize the behavior and\nkeybindings.\n\nSee [Styling swtchr](#styling-swtchr) to to customize the appearance.\n\nSee [Sway keybinds](#sway-keybinds) to understand what's going on with the\n`mode swtchr` part.\n\nSee [Using systemd](#using-systemd) to start the swtchr daemon via a systemd\nservice instead of via your Sway config.\n\nSee [Recipes](#recipes) for some examples of different ways you can configure\nswtchr.\n\n## Configuring swtchr\n\nYou can configure the behavior and keybindings for swtchr in\n`~/.config/swtchr/swtchr.toml`. An example config file with sensible defaults\nwill be generated there the first time you start the swtchr daemon.\n\nThe comments in the example config file document what each option does. You can\nfind it at [src/swtchr.toml](./src/swtchr.toml).\n\nswtchr will look for the `swtchr.toml` file in these places:\n\n1. `$XDG_CONFIG_HOME/swtchr/swtchr.toml`\n2. `~/.config/swtchr/swtchr.toml`\n\n## Styling swtchr\n\nYou can customize the styling of the window switcher using [GTK\nCSS](https://docs.gtk.org/gtk4/css-properties.html). Just drop a CSS file here:\n\n```\n~/.config/swtchr/style.css\n```\n\nYou can look at the default stylesheet [src/style.css](./src/style.css) as an\nexample.\n\nAdditionally, you can open the interactive GTK debugger to inspect objects, see\ntheir CSS classes, and apply CSS styles live:\n\n```shell\nenv GTK_DEBUG=interactive swtchrd\n```\n\nswtchr will look for the `style.css` file in these places:\n\n1. `$XDG_CONFIG_HOME/swtchr/style.css`\n2. `~/.config/swtchr/style.css`\n\n## Sway keybinds\n\nYou need to configure keybinds in your Sway config to open the window switcher.\nAll other swtchr keybinds are configured in the [swtchr config\nfile](#configuring-swtchr).\n\nLet's break down the Sway keybinds we set up in [Getting\nstarted](#getting-started):\n\n```\nbindsym $mod+Tab mode swtchr; exec ~/.cargo/bin/swtchr\nbindsym $mod+Shift+Tab mode swtchr; exec ~/.cargo/bin/swtchr\n```\n\nWe're using `\u003cSuper\u003eTab` both to open the window switcher and to cycle through\nwindows once it's open. To prevent Sway from consuming those keypresses once\nthe window switcher is open, we need to change the [Sway binding\nmode](https://i3wm.org/docs/userguide.html#binding_modes). swtchr will\nautomatically change your binding mode back to `default` when the window\nswitcher closes.\n\n```\nmod swtchr bindsym Backspace mode default\n```\n\nSway only allows you to change the binding mode if you've configured a keybind\nto escape back to the `default` mode, so you'll need this line as well. You may\nneed to use this keybind if the swtchr daemon crashes before it's able to\nswitch back to the `default` mode.\n\n## Using systemd\n\nRather than start the swtchr daemon via an `exec_always` command in your Sway\nconfig, you may want to use a systemd service instead. This enables\nrestart-on-failure behavior and makes checking the logs easier.\n\nThere is an example systemd unit file provided in\n[etc/swtchrd.service](./etc/swtchrd.service). Update the `ExecStart=` line to\nmatch the path you installed the `swtchrd` binary to, and then drop it here:\n\n```\n~/.config/systemd/user/swtchrd.service\n```\n\nFrom there, you can run this command to start the swtchr daemon and configure\nit autostart when you log into a Sway session:\n\n```shell\nsystemctl --user enable --now swtchrd.service\n```\n\nIf your distro doesn't package Sway with a `sway-session.target`, check out\n[these\ndocs](https://wiki.archlinux.org/title/Sway#Manage_Sway-specific_daemons_with_systemd)\non how to roll your own.\n\n## Recipes\n\nOut of the box, swtchr only switches focus to the selected window when you\nrelease `\u003cSuper\u003eTab` / `\u003cSuper\u003e\u003cShift\u003eTab`. You can optionally enable \"peeking\"\nto switch window focus immediately as you cycle through windows in the\nswitcher.\n\n```toml\n# swtchr.toml\n\n[keymap]\n\n#next = \"\u003cSuper\u003eTab\"\npeek_next = \"\u003cSuper\u003eTab\"\n\n#prev = \"\u003cSuper\u003e\u003cShift\u003eTab\"\npeek_prev = \"\u003cSuper\u003e\u003cShift\u003eTab\"\n```\n\nInstead of switching window focus and closing the window switcher immediately\nwhen you release `\u003cSuper\u003eTab` / `\u003cSuper\u003e\u003cShift\u003eTab`, you can configure swtchr\nwith separate keybinds to a) switch to the selected window or b) dismiss the\nwindow switcher.\n\n```toml\n# swtchr.toml\n\ndismiss_on_release = false\nselect_on_release = false\n\n[keymap]\n\ndismiss = \"Escape\"\nselect = \"Return\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flostatc%2Fswtchr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flostatc%2Fswtchr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flostatc%2Fswtchr/lists"}