Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Hyprland/windowcount module #3544

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

nktnet1
Copy link

@nktnet1 nktnet1 commented Aug 24, 2024

Hyprland module to display the count of windows in the current workspace. E.g. if the current workspace (in this example, workspace 2) has 4 windows/clients opened:

image

This was requested in the following Reddit post, and also issue #672 (albeit for sway).

The windowcount module supports separate-outputs (i.e. "window count per monitor"), and was written based on the existing hyprland/window module. I'm not well-versed in c++ so there may be various rooms for improvements. Wiki documentation below.


Window Count

The windowcount module displays the number of windows in the current Hyprland workspace.

Configuration

Addressed by hyprland/windowcount.

option typeof default description
format string {} The format for how information should be displayed. On {}, the current workspace window count is displayed.
format-empty string Override the format when the workspace contains no windows.
format-windowed string Override the format when the workspace contains no fullscreen windows.
format-fullscreen string Override the format when the workspace contains a fullscreen window.
separate-outputs bool true Show the active workspace window count of the monitor the bar belongs to, instead of the focused workspace.

Example:

"hyprland/windowcount": {
    "format": "[{}]",
    "format-empty": "[X]",
    "format-windowed": "[T]",
    // "format-fullscreen": "[{}]",
    "separate-outputs": true
}

Style

  • #windowcount
  • window#waybar.empty #windowcount When no windows are in the workspace
  • window#waybar.fullscreen #windowcount When there is a fullscreen window in the workspace; useful with Hyprland's fullscreen, 1 mode

Example:

/* Adding margin and padding */
#windowcount {
    margin-left: 0px;
    padding: 0px 5px;
}

/* Different background when empty */
window#waybar.empty #windowcount {
    background: darkred;
}

/* Hide the windowcount module when not in windowed mode (i.e. not fullscreen) */
window#waybar:not(.fullscreen) #windowcount {
    opacity: 0;
}

@Alexays Alexays force-pushed the master branch 2 times, most recently from d623a89 to a4d31ab Compare September 13, 2024 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant