Skip to main content

Dynamically update the name of each Sway WM workspace using font-awesome icons

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sway-dynamic-names-1.2.1.tar.gz (19.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sway_dynamic_names-1.2.1-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file sway-dynamic-names-1.2.1.tar.gz.

File metadata

  • Download URL: sway-dynamic-names-1.2.1.tar.gz
  • Upload date:
  • Size: 19.5 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for sway-dynamic-names-1.2.1.tar.gz
Algorithm Hash digest
SHA256 cc89652963ed1b9a2b1cb0e70de39d01ec1b4ef4cd673a2c032374abc840d308
MD5 8100b7842832c61dc434524a15dbfad4
BLAKE2b-256 abd033070fe258fc3461ffacbd4fd4d2e021938db193f96b4e0ab8d5cbfefbb5

See more details on using hashes here.

File details

Details for the file sway_dynamic_names-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: sway_dynamic_names-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 19.5 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for sway_dynamic_names-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c6501f4b52f707c23293ace3913bead4d8413d06536a43e233752b77240647ae
MD5 d3cae4ce649f262e896b2260cdd8ad19
BLAKE2b-256 cbc9b33f1f81cc662215de007ac80e870a6708b06bd7946f81f363499ff5e648

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page