Skip to content
Anthony Ruhier edited this page Sep 12, 2023 · 57 revisions

Workspaces

The workspaces module displays the currently used workspaces in hyprland compositor.

Configuration

Addressed by hyprland/workspaces

option typeof default description
active-only bool false If set to true only active workspace will be shown on bar. Unless a workspace is persistent, visible, or special. Otherwise all workspace groups are shown.
all-outputs bool false If set to false workspaces group will be shown only in assigned output. Otherwise all workspace groups are shown.
format string {id} The format, how information should be displayed.
format-icons array Based on the workspace name and state, the corresponding icon gets selected.
See Icons
persistent-workspaces json (see below) empty Lists workspaces that should always be shown, even when non existant.
show-special bool false If set to true, will display special workspaces alongside regular workspaces
sort-by string DEFAULT How to sort workspaces

Format replacements:

string replacement
{icon} Icon, as defined in format-icons.
{name} Name of workspace assigned by compositor.

Icons:

Additional to workspace name matching, the following format-icons can be set.

port name note
active Will be shown when workspace is active
default Will be shown when no string matches is found.
empty Will be shown on active empty workspaces
persistent Will be shown on non-active persistent workspaces
special Will be shown on non-active special workspaces
urgent Will be shown on non-active urgent workspaces

Sort:

How to sort workspaces.

name note
default Default hyprland/workspaces sorting algorithm with custom prioritization
id Sort workspaces by id
name Sort workspaces by name
number Sort workspaces by number

Persistent workspaces:

Each entry of persistent_workspace names a workspace that should always be shown. Associated with that value is a list of outputs indicating where the workspace should be shown, an empty list denoting all outputs

"hyprland/workspaces": {
    "persistent-workspaces": {
             "*": 5, // 5 workspaces by default on every monitor
             "HDMI-A-1": 3 // but only three on HDMI-A-1
       }
}
"hyprland/workspaces": {
    "persistent-workspaces": {
      "1": [
        "DP-3" // workspace 1 shown on DP-3
      ],
      "2": [
        "DP-1" // workspace 2 shown on DP-1
      ],
      "3": [
        "DP-1" // workspace 3 shown on DP-1
      ],
    }
}
"hyprland/workspaces": {
   "persistent-workspaces": {
      "DP-3": [ 1 ], // workspace 1 shown on DP-3
      "DP-1": [ 2, 3 ], // workspaces 2 and 3 shown on DP-1
    }
}

Example:

"hyprland/workspaces": {
	"format": "{name}: {icon}",
	"format-icons": {
		"1": "",
		"2": "",
		"3": "",
		"4": "",
		"5": "",
		"active": "",
		"default": ""
	},
       "persistent-workspaces": {
             "*": 5, // 5 workspaces by default on every monitor
             "HDMI-A-1": 3 // but only three on HDMI-A-1
       }
}

Style

  • #workspaces
  • #workspaces button
  • #workspaces button.active
  • #workspaces button.empty
  • #workspaces button.persistent
  • #workspaces button.special
  • #workspaces button.visible

The way the CSS is evaluated you need to order it in order of importance with last taking precedent.

Example:

This order makes it so that my priority of styling is special cases override the norm. If you wanted to include persistent in here, I'd throw it in before empty, personally.

image

image


Window

The window module displays the title of the currently focused window of Hyprland, the Wayland compositor.

Configuration

Addressed by hyprland/window

option typeof default description
format string {title} The format, how information should be displayed. On {} the current window title is displayed.
rewrite object {} Rules to rewrite the module format output. The rules are identical to those for sway/window.
separate-outputs bool false Show the active window of the monitor the bar belongs to, instead of the focused window.

Format Replacements:

See the output of "hyprctl clients" for examples

string replacement
{class} The current class of the focused window.
{initialClass} The initial class of the focused window.
{initialTitle} The initial title of the focused window.
{title} The current title of the focused window.

Example:

"hyprland/window": {
    "format": "👉 {}",
    "rewrite": {
        "(.*) — Mozilla Firefox": "🌎 $1",
        "(.*) - fish": "> [$1]"
    },
    "separate-outputs": true
}

Style

  • #window
  • #window.empty When no windows are in the workspace

The following classes can apply styles to the entire Waybar (see the Sway module's page for more info):

  • window#waybar.empty When no windows are in the workspace
  • window#waybar.solo When one tiled window is visible in the workspace (floating windows may be present)
  • window#waybar.<app_id> Where <app_id> is the class (e.g. chromium) of the solo tiled window in the workspace (use hyprctl clients to see classes)
  • window#waybar.floating When there are only floating windows visible in the workspace
  • window#waybar.fullscreen When there is a fullscreen window in the workspace; useful with Hyprland's fullscreen, 1 mode
  • window#waybar.hidden When there are hidden windows in the workspace; usually occurs due to window swallowing

Example:

This will change the color of the entire bar when either Chromium or kitty occupy the screen.

#window {
    border-radius: 20px;
    padding-left: 10px;
    padding-right: 10px;
}

window#waybar.kitty {
    background-color: #111111;
    color: #ffffff;
}

window#waybar.chromium {
    background-color: #eeeeee;
    color: #000000;
}

Language

The language module displays the currently selected keyboard language (layout) for Hyprland, the Wayland compositor.

Configuration

Addressed by hyprland/language

option typeof default description
format string {} The format, how information should be displayed. On {} the current layout's full name is displayed.
format-<lang> string Provide an alternative name to display per language where is the language of your choosing. Can be passed multiple times with multiple languages as shown by the example below.
keyboard-name string Which keyboard to use, from the output of hyprctl devices. You should use the option that begins with "at-translated-set..."

Example:

"hyprland/language": {
    "format": "Lang: {}",
    "format-en": "AMERICA, HELL YEAH!",
    "format-tr": "As bayrakları",
    "keyboard-name": "at-translated-set-2-keyboard"
}

Style

  • #language

Example:

#language {
    border-radius: 20px;
    padding-left: 10px;
    padding-right: 10px;
}

Submap

The submap module displays the currently active submap similar to sway/mode for Hyprland, the Wayland compositor.

Configuration

Addressed by hyprland/submap

option typeof default description
format string {} The format, how information should be displayed. On {} the currently active submap is displayed.
max-length integer The maximum length in character the module should display.
on-click string Command to execute when clicked on the module.
on-click-middle string Command to execute when you middle clicked on the module using mousewheel.
on-click-right string Command to execute when you right clicked on the module.
on-scroll-up string Command to execute when scrolling up on the module.
on-scroll-down string Command to execute when scrolling down on the module.
rotate integer Positive value to rotate the text label.
smooth-scrolling-threshold double Threshold to be used when scrolling.
tooltip bool true Option to enable tooltip on hover.

Example:

"hyprland/submap": {
    "format": "✌️ {}",
    "max-length": 8,
    "tooltip": false
}

Style

  • #submap
Clone this wiki locally