waybar-sway-language(5) File Formats Manual waybar-sway-language(5)

waybar - sway language module

The language module displays the current keyboard layout in Sway

Addressed by sway/language

format:
typeof: string
default: {}
The format, how layout should be displayed.

hide-single-layout:
typeof: bool
default: false
Defines visibility of the module if a single layout is configured

tooltip-format:
typeof: string
default: {}
The format, how layout should be displayed in tooltip.

tooltip:
typeof: bool
default: true
Option to disable tooltip on hover.

on-click:
typeof: string
Command to execute when clicked on the module.

on-click-middle:
typeof: string
Command to execute when you middle clicked on the module using mousewheel.

on-click-right:
typeof: string
Command to execute when you right clicked on the module.

menu:
typeof: string
Action that popups the menu.

menu-file:
typeof: string
Location of the menu descriptor file. There need to be an element of type

GtkMenu with id menu

menu-actions:
typeof: array
The actions corresponding to the buttons of the menu.

expand:
typeof: bool
default: false
Enables this module to consume all left over space dynamically.

{short}: Short name of layout (e.g. "us"). Equals to {}.

{shortDescription}: Short description of layout (e.g. "en").

{long}: Long name of layout (e.g. "English (Dvorak)").

{variant}: Variant of layout (e.g. "dvorak").

{flag}: Country flag of layout.

"sway/language": {
	"format": "{}",
	"on-click": "swaymsg input type:keyboard xkb_switch_layout next",
},
"sway/language": {
	"format": "{short} {variant}",
}

  • #language
  • #language.<layout-short-name> Where layout-short-name is the short name of the active layout (e.g. #language.us or #language.de).
2026-11-05