Giter Site home page Giter Site logo

dragonnn / hyprland-autoname-workspaces Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hyprland-community/hyprland-autoname-workspaces

0.0 0.0 0.0 305 KB

Hyprland autoname workspaces πŸͺŸ [maintainers=@cyrinux,@maximbaz]

License: ISC License

Python 2.26% Rust 96.55% Makefile 1.18%

hyprland-autoname-workspaces's Introduction

πŸͺŸ hyprland-autoname-workspaces

Discord codecov

πŸ•ΉοΈThis is a toy for Hyprland.

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

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.

Fedora πŸ“¦

Package available here https://copr.fedorainfracloud.org/coprs/solopasha/hyprland/.

Nix πŸ“¦

Available in nixpkgs as hyprland-autoname-workspaces. You can add it to your systemPackages or try it without installing it with nix run.

$ nix run nixpkgs#hyprland-autoname-workspaces

Cargo πŸ“¦

$ cargo install --locked hyprland-autoname-workspaces

Usage

$ hyprland-autoname-workspaces

Configuration

First, you have to set your waybar for example, with the good module hyprland/workspaces. The module wlr/workspaces is deprecated. You have to use hyprland/workspaces module with as config "format" = "{name}".

"hyprland/workspaces": {
    "format": "{name}",
}

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}"
...
  • You can exclude applications in the [exclude] with 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)
  • You can match on title with [title_in_class.classname] and [title_in_class_active.class] with "a word in the title" = "icons".

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 = "<span color='red'>yt</span>"
google = "<span color='blue'>{icon}</span>"
...

  • You can deduplicate icons with the dedup parameter in the root section of config file.
dedup = true
dedup_inactive_fullscreen = true
...
[title."(xterm|(?i)kitty|alacritty)"]
"(?i)neomutt" = "mail"
ncdu = "file manager"
...
  • You can also redefine all the default formatter with those [format] section formatters parameters. The available list of {placeholder} is:

workspace:

  • client
  • id (or id_long)
  • name (use value from [workspaces_name] mapping)
  • delim

clients:

  • icon
  • counter_s, counter_unfocused_s, counter, counter_unfocused
  • class, iitle
  • delim
  • match1, match2, match3, matchN (for regex captures)
[format]
# max_clients = 10 (default: usize::MAX)
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

hyprland-autoname-workspaces's People

Contributors

cyrinux avatar maximbaz avatar t2hhbmek avatar donovanglover avatar kotuw avatar patrickshaw avatar sakarie9 avatar dragonnn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.