Updated: 2024-03-05 Tue 01:44

Configuring I3 With Polybar For Named Workspace

Configuring i3wm1 with polybar2 for named workspace

Naming workspaces in i3wm helps when you have too many open applications everywhere. Polybar, which is one of the popular status bars for i3wm, does not display the name of the workspace by default.

The goal is to configure polybar to properly display names of workspaces which are defined in i3 configuration files.

Environment:

Polybar 3.4.3 i3 4.18.1

i3 userguide3 says that workspaces can be named by having following configuration. Configuration file for i3 is generally located at ~/.config/i3/config

bindsym $mod+1 workspace 1: name_of_workspace_1
bindsym $mod+2 workspace 2: name_of_workspace_2

However, doing so will not be reflected to polybar by default. To view workspace name in the bar, further configuration of polybar module for i3 is required, which can be found at ~/.config/polybar/modules.ini.

[module/i3]
label-focused = %index% %

Basically, the %name% placeholder which is mapped to the workspace name should be added to label-* variable which only has %index% fixing our problem.

These workspaces can be further organized using assignments4 to force certain applications to be opened in specific workspace.

Footnotes:

~
Generated by Emacs 29.1 (Org mode 9.6.6)