🪟 hyprland-autoname-workspaces

Discord codecov

🕹️This is a toy for Hyprland.

This app automatically rename workspaces with icons of started applications - tested with waybar.

You have to set the config file with your prefered rules based on class and title. Regex (match and captures) are supported.

FAQ, tips and tricks ❓

https://github.com/hyprland-community/hyprland-autoname-workspaces/wiki/FAQ

Install

AUR 📦

Available as AUR package under the program name hyprland-autoname-workspaces-git. You can then use the service systemctl --user enable --now hyprland-autoname-workspaces.service.

Cargo 📦

bash $ cargo install --locked hyprland-autoname-workspaces

Usage

bash $ hyprland-autoname-workspaces

Configuration

For all parameters, check the config.toml.example in this repository.

The config file can be specified using the -c <CONFIG> option, otherwise it defaults to ~/.config/hyprland-autoname-workspaces/config.toml. If you specify a path that doesn't exist, a default configuration file will be generated.

You can use regex everywhere, and its case sensitive by default

Edit the mapping of applications with class = "icon" in the [icons] part.

In icons value, you can use the placeholders {class}, {title} and {match1}, {match2} if you use regex captures.

Example:

[class] DEFAULT = "{class}: {title}" ...

In the exclude part, the key is the window class, and the value the title. You can use "" in order to exclude window with empty title and ".*" as value to match all title of a class name.

Example:

... [exclude] "(?i)fcitx" = ".*" # will match all title for fcitx "[Ss]team" = "Friends list.*" "[Ss]team" = "^$" # will match and exclude all Steam class with empty title (some popups)

Hint: There is also title_in_initial_class, initial_title_in_class, initial_title_in_initial_class and so on.

Example:

``` ... [title."(xterm|(?i)kitty|alacritty)"] "(?i)neomutt" = "mail" ncdu = "file manager"

[title."(firefox|chrom.*)"] youtube = "yt" google = "gg"

[title_active."(firefox|chrom.*)"] youtube = "yt" google = "{icon}" ...

```

dedup = true dedup_inactive_fullscreen = true ... [title."(xterm|(?i)kitty|alacritty)"] "(?i)neomutt" = "mail" ncdu = "file manager" ...

workspace:

clients:

[format] dedup = true dedup_inactive_fullscreen = true delim = " " # NARROW NO-BREAK SPACE workspace = "<span color='red'>{id}:</span>{delim}{clients}" workspace_empty = "<span color='red'>{id}</span>" client = "{icon}{delim}" client_active = "<span color="red">{icon}</span>{delim}" client_dup = "{icon}{counter_sup}{delim}" client_dup_fullscreen = "[{icon}]{delim}{icon}{counter_unfocused_sup}" client_fullscreen = "[{icon}]{delim}" ...

See config.toml.example and the wiki for more example, feel free to share your config !

No need to restart the applications then, there is an autoreload.

Hint: You can use glyphsearch and copy the unicode icon of your font for example https://glyphsearch.com/?query=book&copy=unicode

Hint: You can find hyprland class names for currently running apps using: hyprctl clients | grep -i class, or you can also use hyprland-autoname-workspaces --verbose.

Hint: Feel free to adapt and use this script to generate your config file. This is untested for the moment.

Hint: You can bootstrap your [icons] with the contrib/generate_icons.py script.

Hint: All styling param that you can use with <span> are here: https://docs.gtk.org/Pango/pango_markup.html