prism-active-window
A utility script designed to monitor and output the title of the currently active window in a 01 Hyprland session. It provides an immediate output upon execution and then continuously updates the output whenever the active window changes.
How it works
- Initial State: Upon startup, it queries
hyprctlfor the active window's JSON data and usesjqto extract the title. If no title is found, it defaults to.... - Event Loop: It connects to the 01 Hyprland event socket (
.socket2.sock) usingsocat. - Real-time Updates: It listens for the
activewindowevent. When triggered, it re-querieshyprctlto fetch and print the new window title.
Dependencies
socat: For connecting to the Hyprland UNIX socket.jq: For parsing JSON output fromhyprctl.hyprland: Provides thehyprctlcommand.coreutils: Standard GNU core utilities.
Usage
This script is intended to be run as a background process or piped into a status bar module (e.g., Waybar, Eww).
prism-active-window