{"id":13503027,"url":"https://github.com/roosta/i3wsr","last_synced_at":"2025-04-08T02:36:28.820Z","repository":{"id":27654428,"uuid":"111213442","full_name":"roosta/i3wsr","owner":"roosta","description":"A dynamic workspace renamer for i3 and Sway that updates names to reflect their active applications.","archived":false,"fork":false,"pushed_at":"2025-01-31T13:21:53.000Z","size":871,"stargazers_count":184,"open_issues_count":2,"forks_count":13,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-01T01:36:46.552Z","etag":null,"topics":["customization","i3","i3-config","i3-wm","i3wm","linux","sway","sway-config","wayland","window-manager","workspaces"],"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/roosta.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2017-11-18T14:48:41.000Z","updated_at":"2025-03-19T15:49:04.000Z","dependencies_parsed_at":"2022-08-07T13:00:49.797Z","dependency_job_id":"2bb021ee-0f6a-4cd2-9690-0d5b8513cfab","html_url":"https://github.com/roosta/i3wsr","commit_stats":{"total_commits":229,"total_committers":8,"mean_commits":28.625,"dds":0.09606986899563319,"last_synced_commit":"f78810047c5edb53032974297700116de7150b25"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roosta%2Fi3wsr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roosta%2Fi3wsr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roosta%2Fi3wsr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roosta%2Fi3wsr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roosta","download_url":"https://codeload.github.com/roosta/i3wsr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247765462,"owners_count":20992314,"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":["customization","i3","i3-config","i3-wm","i3wm","linux","sway","sway-config","wayland","window-manager","workspaces"],"created_at":"2024-07-31T22:02:34.015Z","updated_at":"2025-04-08T02:36:28.571Z","avatar_url":"https://github.com/roosta.png","language":"Rust","funding_links":[],"categories":["Rust","linux"],"sub_categories":[],"readme":"i3wsr - i3 workspace renamer\n======\n\n[![Test Status](https://github.com/roosta/i3wsr/actions/workflows/test.yaml/badge.svg?branch=main)](https://github.com/roosta/i3wsr/actions)\n[![Crates.io](https://img.shields.io/crates/v/i3wsr)](https://crates.io/crates/i3wsr)\n\nA dynamic workspace renamer for i3 and Sway that updates names to reflect their\nactive applications.\n\n`i3wsr` can be configured through command-line flags or a `TOML` config file,\noffering extensive customization of workspace names, icons, aliases, and\ndisplay options.\n\n## Preview\n\n![preview](https://raw.githubusercontent.com/roosta/i3wsr/main/assets/preview.gif)\n\n## Rebrand and Wayland support\n\nNow that `i3wsr` works with [Sway](https://swaywm.org/) as well as\n[I3](https://i3wm.org/), the name is a bit misleading, and could do with a\nchange. Shame to lose the metrics, but it might help further discovery now that\nit supports multiple display servers.\n\nI've not thought of anything yet, but will advertise it here in the README\nbefore publishing anything under a new name.\n\nDevelopment forward will focus on Sway, but backward compatibility with I3 will\nbe maintained.\n\n## Requirements\n\ni3wsr requires [i3](https://i3wm.org/) or [sway](https://swaywm.org/), and\n[numbered\nworkspaces](https://i3wm.org/docs/userguide.html#_changing_named_workspaces_moving_to_workspaces),\nsee [Configuration](#configuration)\n\n## Installation\n\n[Rust](https://www.rust-lang.org/en-US/), and [Cargo](http://doc.crates.io/) is\nrequired, and `i3wsr` can be installed using cargo like so:\n\n```sh\ncargo install i3wsr\n```\n\nOr alternatively, you can build a release binary,\n\n```sh\ncargo build --release\n```\n\nThen place the built binary, located at `target/release/i3wsr`, somewhere on your `$path`.\n\n### Arch linux\n\nIf you're running Arch you can install either [stable](https://aur.archlinux.org/packages/i3wsr/), or [latest](https://aur.archlinux.org/packages/i3wsr-git/) from AUR thanks to reddit user [u/OniTux](https://www.reddit.com/user/OniTux).\n\n## Usage\n\nJust launch the program and it'll listen for events if you are running I3 or\nSway. Another option is to put something like this in your i3 or Sway config:\n\n```\n# i3\nexec_always --no-startup-id i3wsr\n\n# Sway\nexec_always i3wsr\n```\n\n\u003e `exec_always` ensures a new instance of `i3wsr` is started when config is reloaded or wm/compositor is restarted.\n\n## Configuration\n\nThis program depends on numbered workspaces, since we're constantly changing the\nworkspace name. So your I3 or Sway configuration need to reflect this:\n\n```\nbindsym $mod+1 workspace number 1\nassign [class=\"(?i)firefox\"] number 1\n```\n\n### Keeping part of the workspace name\n\nIf you're like me and don't necessarily bind your workspaces to only numbers,\nor you want to keep a part of the name constant you can do like this:\n\n```\nset $myws \"1:[Q]\" # my sticky part\nbindsym $mod+q workspace number $myws\nassign [class=\"(?i)firefox\"] number $myws\n```\n\nThis way the workspace would look something like this when it gets changed:\n\n```\n1:[Q] Emacs|Firefox\n```\nYou can take this a bit further by using a bar that trims the workspace number and be left with only\n```\n[Q] Emacs|Firefox\n```\n\n## Configuration / options\n\nConfiguration for i3wsr can be done using cmd flags, or a config file. A config\nfile allows for more nuanced settings, and is required to configure icons and\naliases. By default i3wsr looks for the config file at\n`$XDG_HOME/.config/i3wsr/config.toml` or `$XDG_CONFIG_HOME/i3wsr/config.toml`.\nTo specify another path, pass it to the `--config` option on invocation:\n```bash\ni3wsr --config ~/my_config.toml\n```\nExample config can be found in\n[assets/example\\_config.toml](https://github.com/roosta/i3wsr/blob/main/assets/example_config.toml).\n\n\n### Aliases\n\n\nSometimes a class, instance or name can be overly verbose, use aliases that\nmatch to window properties to create simpler names instead of showing the full\nproperty\n\n\n```toml\n# For Sway\n[aliases.app_id]\n\n# for i3\n[aliases.class]\n\n# Exact match\n\"^Google-chrome-unstable$\" = \"Chrome-dev\"\n\n# Substring match\nfirefox = \"Firefox\"\n\n# Escape if you want to match literal periods\n\"Org\\\\.gnome\\\\.Nautilus\" = \"Nautilus\"\n```\nAlias keys uses regex for matching, so it's possible to get creative:\n\n```toml\n# This will match gimp regardless of version number reported in class\n\"Gimp-\\\\d\\\\.\\\\d\\\\d\" = \"Gimp\"\n```\n\nRemember to quote anything but `[a-zA-Z]`, and to escape your slashes. Due to\nrust string escapes if you want a literal backslash use two slashes `\\\\d`.\n\n### Aliases based on property\n\ni3wsr supports 4 window properties currently:\n\n```toml\n[aliases.name]     # 1 i3 / wayland / sway\n[aliases.instance] # 2 i3 / xwayland\n[aliases.class]    # 3 i3 / xwayland\n[aliases.app_id]   # 3 wayland / sway only\n```\nThese are checked in descending order, so if i3wsr finds a name alias, it'll\nuse that and if not, then check instance, then finally use class\n\n#### Class\n\n\u003e Only for Xwayland / i3\n\nThis is the default for `i3`, and the most succinct.\n\n#### App id\n\n\u003e Only for Wayland / Sway\n\nThis is the default for wayland apps, and the most and works largely like class.\n\n#### Instance\n\n\u003e Only for Xwayland / i3\n\nUse `instance` instead of `class` when assigning workspace names,\ninstance is usually more specific. i3wsr will try to get the instance but if it\nisn't defined will fall back to class.\n\nA use case for this option could be launching `chromium\n--app=\"https://web.whatsapp.com\"`, and then assign a different icon to whatsapp\nin your config file, while chrome retains its own alias:\n```toml\n\n[icons]\n\"WhatsApp\" = \"🗩\"\n\n[aliases.class]\nGoogle-chrome = \"Chrome\"\n\n[aliases.instance]\n\"web\\\\.whatsapp\\\\.com\" = \"Whatsapp\"\n```\n\n#### Name\n\n\u003e Sway and i3\n\nUses `name` instead of `instance` and `class|app_id`, this option is very\nverbose and relies on regex matching of aliases to be of any use.\n\nA use-case is running some terminal application, and as default i3wsr will only\ndisplay class regardless of whats running in the terminal.\n\nSo you could do something like this:\n\n```toml\n[aliases.name]\n\".*mutt$\" = \"Mutt\"\n```\n\n### Display property\n\nWhich property to display if no aliases is found:\n\n```toml\n[general]\ndisplay_property = \"instance\"\n```\n\nPossible options are `class`, `app_id`, `instance`, and `name`, and will default\nto `class` or `app_id` depending on display server if not present.\n\nYou can alternatively supply cmd argument:\n```sh\ni3wsr --display-property name\n```\n### Icons\n\nYou can config icons for your WM property, these are defined in your config file.\n\n```toml\n[icons]\nFirefox = \"🌍\"\n\n# Use quote when matching anything other than [a-zA-Z]\n\"Org.gnome.Nautilus\" = \"📘\"\n```\ni3wsr tries to match an icon with an alias first, if none are found it then\nchecks your `display_property`, and tries to match an icon with a non aliased\n`display_property`, lastly it will try to match on class.\n\n```toml\n[aliases.class]\n\"Gimp-\\\\d\\\\.\\\\d\\\\d\" = \"Gimp\"\n\n[icons]\nGimp = \"📄\"\n```\n\nA font that provides icons is of course recommended, like\n[font-awesome](https://fontawesome.com/). Make sure your bar has that font\nconfigured.\n\n### Separator\n\nNormally i3wsr uses the pipe character `|` between class names in a workspace,\nbut a custom separator can be configured in the config file:\n```toml\n[general]\nseparator = \"  \"\n```\n\n### Default icon\nTo use a default icon when no other is defined use:\n```toml\n[general]\ndefault_icon = \"💀\"\n```\n### Empty label\n\nSet a label for empty workspaces.\n\n```toml\n[general]\nempty_label = \"🌕\"\n```\n### No icon names\nTo display names only if icon is not available, you can use the\n`--no-icon-names` flag, or enable it in your config file like so:\n```toml\n[options]\nno_icon_names = true\n```\n### No names\nIf you don't want i3wsr to display names at all, you can use the\n`--no-names` flag, or enable it in your config file like so:\n```toml\n[options]\nno_names = true\n```\n\n### Remove duplicates\nIf you want duplicates removed from workspaces use either the flag\n`--remove-duplicates`, or configure it in the `options` section of the config\nfile:\n```toml\n[options]\nremove_duplicates = true\n```\n\n### Split at character\n\nBy default i3wsr will keep everything until the first `space` character is found,\nthen replace the remainder with titles.\n\nIf you want to define a different character that is used to split the\nnumbered/constant part of the workspace and the dynamic content, you can use\nthe option `--split-at [CHAR]`\n\n```toml\n[general]\nsplit_at = \":\"\n```\n\nHere we define colon as the split character, which results in i3wsr only\nkeeping the numbered part of a workspace name when renaming.\n\nThis can give a cleaner config, but I've kept the old behavior as default.\n\n## Testing\n\nTo run tests locally [Vagrant](https://www.vagrantup.com/) is required. Run\n`script/run_tests.sh` to run tests on ubuntu xenial.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froosta%2Fi3wsr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froosta%2Fi3wsr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froosta%2Fi3wsr/lists"}