#hyprland #title #window #active #eww #window-manager #monitor

app hyprland-activewindow

A multi-monitor aware Hyprland active window title outputer

1 stable release

new 1.0.2 Apr 27, 2024
1.0.1 Mar 27, 2024
1.0.0 Mar 19, 2024
0.5.0 Jan 26, 2024

#167 in Command line utilities

Download history 6/week @ 2024-02-17 14/week @ 2024-02-24 2/week @ 2024-03-02 4/week @ 2024-03-09 167/week @ 2024-03-16 152/week @ 2024-03-23 62/week @ 2024-03-30 13/week @ 2024-04-06

235 downloads per month

MIT and GPL-3.0-or-later

12KB
147 lines

hyprland-activewindow

A multi-monitor aware Hyprland active window title outputer. Follows the specified monitor and outputs the current active window title. Designed to be used with Eww, but may function with other bars.

Installation Instructions

Dependencies

Hyprland

Arch Linux

Arch users can install from AUR using your favourite package manager.

  pikaur -S hyprland-activewindow

NixOS

NixOS users can use the unstable channel to try or install the package.

nix-shell -p hyprland-activewindow

Crates.io

It can be installed directly from crates.io with cargo.

  cargo install hyprland-activewindow

Building from source

git clone https://github.com/FieldofClay/hyprland-activewindow.git
cd hyprland-activewindow
cargo build --release

Usage

Basic Mode

Pass the name of the monitor to follow as the only argument. It will then follow that monitor and output the active window title to stdout.

./hyprland-activewindow eDP-1

You can get the names of your monitors by running:

hyprctl monitors -j

It can be used as a title widget in Eww with config similar to below.

(deflisten window0 "hyprland-activewindow eDP-1")
(defwidget title0 []
    (label :text "${window0}"))

(deflisten window1 "hyprland-activewindow DP-1")
(defwidget title1 []
    (label :text "${window1}"))

(defwidget bar0 []
  (box
    (window0)
  )
)

(defwidget bar1 []
  (box
    (window1)
  )
)

Advanced Mode

Pass the wildcard "_" as the only argument and it will follow all monitors and output active window title information in json to stdout.

./hyprland-activewindow _

The output will be a json array of each monitors name and the active window's title & initial title.

[{"initial_title":"Alacritty","name":"eDP-1","title":"~/hyprland-activewindow"},{"initial_title":"VSCodium","name":"DP-1","title":"main.rs - hyprland-activewindow (Workspace) - VSCodium"}]

This allows simplified Eww config similar to this:

(deflisten windows "hyprland-activewindow _")

(defwidget window [monitor]
  (box
    (label :text "${windows['${monitor}'].title}")
  )
)

(defwidget bar0 []
  (box
    (window :monitor 0)
  )
)

(defwidget bar1 []
  (box
    (window :monitor 1)
  )
)

Dependencies

~8–16MB
~197K SLoC