A script which connects to the active Hyprland socket and saves which window is currently focused. This is a wayland version of this CLI tool.
This works much nicer than the X11 version since it no longer has to poll the active window, and recieves events over the socket whenever Hyprland broadcast any changes.
This saves when the window was initially focused, how long it was focused for, the app name and window title, as provided by Hyprland.
Usage: hyprland-active-window [OPTIONS]
Options:
-d, --datafile TEXT File to write data to [required]
-i, --ignore-regex TEXT Regex to ignore when writing to file
--help Show this message and exit.
pip install git+https://seanbreckenridge/hyprland-active-window
hyprland-active-window -d ~/Documents/focused_window.csv
Like window_watcher
, this CSV can be parsed with active_window to python, or into JSON. This is also used internally in HPI