i3-workspace-names-daemon
This script dynamically updates sway workspace names based on the names of the windows therein.
It also allows users to define an icon to show for a named window from the Font Awesome icon list.
A rewrite of https://github.com/cboddy/i3-workspace-names-daemon built with sway in mind, although it should still work with i3.
Examples
The workspace names in your bar of choice will look something like this:
Install
PIP
Install the package from pypi with pip.
sudo pip3 install sway-dynamic-names
NB. if you don't have sudo privileges instead do
pip3 install --user sway-dynamic-names
Arch
Install the package using an aur helper like yay:
yay -S sway-dynamic-names-git
Font
Install the Font Awesome font via your favourite package manager. This is necessary if you want to show an icon instead of a window's name in the i3 status bar.
Debian/Ubuntu et al.
sudo apt install fonts-font-awesome
Arch
yay -S ttf-font-awesome
NB: if the glyphs are not rendering make sure the font is installed.
Sway/i3 config
Add the following line to your ~/.config/sway/config.
exec_always --no-startup-id exec sway-dynamic-names
If you use the $mod+1 etc. shortcuts to switch workspaces then update the following so that the switch to workspace and move focussed window to workspace shortcuts still work.
from
bindsym $mod+1 workspace 1
bindsym $mod+Shift+1 move container to workspace 1
# etc
to
bindsym $mod+1 workspace number 1
bindsym $mod+Shift+1 move container to workspace number 1
# etc
Configuration
Configuration is done in ~/.config/sway/sdn-config.yaml. The default is:
clients:
google-chrome-beta: chrome
jetbrains-pycharm: terminal
firefox: firefox
x-terminal-emulator: terminal
thunderbird: envelope
jetbrains-idea-ce: edit
nautilus: folder-open
clementine: music
vlc: play
signal: comment
deliminator: |
default_icon: dot-circle
clients
A mapping of client_identifier -> name. The daemon will try and match the client_identifier against:
name, window_title, window_instance, and window_class, as provided by sway, in that order. client_identifier
can also be a regular expression.
If name matches the name of a font-awesome icon, the icon will be used. Otherwise, any unicode symbol or plain text
can be used.
deliminator
The symbol used to separate the names within a workspace
default_icon
The icon to show if no windows in the workspace match the clients listed in the config
Picking icons
The easiest way to pick an icon is to search for one in the gallery. NB: the "pro" icons are not available in the debian/arch package.
Metadata
Release files for sway-dynamic-names 1.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sway-dynamic-names-1.2.1.tar.gz | 19.5 kB | Without provenance | Details for sway-dynamic-names-1.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sway_dynamic_names-1.2.1-py3-none-any.whl | Python 3 | none | any | Details for sway_dynamic_names-1.2.1-py3-none-any.whl |
Total release size: 39.0 kB
Release files / sway-dynamic-names-1.2.1.tar.gz
| Download URL | sway-dynamic-names-1.2.1.tar.gz |
|---|---|
| Size | 19.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cc89652963ed1b9a2b1cb0e70de39d01ec1b4ef4cd673a2c032374abc840d308
|
|
BLAKE2b-256 checksum How to use checksums |
abd033070fe258fc3461ffacbd4fd4d2e021938db193f96b4e0ab8d5cbfefbb5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|
Release files / sway_dynamic_names-1.2.1-py3-none-any.whl
| Download URL | sway_dynamic_names-1.2.1-py3-none-any.whl |
|---|---|
| Size | 19.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c6501f4b52f707c23293ace3913bead4d8413d06536a43e233752b77240647ae
|
|
BLAKE2b-256 checksum How to use checksums |
cbc9b33f1f81cc662215de007ac80e870a6708b06bd7946f81f363499ff5e648
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|
Security for sway-dynamic-names 1.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.