franciscolourenco / done

A fish-shell package to automatically receive notifications when long processes finish.
MIT License
766 stars 70 forks source link

Fix Hyprland window ID detection #145

Closed postsolar closed 5 months ago

postsolar commented 5 months ago

PID reporting is not accurate, as it returns parent's PID. This would show up when running Foot terminal in server mode, where it would return the same PID (server's) for every client window. Using window address to identify the window fixes this.

franciscolourenco commented 5 months ago

@postsolar thanks for the fix. I'm curious, what is the output of hyprctl activewindow?

postsolar commented 5 months ago

@postsolar thanks for the fix. I'm curious, what is the output of hyprctl activewindow?

> hyprctl activewindow
Window 1b9e3e0 -> hyprctl activewindow ~:
    mapped: 1
    hidden: 0
    at: 440,247
    size: 720,405
    workspace: 3 (3)
    floating: 1
    monitor: 1
    class: -float -wh45 -center
    title: hyprctl activewindow ~
    initialClass: -float -wh45 -center
    initialTitle: foot
    pid: 1438
    xwayland: 0
    pinned: 0
    fullscreen: 0
    fullscreenmode: 0
    fakefullscreen: 0
    grouped: 0
    swallowing: 0
    focusHistoryID: 0

> hyprctl activewindow -j
{
    "address": "0x1b9e3e0",
    "mapped": true,
    "hidden": false,
    "at": [440, 247],
    "size": [720, 405],
    "workspace": {
        "id": 3,
        "name": "3"
    },
    "floating": true,
    "monitor": 1,
    "class": "-float -wh45 -center",
    "title": "hyprctl activewindow ~",
    "initialClass": "-float -wh45 -center",
    "initialTitle": "foot",
    "pid": 1438,
    "xwayland": false,
    "pinned": false,
    "fullscreen": false,
    "fullscreenMode": 0,
    "fakeFullscreen": false,
    "grouped": [],
    "swallowing": "0x0",
    "focusHistoryID": 0
}
postsolar commented 5 months ago

Thank you for approving 👍