hyprland-community / pyprland

Scratchpads & many goodies for Hyprland [maintainer=@fdev31]
MIT License
345 stars 15 forks source link

[scratchpads] Make application unkillable #114

Closed Anakael closed 2 months ago

Anakael commented 2 months ago

Is your feature request related to a problem? Please describe. I'm using scratchpads module to put telegram-desktop in it. If I toggle scratchpad it works fine, but when I use killactive Hyprland command, this scratchpad brokes and when I try to toggle it again I get error:

ERROR:scratch:The client window 0x5858f49026d0 vanished
scratchpads::run_toggle(('telegram',)) failed:
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/pyprland/command.py", line 183, in _run_plugin_handler
    await getattr(plugin, full_name)(*params)
  File "/usr/lib/python3.12/site-packages/pyprland/plugins/scratchpads/__init__.py", line 452, in run_toggle
    await asyncio.gather(*(asyncio.create_task(t()) for t in tasks))
  File "/usr/lib/python3.12/site-packages/pyprland/plugins/scratchpads/__init__.py", line 710, in run_hide
    await scratch.update_client_info(clients=clients)
  File "/usr/lib/python3.12/site-packages/pyprland/plugins/scratchpads/objects.py", line 151, in update_client_info
    raise KeyError(msg)
KeyError: 'Client window 0x5858f49026d0 not found'

Describe the solution you'd like I think it can be handled by changing behavior of killactive command in scratchpad to toggle

Describe alternatives you've considered I've thought about repacing killactive command with script like: https://wiki.hyprland.org/Configuring/Uncommon-tips--tricks/#minimize-steam-instead-of-killing But it's seem so inconvenient to do so for just one application.

Additional context killactive works fine for scratchpad with pavucontrol and wezterm start yazi. Btw, why so? )

Anakael commented 2 months ago

Just dug into sources. Find out that process_tracking option was introduced for this very scenario. Fill free to close the issue.

fdev31 commented 2 months ago

Yep, mostly for progressive Web apps...

https://hyprland-community.github.io/pyprland/scratchpads_nonstandard.html#process-tracking-optional contains some details

Le dim. 16 juin 2024, 01:15, Anakael @.***> a écrit :

Just dug into sources. Find out that process_tracking option was introduced for this very scenario. Fill free to close the issue.

— Reply to this email directly, view it on GitHub https://github.com/hyprland-community/pyprland/issues/114#issuecomment-2170966817, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB2IHVGEUN6E2QBFVOSDNLZHTDKZAVCNFSM6AAAAABJL776XWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZQHE3DMOBRG4 . You are receiving this because you were assigned.Message ID: @.***>